gcc/ChangeLog:
2020-05-19 Martin Liska <mliska@suse.cz>
PR sanitizer/94910
* asan.c (asan_emit_stack_protection): Emit
also **SavedFlagPtr(FakeStack, class_id) = 0 in order to release
a stack frame.
The cost model is currently treating multiplication by element as being more
expensive than 3 same multiplication. This means that if the value is on the
SIMD side we add an unneeded DUP. If the value is on the genreg side we use the
more expensive DUP instead of fmov.
This patch corrects the costs such that the two multiplies are costed the same
which allows us to generate
fmul v3.4s, v3.4s, v0.s[0]
instead of
dup v0.4s, v0.s[0]
fmul v3.4s, v3.4s, v0.4s
gcc/ChangeLog:
* config/aarch64/aarch64.c (aarch64_rtx_mult_cost): Adjust costs for mul.
gcc/testsuite/ChangeLog:
* gcc.target/aarch64/asimd-mull-elem.c: New test.
This gets rid of the linked list of STMT_VINFO_VECT_STMT and
STMT_VINFO_RELATED_STMT in preparation for vectorized stmts no
longer needing a stmt_vec_info (just for this chaining). This
has ripple-down effects in all places we gather vectorized
defs. For this new interfaces are introduced and used
throughout vectorization, simplifying code in a lot of places
and merging it with the SLP way of gathering vectorized
operands. There is vect_get_vec_defs as the new recommended
unified interface and vect_get_vec_defs_for_operand as one
for non-SLP operation. I've resorted to keep the structure
of the code the same where using vect_get_vec_defs would have
been too disruptive for this already large patch.
2020-06-10 Richard Biener <rguenther@suse.de>
* tree-vect-data-refs.c (vect_vfa_access_size): Adjust.
(vect_record_grouped_load_vectors): Likewise.
* tree-vect-loop.c (vect_create_epilog_for_reduction): Likewise.
(vectorize_fold_left_reduction): Likewise.
(vect_transform_reduction): Likewise.
(vect_transform_cycle_phi): Likewise.
(vectorizable_lc_phi): Likewise.
(vectorizable_induction): Likewise.
(vectorizable_live_operation): Likewise.
(vect_transform_loop): Likewise.
* tree-vect-slp.c (vect_get_slp_defs): New function, split out
from overload.
* tree-vect-stmts.c (vect_get_vec_def_for_operand_1): Remove.
(vect_get_vec_def_for_operand): Likewise.
(vect_get_vec_def_for_stmt_copy): Likewise.
(vect_get_vec_defs_for_stmt_copy): Likewise.
(vect_get_vec_defs_for_operand): New function.
(vect_get_vec_defs): Likewise.
(vect_build_gather_load_calls): Adjust.
(vect_get_gather_scatter_ops): Likewise.
(vectorizable_bswap): Likewise.
(vectorizable_call): Likewise.
(vectorizable_simd_clone_call): Likewise.
(vect_get_loop_based_defs): Remove.
(vect_create_vectorized_demotion_stmts): Adjust.
(vectorizable_conversion): Likewise.
(vectorizable_assignment): Likewise.
(vectorizable_shift): Likewise.
(vectorizable_operation): Likewise.
(vectorizable_scan_store): Likewise.
(vectorizable_store): Likewise.
(vectorizable_load): Likewise.
(vectorizable_condition): Likewise.
(vectorizable_comparison): Likewise.
(vect_transform_stmt): Adjust and remove no longer applicable
sanity checks.
* tree-vectorizer.c (vec_info::new_stmt_vec_info): Initialize
STMT_VINFO_VEC_STMTS.
(vec_info::free_stmt_vec_info): Relase it.
* tree-vectorizer.h (_stmt_vec_info::vectorized_stmt): Remove.
(_stmt_vec_info::vec_stmts): Add.
(STMT_VINFO_VEC_STMT): Remove.
(STMT_VINFO_VEC_STMTS): New.
(vect_get_vec_def_for_operand_1): Remove.
(vect_get_vec_def_for_operand): Likewise.
(vect_get_vec_defs_for_stmt_copy): Likewise.
(vect_get_vec_def_for_stmt_copy): Likewise.
(vect_get_vec_defs): New overloads.
(vect_get_vec_defs_for_operand): New.
(vect_get_slp_defs): Declare.
This patch fixes a latent bug exposed by eb72dc663e.
See the discussion on the bug for details.
Bootstrapped and regtested on aarch64-linux-gnu. No new fails introduced.
2020-06-10 Qian Chao <qianchao9@huawei.com>
gcc/ChangeLog:
PR tree-optimization/95569
* trans-mem.c (expand_assign_tm): Ensure that rtmp is marked TREE_ADDRESSABLE.
gcc/testsuite/ChangeLog:
PR tree-optimization/95569
* gcc.dg/tm/pr95569.c: New test.
gcc/ChangeLog:
2020-03-20 Martin Liska <mliska@suse.cz>
PR tree-optimization/92860
* optc-save-gen.awk: Generate new function cl_optimization_compare.
* opth-gen.awk: Generate declaration of the function.
gcc/c-family/ChangeLog:
2020-03-20 Martin Liska <mliska@suse.cz>
PR tree-optimization/92860
* c-attribs.c (handle_optimize_attribute):
Save global options and compare it after parsing of function
attribute.
* c-pragma.c (opt_stack::saved_global_options): New field.
(handle_pragma_push_options): Save global_options.
(handle_pragma_pop_options): Compare them after pop.
This changes some error messages to be more self-consistent and to fix
some grammar.
contrib/ChangeLog:
* gcc-changelog/git_commit.py (GitCommit.parse_changelog):
Improve error strings.
* gcc-changelog/test_email.py: Update expected errors.
As clarified by LWG 3265, std::move_iterator is supposed to have an
assignment operator that converts from a different specialization of
std::move_iterator, which performs an assignment. That has always been
missing from libstdc++, so assigning a different type actually performs
a converting construction, then an assignment. This is non-conforming
for the (fairly contrived) case where the converting assignment is
well-formed but the converting construction is not.
* include/bits/stl_iterator.h (move_iterator::operator=): Define.
* testsuite/24_iterators/move_iterator/dr3265.cc: New test.
The standard requires that std::bad_optional_access' default
constructor has a non-throwing exception specification.
* include/std/optional (bad_optional_access): Define default
constructor and destructor as defaulted.
* testsuite/20_util/optional/bad_access.cc: New test.
This patch adds support for the two new HWCAP2 fields used by the
__builtin_cpu_supports function. It adds support in the target_clones
attribute for -mcpu=future.
The two new __builtin_cpu_supports tests are:
__builtin_cpu_supports ("isa_3_1")
__builtin_cpu_supports ("mma")
The bits used are the bits that the Linux kernel engineers will be using for
these new features.
gcc/
2020-06-09 Michael Meissner <meissner@linux.ibm.com>
* config/rs6000/ppc-auxv.h (PPC_PLATFORM_FUTURE): Allocate
'future' PowerPC platform.
(PPC_FEATURE2_ARCH_3_1): New HWCAP2 bit for ISA 3.1.
(PPC_FEATURE2_MMA): New HWCAP2 bit for MMA.
* config/rs6000/rs6000-call.c (cpu_supports_info): Add ISA 3.1 and
MMA HWCAP2 bits.
* config/rs6000/rs6000.c (CLONE_ISA_3_1): New clone support.
(rs6000_clone_map): Add 'future' system target_clones support.
testsuite/
2020-06-09 Michael Meissner <meissner@linux.ibm.com>
* gcc.target/powerpc/clone3.c: New test for using 'future' with
the target_clones attribute.
This patch adds support for the two new HWCAP2 fields used by the
__builtin_cpu_supports function. It adds support in the target_clones
attribute for -mcpu=future.
The two new __builtin_cpu_supports tests are:
__builtin_cpu_supports ("isa_3_1")
__builtin_cpu_supports ("mma")
The bits used are the bits that the Linux kernel engineers will be using for
these new features.
testsuite/
2020-06-05 Michael Meissner <meissner@linux.ibm.com>
* gcc.target/powerpc/clone3.c: New test for using 'future' with
the target_clones attribute.
This patch adds support for the two new HWCAP2 fields used by the
__builtin_cpu_supports function. It adds support in the target_clones
attribute for -mcpu=future.
The two new __builtin_cpu_supports tests are:
__builtin_cpu_supports ("isa_3_1")
__builtin_cpu_supports ("mma")
The bits used are the bits that the Linux kernel engineers will be using for
these new features.
gcc/
2020-06-05 Michael Meissner <meissner@linux.ibm.com>
* config/rs6000/ppc-auxv.h (PPC_PLATFORM_FUTURE): Allocate
'future' PowerPC platform.
(PPC_FEATURE2_ARCH_3_1): New HWCAP2 bit for ISA 3.1.
(PPC_FEATURE2_MMA): New HWCAP2 bit for MMA.
* config/rs6000/rs6000-call.c (cpu_supports_info): Add ISA 3.1 and
MMA HWCAP2 bits.
* config/rs6000/rs6000.c (CLONE_ISA_3_1): New clone support.
(rs6000_clone_map): Add 'future' system target_clones support.
The attached patch fixes the problem and is what we use in Spack to
make GCC build with zstd support.
gcc/
* Makefile.in (ZSTD_INC): Define.
(ZSTD_LIB): Include ZSTD_LDFLAGS.
(CFLAGS-lto-compress.o): Add ZSTD_INC.
* configure.ac (ZSTD_CPPFLAGS, ZSTD_LDFLAGS): New variables for
AC_SUBST.
* configure: Rebuilt.
Part of the PR notes that there are UBSAN fails for the coroutines
test suite. These are primarily related to the use of the same DTOR
tree in the two edges from the await block. Fixed by building a new
tree for each.
gcc/cp/ChangeLog:
PR c++/95137
* coroutines.cc (expand_one_await_expression): Build separate
DTOR trees for the awaitable object on the destroy and resume
paths.
The problem in this testcase comes from cloning the constructor into
complete and base variants. When we clone the body the first time,
walk_tree_1 calls copy_tree_body_r on the type of the artificial TYPE_DECL
we made for the VLA type without calling it on the decl itself, so we
overwrite the type of the TYPE_DECL without copying the decl first.
This has been broken since we started inserting a TYPE_DECL for anonymous
VLAs in r7-457.
This patch fixes walk_tree_1 to call the function on the TYPE_DECL, as we do
for other decls of a DECL_EXPR.
gcc/ChangeLog:
PR c++/95552
* tree.c (walk_tree_1): Call func on the TYPE_DECL of a DECL_EXPR.
gcc/testsuite/ChangeLog:
PR c++/95552
* g++.dg/ext/vla23.C: New test.
Add support to optionally emit different instrumentation for accesses to
volatile variables. While the default TSAN runtime likely will never
require this feature, other runtimes for different environments that
have subtly different memory models or assumptions may require
distinguishing volatiles.
One such environment are OS kernels, where volatile is still used in
various places, and often declare volatile to be appropriate even in
multi-threaded contexts. One such example is the Linux kernel, which
implements various synchronization primitives using volatile
(READ_ONCE(), WRITE_ONCE()).
Here the Kernel Concurrency Sanitizer (KCSAN), is a runtime that uses
TSAN instrumentation but otherwise implements a very different approach
to race detection from TSAN:
https://github.com/google/ktsan/wiki/KCSAN
Due to recent changes in requirements by the Linux kernel, KCSAN
requires that the compiler supports tsan-distinguish-volatile (among
several new requirements):
https://lore.kernel.org/lkml/20200521142047.169334-7-elver@google.com/
gcc/
* params.opt: Define --param=tsan-distinguish-volatile=[0,1].
* sanitizer.def (BUILT_IN_TSAN_VOLATILE_READ1): Define new
builtin for volatile instrumentation of reads/writes.
(BUILT_IN_TSAN_VOLATILE_READ2): Likewise.
(BUILT_IN_TSAN_VOLATILE_READ4): Likewise.
(BUILT_IN_TSAN_VOLATILE_READ8): Likewise.
(BUILT_IN_TSAN_VOLATILE_READ16): Likewise.
(BUILT_IN_TSAN_VOLATILE_WRITE1): Likewise.
(BUILT_IN_TSAN_VOLATILE_WRITE2): Likewise.
(BUILT_IN_TSAN_VOLATILE_WRITE4): Likewise.
(BUILT_IN_TSAN_VOLATILE_WRITE8): Likewise.
(BUILT_IN_TSAN_VOLATILE_WRITE16): Likewise.
* tsan.c (get_memory_access_decl): Argument if access is
volatile. If param tsan-distinguish-volatile is non-zero, and
access if volatile, return volatile instrumentation decl.
(instrument_expr): Check if access is volatile.
gcc/testsuite/
* c-c++-common/tsan/volatile.c: New test.
This removes dead code left over from the reduction vectorization
refactoring last year.
2020-06-09 Richard Biener <rguenther@suse.de>
* tree-vect-loop.c (vectorizable_induction): Remove dead code.
We only need to predeclare a VLA type if it's wrapped in a pointer type;
otherwise gimplify_type_sizes will handle it.
gcc/cp/ChangeLog:
PR c++/95552
* cp-gimplify.c (predeclare_vla): Only predeclare a VLA if it's
wrapped in a pointer type.
gcc/ChangeLog:
* omp-offload.c (add_decls_addresses_to_decl_constructor,
omp_finish_file): With in_lto_p, stream out all offload-table
items even if the symtab_node does not exist.
This removes dead code that was left over from the reduction
vectorization refactoring last year.
2020-06-09 Richard Biener <rguenther@suse.de>
* tree-vect-stmts.c (vect_transform_stmt): Remove dead code.
MD patterns extended for unary ops ABS, CLS, CLZ, CNT, NEG and NOT
to support unpacked vectors. Also extended patterns for BIC to
support unpacked vectors where input elements are of the same width.
gcc/ChangeLog:
2020-06-09 Joe Ramsay <joe.ramsay@arm.com>
* config/aarch64/aarch64-sve.md (<optab><mode>2): Add support for
unpacked vectors.
(@aarch64_pred_<optab><mode>): Add support for unpacked vectors.
(@aarch64_bic<mode>): Enable unpacked BIC.
(*bic<mode>3): Enable unpacked BIC.
gcc/testsuite/ChangeLog:
2020-06-09 Joe Ramsay <joe.ramsay@arm.com>
* gcc.target/aarch64/sve/logical_unpacked_abs.c: New test.
* gcc.target/aarch64/sve/logical_unpacked_bic_1.c: New test.
* gcc.target/aarch64/sve/logical_unpacked_bic_2.c: New test.
* gcc.target/aarch64/sve/logical_unpacked_bic_3.c: New test.
* gcc.target/aarch64/sve/logical_unpacked_bic_4.c: New test.
* gcc.target/aarch64/sve/logical_unpacked_neg.c: New test.
* gcc.target/aarch64/sve/logical_unpacked_not.c: New test.
The patch fixes tree-prof.exp tests on solaris11 and i686-linux-gnu,
problem was that sizeof of a pointer is different from sizeof gcov_type.
I'm going to install it if there are no objections.
Thanks,
Martin
libgcc/ChangeLog:
PR gcov-profile/95494
* libgcov-driver.c (write_top_counters): Cast first to
intptr_t as sizeof(*) != sizeof(gcov_type).
* libgcov.h (gcov_counter_set_if_null): Remove.
(gcov_topn_add_value): Cast first to intptr_t and update
linked list directly.
2020-06-09 Javier Miranda <miranda@adacore.com>
gcc/ada/
* sem_ch6.adb (New_Overloaded_Entity): Add missing call to check
subtype conformance of overriding dispatching primitive.
* sem_eval.adb (Subtypes_Statically_Match): Handle derivations
of private subtypes.
* libgnat/g-exptty.adb, libgnat/g-exptty.ads
(Set_Up_Communications): Fix the profile since null-exclusion is
missing in the access type formals.
* sem_disp.ads (Check_Operation_From_Private_View): Adding
documentation.
2020-06-09 Arnaud Charlet <charlet@adacore.com>
gcc/ada/
* exp_ch3.adb, exp_ch4.adb, exp_ch6.adb, exp_ch9.adb,
exp_disp.adb, exp_util.adb: Add comments related to errors that
should be moved to semantic analysis. Also replace "?" with "??"
in warning messages.
2020-06-09 Ed Schonberg <schonberg@adacore.com>
gcc/ada/
* sem_ch12.adb (Check_Shared_Variable_Control_Aspects): Require
exact match between formal and actual for aspects Atomic and
Volatile only for formal derived types.
2020-06-09 Arnaud Charlet <charlet@adacore.com>
gcc/ada/
* exp_aggr.adb (Max_Aggregate_Size): New function to factorize
code.
(Convert_To_Positional, Aggr_Size_OK): Use Max_Aggregate_Size.
2020-06-09 Justin Squirek <squirek@adacore.com>
gcc/ada/
* einfo.ads (Returns_By_Ref): Modify documentation to reflect
that Returns_By_Ref can be applied to E_Subprogram_Type
entities.
2020-06-09 Justin Squirek <squirek@adacore.com>
gcc/ada/
* exp_attr.adb (Expand_N_Attribute_Reference): Modify expansion
of 'Overlaps_Storage to take into account zero sized arrays.
2020-06-09 Eric Botcazou <ebotcazou@adacore.com>
gcc/ada/
* checks.adb (Apply_Predicate_Check): Extend trick used for
aggregates to qualified aggregates and object declarations
* einfo.ads (Has_Own_DIC): Mention the underlying full view.
(Has_Own_Invariants): Likewise.
(Has_Predicates): Likewise.
* exp_util.adb (Build_DIC_Procedure_Declaration): Do not deal
with base types explicitly but with underlying full views.
(Build_Invariant_Procedure_Declaration): Likewise.
* sem_ch13.adb (Build_Predicate_Functions): Do not deal with
the full view manually but call Propagate_Predicate_Attributes
to propagate attributes to views.
(Build_Predicate_Function_Declaration): Likewise.
* sem_ch3.adb (Build_Assertion_Bodies_For_Type): Build bodies
for private full views with an underlying full view.
(Build_Derived_Private_Type): Small comment tweak.
(Complete_Private_Subtype): Call Propagate_Predicate_Attributes.
(Process_Full_View): Do not deal with base types explicitly for
DIC and Invariant attributes. Deal with underlying full views
for them. Call Propagate_Predicate_Attributes and deal with
underlying full views for them.
* sem_ch7.adb (Preserve_Full_Attributes): Do not cross propagate
DIC and Invariant attributes between full type and its base type.
Propagate Predicate attributes from the full to the private view.
* sem_ch9.adb (Analyze_Protected_Type_Declaration): Likewise.
(Analyze_Task_Type_Declaration): Likewise.
* sem_util.ads (Get_Views): Remove Full_Base parameter and add
UFull_Typ parameter.
(Propagate_Predicate_Attributes): New procedure.
* sem_util.adb (Get_Views): Remove Full_Base parameter and add
UFull_Typ parameter. Retrieve the Corresponding_Record_Type
from the underlying full view, if any.
(Propagate_DIC_Attributes): Remove useless tests.
(Propagate_Invariant_Attributes): Likewise.
(Propagate_Predicate_Attributes): New procedure.
2020-06-09 Justin Squirek <squirek@adacore.com>
gcc/ada/
* exp_ch5.adb (Expand_Predicated_Loop): Perserve the original
loop identifier within the expansion.
2020-06-09 Bob Duff <duff@adacore.com>
gcc/ada/
* bindo-graphs.ads (Library_Graph_Edge_Kind): Reorder enumerals
to reflect the order of adding edges. Clarify comments.
* bindo-graphs.adb (Add_Edge_Kind_Check): Correct the
assertions. Reorder the "when"s to match the order of adding
edges, and therefore the order of enumerals in type
Library_Graph_Edge_Kind. Change names to "Old_" and "New_" to
clarify what's what. Combine Invocation_Edge into the "<="
test. Fix the "raise Program_Error" message, which was
backwards.