aboutsummaryrefslogtreecommitdiff
path: root/gcc
AgeCommit message (Collapse)AuthorFilesLines
2021-01-18[arm,testsuite]: Fix options for vceqz_p64.c and vceqzq_p64.cChristophe Lyon2-2/+4
These two tests need: dg-require-effective-target arm_crypto_ok dg-add-options arm_crypto because they use intrinsics that need -mfpu=crypto-neon-fp-armv8. 2021-01-18 Christophe Lyon <christophe.lyon@linaro.org> gcc/testsuite/ PR target/71233 * gcc.target/arm/simd/vceqz_p64.c: Use arm_crypto options. * gcc.target/arm/simd/vceqzq_p64.c: Likewise.
2021-01-18testsuite/97299 - fix test condition of gcc.dg/vect/slp-reduc-3.cRichard Biener1-1/+2
This avoids looking for permute optimization when SLP cannot be applied. 2021-01-18 Richard Biener <rguenther@suse.de> PR testsuite/97299 * gcc.dg/vect/slp-reduc-3.c: Guard VEC_PERM_EXPR scan.
2021-01-17testsuite: powerpc fold-vec and sse updates.David Edelsohn12-12/+16
Recent code generation changes have affected the count of some instructions. This patch updates the instruction count for fold-vec-extract on P7 and P8. Also, some of SSE emulation intrinsics only work on LE systems. gcc/testsuite/ChangeLog: * gcc.target/powerpc/fold-vec-extract-char.p7.c: Adjust addi count. * gcc.target/powerpc/fold-vec-extract-double.p7.c: Same. * gcc.target/powerpc/fold-vec-extract-float.p7.c: Same. * gcc.target/powerpc/fold-vec-extract-float.p8.c: Same. * gcc.target/powerpc/fold-vec-extract-int.p7.c: Same. * gcc.target/powerpc/fold-vec-extract-int.p8.c: Same. * gcc.target/powerpc/fold-vec-extract-short.p7.c: Same. * gcc.target/powerpc/fold-vec-extract-short.p8.c: Same. * gcc.target/powerpc/sse-andnps-1.c: Restrict to LE. * gcc.target/powerpc/sse-movhps-1.c: Restrict to LE. * gcc.target/powerpc/sse-movlps-1.c: Restrict to LE. * gcc.target/powerpc/sse2-andnpd-1.c: Restrict to LE.
2021-01-17Fix ChangeLog entries.Jerry DeLisle1-1/+1
2021-01-18Daily bump.GCC Administrator4-1/+42
2021-01-17testsuite: Skip DWARF 5 testcases on AIX.David Edelsohn11-1/+12
AIX does not support DWARF 5. This patch skips the DWARF 5-specific testcases. gcc/testsuite/ChangeLog: * g++.dg/debug/dwarf2/inline-ns-2.C: Skip on AIX. * g++.dg/debug/dwarf2/inline-var-2.C: Skip on AIX. * g++.dg/debug/dwarf2/inline-var-3.C: Skip on AIX. * g++.dg/debug/dwarf2/lang-cpp11.C: Skip on AIX. * g++.dg/debug/dwarf2/lang-cpp14.C: Skip on AIX. * g++.dg/debug/dwarf2/lang-cpp17.C: Skip on AIX. * g++.dg/debug/dwarf2/lang-cpp20.C: Skip on AIX. * gcc.dg/debug/dwarf2/inline6.c: Skip on AIX. * gcc.dg/debug/dwarf2/lang-c11.c: Skip on AIX. * gcc.dg/debug/dwarf2/pr41445-7.c: Skip on AIX. * gcc.dg/debug/dwarf2/pr41445-8.c: Skip on AIX.
2021-01-17aix: default to DWARF 4.David Edelsohn2-0/+6
GCC now defaults to DWARF 5. AIX only supports DWARF 4 (3.5). This patch overrides the default DWARF version to 4 unless explicitly stated. gcc/ChangeLog: * config/rs6000/aix71.h (SUBTARGET_OVERRIDE_OPTIONS): Override dwarf_version to 4. * config/rs6000/aix72.h (SUBTARGET_OVERRIDE_OPTIONS): Same.
2021-01-17Avoid assuming SSA_NAME_IDENTIFIER is nonnull.Martin Sebor1-11/+16
gcc/c-family/ChangeLog: * c-pretty-print.c (c_pretty_printer::primary_expression): Don't assume SSA_NAME_IDENTIFIER evaluates to nonzero.
2021-01-17ipa: Adjust cgraph verifier to materialization on demand (PR 98222)Martin Jambor2-1/+22
after switching to materialization of clones on demand, the verifier can happen to see edges leading to a clone of a materialized clone. This means its clone_of is NULL and former_clone_of needs to be checked in order to verify that the callee is a clone of the original decl, which it did not do and reported edges to pointing to a wrong place. Fixed with the following patch, which has been pre-approved by Honza. Bootstrapped and tested on x86_64-linux, pushed to master. Martin gcc/ChangeLog: 2021-01-15 Martin Jambor <mjambor@suse.cz> PR ipa/98222 * cgraph.c (clone_of_p): Check also former_clone_of as we climb the clone tree. gcc/testsuite/ChangeLog: 2021-01-15 Martin Jambor <mjambor@suse.cz> PR ipa/98222 * gcc.dg/ipa/pr98222.c: New test.
2021-01-17Default to DWARF5Mark Wielaard2-4/+5
gcc/ChangeLog: * common.opt (gdwarf-): Init(5). * doc/invoke.texi (-gdwarf): Document default to 5.
2021-01-17Daily bump.GCC Administrator7-1/+141
2021-01-16testsuite: Fix up a testcase to find the right ISO_Fortran_binding.h.Jakub Jelinek1-1/+1
2021-01-16 Jakub Jelinek <jakub@redhat.com> * gfortran.dg/iso_fortran_binding_uint8_array_driver.c: Include ../../../libgfortran/ISO_Fortran_binding.h rather than ISO_Fortran_binding.h.
2021-01-16openmp: Add support for the OpenMP 5.0 task detach clauseKwok Cheung Yeung26-40/+546
2021-01-16 Kwok Cheung Yeung <kcy@codesourcery.com> gcc/ * builtin-types.def (BT_FN_VOID_OMPFN_PTR_OMPCPYFN_LONG_LONG_BOOL_UINT_PTR_INT): Rename to... (BT_FN_VOID_OMPFN_PTR_OMPCPYFN_LONG_LONG_BOOL_UINT_PTR_INT_PTR): ...this. Add extra argument. * gimplify.c (omp_default_clause): Ensure that event handle is firstprivate in a task region. (gimplify_scan_omp_clauses): Handle OMP_CLAUSE_DETACH. (gimplify_adjust_omp_clauses): Likewise. * omp-builtins.def (BUILT_IN_GOMP_TASK): Change function type to BT_FN_VOID_OMPFN_PTR_OMPCPYFN_LONG_LONG_BOOL_UINT_PTR_INT_PTR. * omp-expand.c (expand_task_call): Add GOMP_TASK_FLAG_DETACH to flags if detach clause specified. Add detach argument when generating call to GOMP_task. * omp-low.c (scan_sharing_clauses): Setup data environment for detach clause. (finish_taskreg_scan): Move field for variable containing the event handle to the front of the struct. * tree-core.h (enum omp_clause_code): Add OMP_CLAUSE_DETACH. Fix ordering. * tree-nested.c (convert_nonlocal_omp_clauses): Handle OMP_CLAUSE_DETACH clause. (convert_local_omp_clauses): Handle OMP_CLAUSE_DETACH clause. * tree-pretty-print.c (dump_omp_clause): Handle OMP_CLAUSE_DETACH. * tree.c (omp_clause_num_ops): Add entry for OMP_CLAUSE_DETACH. Fix ordering. (omp_clause_code_name): Add entry for OMP_CLAUSE_DETACH. Fix ordering. (walk_tree_1): Handle OMP_CLAUSE_DETACH. gcc/c-family/ * c-pragma.h (pragma_omp_clause): Add PRAGMA_OMP_CLAUSE_DETACH. Redefine PRAGMA_OACC_CLAUSE_DETACH. gcc/c/ * c-parser.c (c_parser_omp_clause_detach): New. (c_parser_omp_all_clauses): Handle PRAGMA_OMP_CLAUSE_DETACH clause. (OMP_TASK_CLAUSE_MASK): Add mask for PRAGMA_OMP_CLAUSE_DETACH. * c-typeck.c (c_finish_omp_clauses): Handle PRAGMA_OMP_CLAUSE_DETACH clause. Prevent use of detach with mergeable and overriding the data sharing mode of the event handle. gcc/cp/ * parser.c (cp_parser_omp_clause_detach): New. (cp_parser_omp_all_clauses): Handle PRAGMA_OMP_CLAUSE_DETACH. (OMP_TASK_CLAUSE_MASK): Add mask for PRAGMA_OMP_CLAUSE_DETACH. * pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_DETACH clause. * semantics.c (finish_omp_clauses): Handle OMP_CLAUSE_DETACH clause. Prevent use of detach with mergeable and overriding the data sharing mode of the event handle. gcc/fortran/ * dump-parse-tree.c (show_omp_clauses): Handle detach clause. * frontend-passes.c (gfc_code_walker): Walk detach expression. * gfortran.h (struct gfc_omp_clauses): Add detach field. (gfc_c_intptr_kind): New. * openmp.c (gfc_free_omp_clauses): Free detach clause. (gfc_match_omp_detach): New. (enum omp_mask1): Add OMP_CLAUSE_DETACH. (enum omp_mask2): Remove OMP_CLAUSE_DETACH. (gfc_match_omp_clauses): Handle OMP_CLAUSE_DETACH for OpenMP. (OMP_TASK_CLAUSES): Add OMP_CLAUSE_DETACH. (resolve_omp_clauses): Prevent use of detach with mergeable and overriding the data sharing mode of the event handle. * trans-openmp.c (gfc_trans_omp_clauses): Handle detach clause. * trans-types.c (gfc_c_intptr_kind): New. (gfc_init_kinds): Initialize gfc_c_intptr_kind. * types.def (BT_FN_VOID_OMPFN_PTR_OMPCPYFN_LONG_LONG_BOOL_UINT_PTR_INT): Rename to... (BT_FN_VOID_OMPFN_PTR_OMPCPYFN_LONG_LONG_BOOL_UINT_PTR_INT_PTR): ...this. Add extra argument. gcc/testsuite/ * c-c++-common/gomp/task-detach-1.c: New. * g++.dg/gomp/task-detach-1.C: New. * gcc.dg/gomp/task-detach-1.c: New. * gfortran.dg/gomp/task-detach-1.f90: New. include/ * gomp-constants.h (GOMP_TASK_FLAG_DETACH): New. libgomp/ * fortran.c (omp_fulfill_event_): New. * libgomp.h (struct gomp_task): Add detach and completion_sem fields. (struct gomp_team): Add task_detach_queue and task_detach_count fields. * libgomp.map (OMP_5.0.1): Add omp_fulfill_event and omp_fulfill_event_. * libgomp_g.h (GOMP_task): Add extra argument. * omp.h.in (enum omp_event_handle_t): New. (omp_fulfill_event): New. * omp_lib.f90.in (omp_event_handle_kind): New. (omp_fulfill_event): New. * omp_lib.h.in (omp_event_handle_kind): New. (omp_fulfill_event): Declare. * priority_queue.c (priority_tree_find): New. (priority_list_find): New. (priority_queue_find): New. * priority_queue.h (priority_queue_predicate): New. (priority_queue_find): New. * task.c (gomp_init_task): Initialize detach field. (task_fulfilled_p): New. (GOMP_task): Add detach argument. Ignore detach argument if GOMP_TASK_FLAG_DETACH not set in flags. Initialize completion_sem field. Copy address of completion_sem into detach argument and into the start of the data record. Wait for detach event if task not deferred. (gomp_barrier_handle_tasks): Queue tasks with unfulfilled events. Remove completed tasks and requeue dependent tasks. (omp_fulfill_event): New. * team.c (gomp_new_team): Initialize task_detach_queue and task_detach_count fields. (free_team): Free task_detach_queue field. * testsuite/libgomp.c-c++-common/task-detach-1.c: New testcase. * testsuite/libgomp.c-c++-common/task-detach-2.c: New testcase. * testsuite/libgomp.c-c++-common/task-detach-3.c: New testcase. * testsuite/libgomp.c-c++-common/task-detach-4.c: New testcase. * testsuite/libgomp.c-c++-common/task-detach-5.c: New testcase. * testsuite/libgomp.c-c++-common/task-detach-6.c: New testcase. * testsuite/libgomp.fortran/task-detach-1.f90: New testcase. * testsuite/libgomp.fortran/task-detach-2.f90: New testcase. * testsuite/libgomp.fortran/task-detach-3.f90: New testcase. * testsuite/libgomp.fortran/task-detach-4.f90: New testcase. * testsuite/libgomp.fortran/task-detach-5.f90: New testcase. * testsuite/libgomp.fortran/task-detach-6.f90: New testcase.
2021-01-16RTEMS: Add -mcustom-fpu-cfg=fph2 multilibSebastian Huber1-128/+18
This multilib supports Nios II configurations with the "Nios II Floating Point Hardware 2 Component". gcc/ * config/nios2/t-rtems: Reset all MULTILIB_* variables. Shorten multilib directory names. Use MULTILIB_REQUIRED instead of MULTILIB_EXCEPTIONS. Add -mhw-mul -mhw-mulx -mhw-div -mcustom-fpu-cfg=fph2 multilib.
2021-01-16nios2: Add -mcustom-fpu-cfg=fph2Sebastian Huber2-1/+50
The new -mcustom-fpu-cfg=fph2 option variant is useful to build a multilib for the "Nios II Floating Point Hardware 2 Component": https://www.intel.com/content/dam/www/programmable/us/en/pdfs/literature/ug/ug_nios2_custom_instruction.pdf Directly using the corresponding -mcustom-insn=N options for this floating-point unit leads to a combinatorial explosion in the potential count of multilibs which may break the build. gcc/ * config/nios2/nios2.c (NIOS2_FPU_CONFIG_NUM): Adjust value. (nios2_init_fpu_configs): Provide register values for new -mcustom-fpu-cfg=fph2 option variant. * doc/invoke.texi (-mcustom-fpu-cfg=fph2): Document new option variant.
2021-01-16nios2: Remove custom instruction warningsSebastian Huber1-28/+0
Do not warn if custom instructions are not used due to missing optimization flags. This prevents build errors with -Werror which cannot be disabled via a dedicated warning option. One reason to remove these warnings is to enable a multilib for the "Nios II Floating Point Hardware 2 Component". For example, the libatomic target library in GCC is built with -Werror and the warnings removed by this patch resulted in errors like: cc1: error: switch '-mcustom-fmins' has no effect unless '-ffinite-math-only' is specified [-Werror] cc1: error: switch '-mcustom-fmaxs' has no effect unless '-ffinite-math-only' is specified [-Werror] cc1: error: switch '-mcustom-round' has no effect unless '-fno-math-errno' is specified [-Werror] gcc/ * config/nios2/nios2.c (nios2_custom_check_insns): Remove custom instruction warnings.
2021-01-16match.pd: Optimize ((cst << x) & 1) [PR96669]Jakub Jelinek3-1/+38
While we had a ((1 << x) & 1) != 0 to x == 0 optimization already, this patch adds ((cst << x) & 1) optimization too, this time the second constant must be 1 though, not some power of two, but the first one can be any constant. If it is even, the result is false, if it is odd, the result is x == 0. 2021-01-16 Jakub Jelinek <jakub@redhat.com> PR tree-optimization/96669 * match.pd ((CST << x) & 1 -> x == 0): New simplification. * gcc.dg/tree-ssa/pr96669-1.c: Adjust regexp. * gcc.dg/tree-ssa/pr96669-2.c: New test.
2021-01-16cd_dce: Return TODO_update_address_taken from last cd_dce [PR96271]Jakub Jelinek3-5/+29
On the following testcase, handle_builtin_memcmp in the strlen pass folds the memcmp into comparison of two MEM_REFs. But nothing triggers updating of addressable vars afterwards, so even when the parameters are no longer address taken, we force the parameters to stack and back anyway. This patch causes TODO_update_address_taken to happen right before last forwprop pass (at the end of last cd_dce), so after strlen1 too. 2021-01-16 Jakub Jelinek <jakub@redhat.com> PR tree-optimization/96271 * passes.def: Pass false argument to first two pass_cd_dce instances and true to last instance. Add comment that last instance rewrites no longer addressed locals. * tree-ssa-dce.c (pass_cd_dce): Add update_address_taken_p member and initialize it. (pass_cd_dce::set_pass_param): New method. (pass_cd_dce::execute): Return TODO_update_address_taken from last cd_dce instance. * gcc.target/i386/pr96271.c: New test.
2021-01-16Daily bump.GCC Administrator7-1/+384
2021-01-15rs6000, vector integer multiply/divide/modulo instructionsCarl Love8-54/+760
2021-01-15 Carl Love <cel@us.ibm.com> gcc/ChangeLog: * config/rs6000/altivec.h (vec_mulh, vec_div, vec_dive, vec_mod): New defines. * config/rs6000/altivec.md (VIlong): Move define to file vsx.md. * config/rs6000/rs6000-builtin.def (DIVES_V4SI, DIVES_V2DI, DIVEU_V4SI, DIVEU_V2DI, DIVS_V4SI, DIVS_V2DI, DIVU_V4SI, DIVU_V2DI, MODS_V2DI, MODS_V4SI, MODU_V2DI, MODU_V4SI, MULHS_V2DI, MULHS_V4SI, MULHU_V2DI, MULHU_V4SI, MULLD_V2DI): Add builtin define. (MULH, DIVE, MOD): Add new BU_P10_OVERLOAD_2 definitions. * config/rs6000/rs6000-call.c (VSX_BUILTIN_VEC_DIV, VSX_BUILTIN_VEC_DIVE, P10_BUILTIN_VEC_MOD, P10_BUILTIN_VEC_MULH): New overloaded definitions. (builtin_function_type) [P10V_BUILTIN_DIVEU_V4SI, P10V_BUILTIN_DIVEU_V2DI, P10V_BUILTIN_DIVU_V4SI, P10V_BUILTIN_DIVU_V2DI, P10V_BUILTIN_MODU_V2DI, P10V_BUILTIN_MODU_V4SI, P10V_BUILTIN_MULHU_V2DI, P10V_BUILTIN_MULHU_V4SI]: Add case statement for builtins. * config/rs6000/rs6000.md (bits): Add new attribute sizes V4SI, V2DI. * config/rs6000/vsx.md (VIlong): Moved from config/rs6000/altivec.md. (UNSPEC_VDIVES, UNSPEC_VDIVEU): New unspec definitions. (vsx_mul_v2di): Add if TARGET_POWER10 statement. (vsx_udiv_v2di): Add if TARGET_POWER10 statement. (dives_<mode>, diveu_<mode>, div<mode>3, uvdiv<mode>3, mods_<mode>, modu_<mode>, mulhs_<mode>, mulhu_<mode>, mulv2di3): Add define_insn, mode is VIlong. * doc/extend.texi (vec_mulh, vec_mul, vec_div, vec_dive, vec_mod): Add builtin descriptions. gcc/testsuite/ChangeLog: * gcc.target/powerpc/builtins-1-p10-runnable.c: New test file.
2021-01-15Reset force_source_line in final.cEric Botcazou1-0/+1
Unlike the other global variables, it is not reset at the beginning of a function so can leak into the next one. gcc/ChangeLog: * final.c (final_start_function_1): Reset force_source_line.
2021-01-15fortran: Fixes a bug in ISO_Fortran_binding.c.Jerry DeLisle2-0/+36
libgfortran/ChangeLog: * runtime/ISO_Fortran_binding.c (CFI_establish): Fixed signed char arrays. Signed char or uint8_t arrays would cause crashes unless an element size is specified. gcc/testsuite/ChangeLog: * gfortran.dg/iso_fortran_binding_uint8_array.f90: New test. * gfortran.dg/iso_fortran_binding_uint8_array_driver.c: New test.
2021-01-15c++: Fix qualified array-type construction [PR 98538]Nathan Sidwell2-3/+23
This was an assert that was too picky. The reason I had to alter array construction was that on stream in, we cannot dynamically determine a type's dependentness. Thus on stream out of the 'problematic' types, we save the dependentness for reconstruction. Fortunately the paths into cp_build_qualified_type_real from streamin with arrays do have the array's dependentess set as needed. PR c++/98538 gcc/cp/ * tree.c (cp_build_qualified_type_real): Propagate an array's dependentness to the copy, if known. gcc/testsuite/ * g++.dg/template/pr98538.C: New.
2021-01-15preprocessor: Make quoting : [PR 95253]Nathan Sidwell3-7/+7
I missed some testsuite fall out with my patch to fix mkdeps file mangling. PR preprocessor/95253 gcc/testsuite/ * g++.dg/modules/dep-1_a.C: Adjust expected output. * g++.dg/modules/dep-1_b.C: Likewise. * g++.dg/modules/dep-2.C: Likewise.
2021-01-15match.pd: Generalize the PR64309 simplifications [PR96669]Jakub Jelinek2-4/+76
The following patch generalizes the PR64309 simplifications, so that instead of working only with constants 1 and 1 it works with any two power of two constants, and works also for right shift (in that case it rules out the first one being negative, as it is arithmetic shift then). 2021-01-15 Jakub Jelinek <jakub@redhat.com> PR tree-optimization/96669 * match.pd (((1 << A) & 1) != 0 -> A == 0, ((1 << A) & 1) == 0 -> A != 0): Generalize for 1s replaced by possibly different power of two constants and to right shift too. * gcc.dg/tree-ssa/pr96669-1.c: New test.
2021-01-15match.pd: Optimize (x < 0) ^ (y < 0) to (x ^ y) < 0 etc. [PR96681]Jakub Jelinek2-0/+53
This patch simplifies comparisons that test the sign bit xored together. If the comparisons are both < 0 or both >= 0, then we should xor the operands together and compare the result to < 0, if the comparisons are different, we should compare to >= 0. 2021-01-15 Jakub Jelinek <jakub@redhat.com> PR tree-optimization/96681 * match.pd ((x < 0) ^ (y < 0) to (x ^ y) < 0): New simplification. ((x >= 0) ^ (y >= 0) to (x ^ y) < 0): Likewise. ((x < 0) ^ (y >= 0) to (x ^ y) >= 0): Likewise. ((x >= 0) ^ (y < 0) to (x ^ y) >= 0): Likewise. * gcc.dg/tree-ssa/pr96681.c: New test.
2021-01-15drop -dumpbase-ext from producer stringAlexandre Oliva1-0/+1
The -dumpbase and -dumpdir options are excluded from the producer string output in debug information, but -dumpbase-ext was not. This patch excludes it as well. for gcc/ChangeLog * opts.c (gen_command_line_string): Exclude -dumpbase-ext.
2021-01-15c++: Avoid redundant copy in {} init [PR98642]Jason Merrill4-33/+97
Here, initializing from { } implies a call to the default constructor for base. We were then seeing that we're initializing a base subobject, so we tried to copy the result of that call. This is clearly wrong; we should initialize the base directly from its default constructor. This patch does a lot of refactoring of unsafe_copy_elision_p and adds make_safe_copy_elision that will also try to do the base constructor rewriting from the last patch. gcc/cp/ChangeLog: PR c++/98642 * call.c (unsafe_return_slot_p): Return int. (init_by_return_slot_p): Split out from... (unsafe_copy_elision_p): ...here. (unsafe_copy_elision_p_opt): New name for old meaning. (build_over_call): Adjust. (make_safe_copy_elision): New. * typeck2.c (split_nonconstant_init_1): Elide copy from safe list-initialization. * cp-tree.h: Adjust. gcc/testsuite/ChangeLog: PR c++/98642 * g++.dg/cpp1z/elide5.C: New test.
2021-01-15c++: Fix copy elision for base initializationJason Merrill2-0/+82
While working on PR98642 I noticed that in this testcase we were eliding the copy, calling the complete default constructor to initialize the B base subobject, and therefore wrongly initializing the non-existent A subobject of B. The test doesn't care whether the copy is elided or not, but checks that we are actually calling a base constructor for B. The patch preserves the elision, but changes the initializer to call the base constructor instead of the complete constructor. gcc/cp/ChangeLog: * call.c (base_ctor_for, make_base_init_ok): New. (build_over_call): Use make_base_init_ok. gcc/testsuite/ChangeLog: * g++.dg/cpp1z/elide4.C: New test.
2021-01-15AArch64: Add NEON, SVE and SVE2 RTL patterns for Multiply, FMS and FMA.Tamar Christina4-3/+242
This adds implementation for the optabs for complex operations. With this the following C code: void g (float complex a[restrict N], float complex b[restrict N], float complex c[restrict N]) { for (int i=0; i < N; i++) c[i] = a[i] * b[i]; } generates NEON: g: movi v3.4s, 0 mov x3, 0 .p2align 3,,7 .L2: mov v0.16b, v3.16b ldr q2, [x1, x3] ldr q1, [x0, x3] fcmla v0.4s, v1.4s, v2.4s, #0 fcmla v0.4s, v1.4s, v2.4s, #90 str q0, [x2, x3] add x3, x3, 16 cmp x3, 1600 bne .L2 ret SVE: g: mov x3, 0 mov x4, 400 ptrue p1.b, all whilelo p0.s, xzr, x4 mov z3.s, #0 .p2align 3,,7 .L2: ld1w z1.s, p0/z, [x0, x3, lsl 2] ld1w z2.s, p0/z, [x1, x3, lsl 2] movprfx z0, z3 fcmla z0.s, p1/m, z1.s, z2.s, #0 fcmla z0.s, p1/m, z1.s, z2.s, #90 st1w z0.s, p0, [x2, x3, lsl 2] incw x3 whilelo p0.s, x3, x4 b.any .L2 ret SVE2 (with int instead of float) g: mov x3, 0 mov x4, 400 mov z3.b, #0 whilelo p0.s, xzr, x4 .p2align 3,,7 .L2: ld1w z1.s, p0/z, [x0, x3, lsl 2] ld1w z2.s, p0/z, [x1, x3, lsl 2] movprfx z0, z3 cmla z0.s, z1.s, z2.s, #0 cmla z0.s, z1.s, z2.s, #90 st1w z0.s, p0, [x2, x3, lsl 2] incw x3 whilelo p0.s, x3, x4 b.any .L2 ret gcc/ChangeLog: * config/aarch64/aarch64-simd.md (cml<fcmac1><conj_op><mode>4, cmul<conj_op><mode>3): New. * config/aarch64/iterators.md (UNSPEC_FCMUL, UNSPEC_FCMUL180, UNSPEC_FCMLA_CONJ, UNSPEC_FCMLA180_CONJ, UNSPEC_CMLA_CONJ, UNSPEC_CMLA180_CONJ, UNSPEC_CMUL, UNSPEC_CMUL180, FCMLA_OP, FCMUL_OP, conj_op, rotsplit1, rotsplit2, fcmac1, sve_rot1, sve_rot2, SVE2_INT_CMLA_OP, SVE2_INT_CMUL_OP, SVE2_INT_CADD_OP): New. (rot): Add UNSPEC_FCMUL, UNSPEC_FCMUL180. (rot_op): Renamed to conj_op. * config/aarch64/aarch64-sve.md (cml<fcmac1><conj_op><mode>4, cmul<conj_op><mode>3): New. * config/aarch64/aarch64-sve2.md (cml<fcmac1><conj_op><mode>4, cmul<conj_op><mode>3): New.
2021-01-15c++: Fix list-init of array of no-copy type [PR63707]Jason Merrill2-1/+25
build_vec_init_elt models initialization from some arbitrary object of the type, i.e. copy, but in the case of list-initialization we don't do a copy from the elements, we initialize them directly. gcc/cp/ChangeLog: PR c++/63707 * tree.c (build_vec_init_expr): Don't call build_vec_init_elt if we got a CONSTRUCTOR. gcc/testsuite/ChangeLog: PR c++/63707 * g++.dg/cpp0x/initlist-array13.C: New test.
2021-01-15gcc.dg/analyzer tests: use __builtin_alloca, not alloca.hAlexandre Oliva4-12/+7
Use __builtin_alloca. Some systems don't have alloca.h or alloca. Co-Authored-By: Olivier Hainque <hainque@adacore.com> for gcc/testsuite/ChangeLog * gcc.dg/analyzer/alloca-leak.c: Drop alloca.h, use builtin. * gcc.dg/analyzer/data-model-1.c: Likewise. * gcc.dg/analyzer/malloc-1.c: Likewise. * gcc.dg/analyzer/malloc-paths-8.c: Likewise.
2021-01-15testsuite: Add testcase coverage for already fixed [PR96671]Jakub Jelinek2-0/+102
The fix for this PR didn't come with any test coverage, I've added tests that make sure we optimize it no matter what order of the x ^ y ^ z operands is used. 2021-01-15 Jakub Jelinek <jakub@redhat.com> PR tree-optimization/96671 * gcc.dg/tree-ssa/pr96671-1.c: New test. * gcc.dg/tree-ssa/pr96671-2.c: New test.
2021-01-15bootstrap: fix failing diagnostic selftest on Windows [PR98696]David Malcolm1-3/+9
In one of the selftests in g:f10960558540636800cf5d3d6355969621fbc17e I didn't consider that paths can contain backslashes, which happens for the tempfiles on Windows hosts. gcc/ChangeLog: PR bootstrap/98696 * diagnostic.c (selftest::test_print_parseable_fixits_bytes_vs_display_columns): Escape the tempfile name when constructing the expected output.
2021-01-15c-family: Improve MEM_REF printing for diagnostics [PR98597]Jakub Jelinek3-88/+301
Ok, here is an updated patch which fixes what I found, and implements what has been discussed on the mailing list and on IRC, i.e. if the types are compatible as well as alias sets are same, then it prints what c_fold_indirect_ref_for_warn managed to create, otherwise it uses that info for printing offsets using offsetof (except when it starts with ARRAY_REFs, because one can't have offsetof (struct T[2][2], [1][0].x.y) The uninit-38.c test (which was the only one I believe which had tests on the exact spelling of MEM_REF printing) contains mainly changes to have space before * for pointer types (as that is how the C pretty-printers normally print types, int * rather than int*), plus what might be considered a regression from what Martin printed, but it is actually a correctness fix. When the arg is a pointer with type pointer to VLA with char element type (let's say the pointer is p), which is what happens in several of the uninit-38.c tests, omitting the (char *) cast is incorrect, as p + 1 is not the 1 byte after p, but pointer to the end of the VLA. It only happened to work because of the hacks (which I don't like at all and are dangerous, DECL_ARTIFICIAL var names with dot inside can be pretty much anything, e.g. a lot of passes construct their helper vars from some prefix that designates intended use of the var plus numeric suffix), where the a.1 pointer to VLA is printed as a which if one is lucky happens to be a variable with VLA type (rather than pointer to it), and for such vars a + 1 is indeed &a[0] + 1 rather than &a + 1. But if we want to do this reliably, we'd need to make sure it comes from VLA (e.g. verify that the SSA_NAME is defined to __builtin_alloca_with_align and that there exists a corresponding VAR_DECL with DECL_VALUE_EXPR that has the a.1 variable in it). 2021-01-15 Jakub Jelinek <jakub@redhat.com> PR tree-optimization/98597 * c-pretty-print.c: Include options.h. (c_fold_indirect_ref_for_warn): New function. (print_mem_ref): Use it. If it returns something that has compatible type and is TBAA compatible with zero offset, print it and return, otherwise print it using offsetof syntax or array ref syntax. Fix up printing if MEM_REFs first operand is ADDR_EXPR, or when the first argument has pointer to array type. Print pointers using the standard formatting. * gcc.dg/uninit-38.c: Expect a space in between type name and asterisk. Expect for now a (char *) cast for VLAs. * gcc.dg/uninit-40.c: New test.
2021-01-15openmp: Change the way of building of reduction array typeJakub Jelinek1-1/+3
The PR98597 patch regresses on _Atomic-3.c, as in the C FE building an array type with qualified elements results in a type incompatible with when an array type with unqualified elements is qualified afterwards. This patch adds a workaround for that. 2021-01-15 Jakub Jelinek <jakub@redhat.com> * c-typeck.c (c_finish_omp_clauses): For reduction build array with unqualified element type and then call c_build_qualified_type on the ARRAY_TYPE.
2021-01-15[PATCH] aarch64: Implement vmlsl[_high]* intrinsics using builtinsKyrylo Tkachov3-74/+36
This patch reimplements some more intrinsics using RTL builtins in the straightforward way. Thankfully most of the RTL infrastructure is already in place for it. gcc/ * config/aarch64/aarch64-simd.md (*aarch64_<su>mlsl_hi<mode>): Rename to... (aarch64_<su>mlsl_hi<mode>): ... This. (aarch64_<su>mlsl_hi<mode>): Define. (*aarch64_<su>mlsl<mode): Rename to... (aarch64_<su>mlsl<mode): ... This. * config/aarch64/aarch64-simd-builtins.def (smlsl, umlsl, smlsl_hi, umlsl_hi): Define builtins. * config/aarch64/arm_neon.h (vmlsl_high_s8, vmlsl_high_s16, vmlsl_high_s32, vmlsl_high_u8, vmlsl_high_u16, vmlsl_high_u32, vmlsl_s8, vmlsl_s16, vmlsl_s32, vmlsl_u8, vmlsl_u16, vmlsl_u32): Reimplement with builtins.
2021-01-15i386: Use cpp_define_formatted for __SIZEOF_FLOAT80__ definitionUros Bizjak1-6/+3
2021-01-15 Uroš Bizjak <ubizjak@gmail.com> gcc/ * config/i386/i386-c.c (ix86_target_macros): Use cpp_define_formatted for __SIZEOF_FLOAT80__ definition.
2021-01-15c++: Fix langspecs with -fsyntax-only [PR98591]Nathan Sidwell2-15/+28
-fsyntax-only is handled specially in the driver and causes it to add '-o /dev/null' (or a suitable OS-specific variant thereof). PCH is handled in the language driver. I'd not sufficiently protected the -fmodule-only action of adding a dummy assembler from the actions of -fsyntax-only, so we ended up with two -o options. PR c++/98591 gcc/cp/ * lang-specs.h: Fix handling of -fmodule-only with -fsyntax-only.
2021-01-15aarch64: Add a minipass for fusing CC insns [PR88836]Richard Sandiford8-1/+354
This patch adds a small target-specific pass to remove redundant SVE PTEST instructions. There are two important uses of this: - Removing PTESTs after WHILELOs (PR88836). The original testcase no longer exhibits the problem due to more recent optimisations, but it can still be seen in simple cases like the one in the patch. It also shows up in 450.soplex. - Removing PTESTs after RDFFRs in ACLE code. This is just an interim “solution” for GCC 11. I hope to replace it with something generic and target-independent for GCC 12. However, the use cases above are very important for performance, so I'd rather not leave the bug unfixed for yet another release cycle. Since the pass is intended to be short-lived, I've not added a command-line option for it. The pass can be disabled using -fdisable-rtl-cc_fusion if necessary. Although what the pass does is independent of SVE, it's motivated only by SVE cases and doesn't trigger for any non-SVE test I've seen. I've therefore gated it on TARGET_SVE and restricted it to PTEST patterns. gcc/ PR target/88836 * config.gcc (aarch64*-*-*): Add aarch64-cc-fusion.o to extra_objs. * Makefile.in (RTL_SSA_H): New variable. * config/aarch64/t-aarch64 (aarch64-cc-fusion.o): New rule. * config/aarch64/aarch64-protos.h (make_pass_cc_fusion): Declare. * config/aarch64/aarch64-passes.def: Add pass_cc_fusion after pass_combine. * config/aarch64/aarch64-cc-fusion.cc: New file. gcc/testsuite/ PR target/88836 * gcc.target/aarch64/sve/acle/general/ldff1_8.c: New test. * gcc.target/aarch64/sve/ptest_1.c: Likewise.
2021-01-15recog: Fix insn_change_watermark destructorRichard Sandiford1-1/+7
Noticed while working on something else that the insn_change_watermark destructor could call cancel_changes for changes that no longer exist. The loop in cancel_changes is a nop in that case, but: num_changes = num; can mess things up. I think this would only affect nested uses of insn_change_watermark. gcc/ * recog.h (insn_change_watermark::~insn_change_watermark): Avoid calling cancel_changes for changes that no longer exist.
2021-01-15rtl-ssa: Fix a silly typoRichard Sandiford2-2/+2
s/ref/reg/ on a previously unused function name. gcc/ * rtl-ssa/functions.h (function_info::ref_defs): Rename to... (function_info::reg_defs): ...this. * rtl-ssa/member-fns.inl (function_info::ref_defs): Rename to... (function_info::reg_defs): ...this.
2021-01-15IBM Z: Fix linking to libatomic in target test casesMarius Hillenbrand2-1/+5
One of the test cases failed to link because of missing paths to libatomic. Reuse procedures in lib/atomic-dg.exp to gather these paths. gcc/testsuite/ChangeLog: 2021-01-15 Marius Hillenbrand <mhillen@linux.ibm.com> * gcc.target/s390/s390.exp: Call lib atomic-dg.exp to link libatomic into testcases in gcc.target/s390/md. * gcc.target/s390/md/atomic_exchange-1.c: Remove no unnecessary -latomic.
2021-01-15arm: Implement vceqq_p64, vceqz_p64 and vceqzq_p64 intrinsicsChristophe Lyon4-1/+110
This patch adds implementations for vceqq_p64, vceqz_p64 and vceqzq_p64 intrinsics. vceqq_p64 uses the existing vceq_p64 after splitting the input vectors into their high and low halves. vceqz[q] simply call the vceq and vceqq with a second argument equal to zero. The added (executable) testcases make sure that the poly64x2_t variants have results with one element of all zeroes (false) and the other element with all bits set to one (true). 2021-01-15 Christophe Lyon <christophe.lyon@linaro.org> gcc/ PR target/71233 * config/arm/arm_neon.h (vceqz_p64, vceqq_p64, vceqzq_p64): New. gcc/testsuite/ PR target/71233 * gcc.target/aarch64/advsimd-intrinsics/p64_p128.c: Add tests for vceqz_p64, vceqq_p64 and vceqzq_p64. * gcc.target/arm/simd/vceqz_p64.c: New test. * gcc.target/arm/simd/vceqzq_p64.c: New test.
2021-01-15Revert "arm: Implement vceqq_p64, vceqz_p64 and vceqzq_p64 intrinsics"Christophe Lyon2-76/+1
This reverts commit 1a6306420090409cb397e2e042256eb1905f415f.
2021-01-15tree-optimization/96376 - do not check alignment for invariant loadsRichard Biener1-8/+15
The testcases show that we fail to disregard alignment for invariant loads. The patch handles them like we handle gather and scatter. 2021-01-15 Richard Biener <rguenther@suse.de> PR tree-optimization/96376 * tree-vect-stmts.c (get_load_store_type): Disregard alignment for VMAT_INVARIANT.
2021-01-15Pytest in tests: improveMartin Liska3-8/+29
gcc/ChangeLog: * doc/install.texi: Document that some tests need pytest module. * doc/sourcebuild.texi: Likewise. gcc/testsuite/ChangeLog: * lib/gcov.exp: Use 'env python3' for execution of pytests. Check that pytest accepts all needed options first. Improve formatting of PASS/FAIL lines.
2021-01-15testsuite/96147 - align vector accessRichard Biener1-0/+1
This aligns p so that the testcase is meaningful for targets without a hw misaligned access. 2021-01-15 Richard Biener <rguenther@suse.de> PR testsuite/96147 * gcc.dg/vect/bb-slp-32.c: Align p.
2021-01-15testsuite/96147 - scan for vectorized loadRichard Biener1-1/+1
This changes gcc.dg/vect/bb-slp-9.c to scan for a vectorized load instead of a vectorized BB which then correctly captures the unaligned load we try to test and not some intermediate built from scalar vector. 2021-01-15 Richard Biener <rguenther@suse.de> PR testsuite/96147 * gcc.dg/vect/bb-slp-9.c: Scan for a vector load transform.
2021-01-15testsuite/96147 - key scanning on vect_hw_misalignRichard Biener1-1/+1
gcc.dg/vect/slp-45.c failed to key the vectorization capability scanning on vect_hw_misalign. Since the stores are strided they cannot be (all) analyzed to be aligned. 2021-01-15 Richard Biener <rguenther@suse.de> PR testsuite/96147 * gcc.dg/vect/slp-45.c: Key scanning on vect_hw_misalign.