aboutsummaryrefslogtreecommitdiff
path: root/gcc
AgeCommit message (Collapse)AuthorFilesLines
2021-07-05[Ada] Refactoring related to Returns_By_RefBob Duff6-90/+39
gcc/ada/ * sem_util.ads, sem_util.adb (Compute_Returns_By_Ref): New procedure to compute Returns_By_Ref, to avoid some code duplication. This will likely change soon, so it's good to have the code in one place. (CW_Or_Has_Controlled_Part): Move here from Exp_Ch7, because it's called by Compute_Returns_By_Ref, and this is a better place for it anyway. (Needs_Finalization): Fix comment to be vague instead of wrong. * exp_ch6.adb (Expand_N_Subprogram_Body, Freeze_Subprogram): Call Compute_Returns_By_Ref. * sem_ch6.adb (Check_Delayed_Subprogram): Call Compute_Returns_By_Ref. * exp_ch7.ads, exp_ch7.adb (CW_Or_Has_Controlled_Part): Move to Sem_Util. (Has_New_Controlled_Component): Remove unused function.
2021-07-05[Ada] Fix overriding subprogram being incorrectly seen as returningGhjuvan Lacambre1-5/+21
gcc/ada/ * sem_ch3.adb (Check_Abstract_Overriding): Check for renamings.
2021-07-05[Ada] Do not catch 'N rem -1' in CodePeer_ModeBoris Yakobowski1-1/+3
gcc/ada/ * exp_ch4.adb (Expand_N_Op_Rem): Remove special case for rem -1 in CodePeer_Mode.
2021-07-05testsuite: gcc.dg/debug/btf/btf-bitfields-3.c requires -fno-short-enums PR ↵Christophe Lyon1-1/+1
debug/101321 arm-eabi uses -fshort-enums by default while arm-linux-gnueabi* do not, like most (all?) other targets, but this test relies -fno-short-enums. Fix it by forcing -fno-short-enums. 2021-07-05 Christophe Lyon <christophe.lyon@foss.st.com> PR debug/101321 gcc/testsuite/ * gcc.dg/debug/btf/btf-bitfields-3.c: Add -fno-short-enums.
2021-07-05Do not set both LOOP_C_INFINITE and LOOP_C_FINITE on vectorized loopRichard Biener1-2/+0
The setting is likely a typo and was meant to affect the scalar version but even there LOOP_C_INFINITE is at most an optimization to the niter analysis. Clearly setting it on the vectorized loop which we just versioned to be _not_ infinite is bogus so the following change removes this. 2021-07-05 Richard Biener <rguenther@suse.de> * tree-vect-loop-manip.c (vect_loop_versioning): Do not set LOOP_C_INFINITE on the vectorized loop.
2021-07-05middle-end/101291 - set loop copy of versioned loopRichard Biener1-0/+1
This fixes the vectorizer loop versioning code failing to clear niter related info on the scalar loop as it assumed get_loop_copy would work even for the outermost loop. The patch makes that assumption hold by adjusting the loop versioning code. 2021-07-05 Richard Biener <rguenther@suse.de> PR middle-end/101291 * cfgloopmanip.c (loop_version): Set the loop copy of the versioned loop to the new loop.
2021-07-05testsuite/101299 - add missing vect_double requires to bb-slp-74.cRichard Biener1-0/+1
This should fix the FAIL of gcc.dg/vect/bb-slp-74.c on arm. 2021-07-05 Richard Biener <rguenther@suse.de> PR testsuite/101299 * gcc.dg/vect/bb-slp-74.c: Add vect_double requires.
2021-07-05Remove xfail for pr92658-avx512vl.cliuhongt1-3/+2
Typo of standard pattern name has been fixed by r12-1970, remove those xfails. gcc/testsuite/ChangeLog * gcc.target/i386/pr92658-avx512vl.c: Refine testcase.
2021-07-05Daily bump.GCC Administrator2-1/+17
2021-07-04Darwin, config : Adjust X86 biarch definitions ordering [PR100269].Iain Sandoe4-47/+29
This reorganises the biarch definitions to cater for the macro changes and removals at r12-36. Signed-off-by: Iain Sandoe <iain@sandoe.co.uk> PR target/100269 - [12 Regression] i686 biarch compiler fails for Darwin after r12-36. PR target/100269 gcc/ChangeLog: PR target/100269 * config.gcc: Ensure that Darwin biarch definitions are added before i386.h. * config/i386/darwin.h (TARGET_64BIT): Remove. (PR80556_WORKAROUND): New. (REAL_LIBGCC_SPEC): Amend to use PR80556_WORKAROUND. (DARWIN_SUBARCH_SPEC): New. * config/i386/darwin32-biarch.h (TARGET_64BIT_DEFAULT, TARGET_BI_ARCH, PR80556_WORKAROUND): New. (REAL_LIBGCC_SPEC): Remove. * config/i386/darwin64-biarch.h (TARGET_64BIT_DEFAULT, TARGET_BI_ARCH, PR80556_WORKAROUND): New. (REAL_LIBGCC_SPEC): Remove.
2021-07-04Daily bump.GCC Administrator4-1/+31
2021-07-03testsuite: Disable BTF and CTF testsuite on AIX.David Edelsohn3-22/+33
CTF utilizes DWARF sections, but it is a distinct debugging format. The CTF support in GCC is not implemented as a separate debugging format. AIX supports DWARF but not CTF section. The GCC testsuite test for target support of a debugging format checks if GCC itself emits an error message, not if the debugging output compiles correctly. Because CTF is not a distinct debugging format, GCC does not distinguish support for targets and does not have the ability to produce an error message. This patch skips the CTF and BTF debug directories, and explicitly reports that AIX doesn't support CTF. Currently the dejagnu code to skip multiple debugging levels for CTF does not ensure that CTF is a supported debugging format. The patch also shifts the CTF options logic to within the test that CTF debug format is supported. Bootstrapped on powerpc-ibm-aix7.2.3.0 and powerpc64le-linux. gcc/testsuite/ChangeLog: * gcc.dg/debug/btf/btf.exp: Skip on AIX. * gcc.dg/debug/ctf/ctf.exp: Skip on AIX. * lib/gcc-dg.exp (gcc-dg-target-supports-debug-format): AIX doesn't support CTF. (gcc-dg-debug-runtest): Move CTF support within target support format test.
2021-07-03Don't use vec_duplicate on vector in CTOR expansionH.J. Lu2-1/+17
Since vec_duplicate only works on scalar, don't use it on vector in store constructor expansion. gcc/ PR middle-end/101294 * expr.c (store_constructor): Don't use vec_duplicate on vector. gcc/testsuite/ PR middle-end/101294 * gcc.dg/pr101294.c: New test.
2021-07-03d: Missed RVO optimization with non-POD structsIain Buclaw2-2/+69
The D front-end semantic pass sometimes declares a temporary inside a return expression. This is now detected with the RESULT_DECL replacing the temporary, allowing for RVO to be done. PR d/101273 gcc/d/ChangeLog: * toir.cc (IRVisitor::visit (ReturnStatement *)): Detect returns that use a temporary, and replace with return value. gcc/testsuite/ChangeLog: * gdc.dg/torture/pr101273.d: New test.
2021-07-03Daily bump.GCC Administrator7-1/+307
2021-07-03d: RHS value lost when a target_expr modifies LHS in a cond_exprIain Buclaw2-0/+30
To prevent the RHS of an assignment modifying the LHS before the assignment proper, a target_expr is forced so that function calls that return with slot optimization modify the temporary instead. This did not work for conditional expressions however, to give one example. So now the RHS is always forced to a temporary. PR d/101282 gcc/d/ChangeLog: * d-codegen.cc (build_assign): Force target_expr on RHS for non-POD assignment expressions. gcc/testsuite/ChangeLog: * gdc.dg/torture/pr101282.d: New test.
2021-07-02Improve warning suppression for inlined functions [PR98512].Martin Sebor3-33/+180
Resolves: PR middle-end/98871 - Cannot silence -Wmaybe-uninitialized at declaration site PR middle-end/98512 - #pragma GCC diagnostic ignored ineffective in conjunction with alias attribute gcc/ChangeLog: PR middle-end/98871 PR middle-end/98512 * diagnostic.c (get_any_inlining_info): New. (update_effective_level_from_pragmas): Handle inlining context. (diagnostic_enabled): Same. (diagnostic_report_diagnostic): Same. * diagnostic.h (struct diagnostic_info): Add ctor. (struct diagnostic_context): Add new member. * tree-diagnostic.c (set_inlining_locations): New. (tree_diagnostics_defaults): Set new callback pointer.
2021-07-02openmp: Initial support for OpenMP directives expressed as C++11 attributesJakub Jelinek10-10/+1739
This is an OpenMP 5.1 feature, but I think it is something very useful for OpenMP users, so I'm committing it now instead of waiting until all 5.0 work is done. The support is incomplete, only attributes on statements (or block local declarations) are supported right now, while for non-executable directives they should be also supported at namespace scope and at class scope, and for declarations in all places that appertain to the declarations rather than e.g. types. I need to also fix up handling of C++11 non-OpenMP attributes mixed with OpenMP attributes before block local declarations (currently it throws them away), probably reject if the directives appertain to labels etc. In order not to complicate all the OpenMP directive parsing, it is done by remembering the tokens from the attribute, slightly adjusting them and feeding them through a temporary new lexer to cp_parse_pragma. 2021-07-02 Jakub Jelinek <jakub@redhat.com> gcc/c-family/ * c-common.h (enum c_omp_directive_kind): New enum. (struct c_omp_directive): New type. (c_omp_categorize_directive): Declare. * c-omp.c (omp_directives): New variable. (c_omp_categorize_directive): New function. gcc/cp/ * parser.h (struct cp_lexer): Add in_omp_attribute_pragma member. (struct cp_omp_declare_simd_data): Likewise. * cp-tree.h (enum cp_tree_index): Add CPTI_OMP_IDENTIFIER. (omp_identifier): Define. * parser.c (cp_parser_skip_to_pragma_eol): Handle in_omp_attribute_pragma CPP_PRAGMA_EOL followed by CPP_EOF. (cp_parser_require_pragma_eol): Likewise. (struct cp_omp_attribute_data): New type. (cp_parser_handle_statement_omp_attributes): New function. (cp_parser_statement): Handle OpenMP directives in statement's attribute-specifier-seq. (cp_parser_omp_directive_args, cp_parser_omp_sequence_args): New functions. (cp_parser_std_attribute): Handle omp::directive and omp::sequence attributes. (cp_parser_omp_all_clauses): If in_omp_attribute_pragma, allow a comma also before the first clause. (cp_parser_omp_allocate): Likewise. (cp_parser_omp_atomic): Likewise. (cp_parser_omp_depobj): Likewise. (cp_parser_omp_flush): Likewise. (cp_parser_omp_ordered): Likewise. (cp_parser_omp_declare_simd): Save in_omp_attribute_pragma into struct cp_omp_declare_simd_data. (cp_finish_omp_declare_variant): Add in_omp_attribute_pragma argument. If set, allow a comma also before match clause. (cp_parser_late_parsing_omp_declare_simd): If in_omp_attribute_pragma, allow a comma also before the first clause. Adjust cp_finish_omp_declare_variant caller. (cp_parser_omp_declare_target): If in_omp_attribute_pragma, allow a comma also before the first clause. (cp_parser_omp_declare_reduction_exprs): Likewise. (cp_parser_omp_requires): Likewise. * decl.c (initialize_predefined_identifiers): Initialize omp_identifier. * decl2.c (cplus_decl_attributes): Reject omp::directive and omp::sequence attributes. gcc/testsuite/ * g++.dg/gomp/attrs-1.C: New test. * g++.dg/gomp/attrs-2.C: New test. * g++.dg/gomp/attrs-3.C: New test.
2021-07-02openmp: Reject #pragma omp atomic update, [PR101297]Jakub Jelinek3-2/+18
I've noticed that we allow a trailing comma on OpenMP atomic construct if there is at least one clause. Commas should be only allowed to separate the clauses (or in OpenMP 5.1 to separate directive name from the clauses). 2021-07-02 Jakub Jelinek <jakub@redhat.com> PR c/101297 * c-parser.c (c_parser_omp_atomic): Consume comma only if it appears before a CPP_NAME. * parser.c (cp_parser_omp_atomic): Consume comma only if it appears before a CPP_NAME. * c-c++-common/gomp/atomic-24.c: New test.
2021-07-02c++: unqualified member template in constraint [PR101247]Patrick Palka2-18/+33
Here any_template_parm_r is failing to mark the template parameters implicitly used by the unqualified use of 'd' inside the constraint because the code to do so assumes each level of a template parameter list points to the corresponding primary template, but here the parameter level for A in the out-of-line definition of A::B does not (nor do the parameter levels for A and C in the definition of A::C), which causes us to overlook the sharing. So it seems we can't in general depend on the TREE_TYPE of a template parameter level being non-empty here. This patch partially fixes this by rewriting the relevant part of any_template_parm_r to not depend on the TREE_TYPE of outer levels. We still depend on the innermost level to point to the innermost primary template, so we still crash on the commented out line in the below testcase. PR c++/101247 gcc/cp/ChangeLog: * pt.c (any_template_parm_r) <case TEMPLATE_DECL>: Rewrite to use common_enclosing_class and to not depend on the TREE_TYPE of outer levels pointing to the corresponding primary template. gcc/testsuite/ChangeLog: * g++.dg/cpp2a/concepts-memtmpl4.C: New test.
2021-07-02rs6000: Add MMA __builtin_vsx_lxvp and __builtin_vsx_stxvp built-insPeter Bergner5-2/+132
Add support for the __builtin_vsx_lxvp and __builtin_vsx_stxvp built-ins to keep in sync with LLVM which added these earlier. 2021-07-02 Peter Bergner <bergner@linux.ibm.com> gcc/ * config/rs6000/rs6000-builtin.def (BU_MMA_PAIR_LD, BU_MMA_PAIR_ST): New macros. (__builtin_vsx_lxvp, __builtin_vsx_stxvp): New built-ins. * config/rs6000/rs6000-call.c (rs6000_gimple_fold_mma_builtin): Expand lxvp and stxvp built-ins. (mma_init_builtins): Handle lxvp and stxvp built-ins. (builtin_function_type): Likewise. * doc/extend.texi (__builtin_vsx_lxvp, __builtin_mma_stxvp): Document. gcc/testsuite/ * gcc.target/powerpc/mma-builtin-7.c: New test. * gcc.target/powerpc/mma-builtin-8.c: New test.
2021-07-02Use shift instructions to eliminate redundant compare/test instructions on ↵Jeff Law3-59/+116
the H8 gcc/ChangeLog * config/h8300/h8300-protos.h (compute_a_shift_cc): Accept additional argument for the code. * config/h8300/h8300.c (compute_a_shift_cc): Accept additional argument for the code. Just return if the ZN bits are useful or not rather than the old style CC_* enums. * config/h8300/shiftrotate.md (shiftqi_noscratch): Move before more generic shiftqi patterns. (shifthi_noscratch, shiftsi_noscratch): Similarly. (shiftqi_noscratch_set_flags): New pattern. (shifthi_noscratch_set_flags, shiftsi_noscratch_set_flags): Likewise.
2021-07-02Fix build_gt and build_lt for signed 1 bit values.Andrew MacLeod2-2/+60
Signed 1 bit values have a range of [-1, 0] but neither (0 - 1) nor (-1 + 1) can be represented. For signed values, add or subtract -1 as appropriate. PR tree-optimization/101223 gcc/ * range-op.cc (build_lt): Add -1 for signed values. (built_gt): Subtract -1 for signed values. gcc/testsuite/ * gcc.dg/pr101223.c: New.
2021-07-02BTF: Support for BTF_KIND_FLOATDavid Faust5-3/+25
Add BTF_KIND_FLOAT, a new BTF type kind which has recently stabilized in the linux kernel [1]. This kind is used for encoding floating point types, and is of particular use when generating BTF for some s390 arch-specific kernel headers. Also update some BTF tests which previously used floating point types to check correct behavior for types with no BTF representation. [1]: https://github.com/torvalds/linux/commit/b1828f0b04828aa8cccadf00a702f459caefeed9 include/ChangeLog: * btf.h (struct btf_type): Update bit usage comment. (BTF_INFO_KIND): Update bit mask. (BTF_KIND_FLOAT): New define. (BTF_KIND_MAX): Update. gcc/ChangeLog: * btfout.c (get_btf_kind): Support BTF_KIND_FLOAT. (btf_asm_type): Likewise. gcc/testsuite/ChangeLog: * gcc.dg/debug/btf/btf-float-1.c: New test. * gcc.dg/debug/btf/btf-function-3.c: Use different unrepresentable type. * gcc.dg/debug/btf/btf-struct-2.c: Likewise. * gcc.dg/debug/btf/btf-variables-2.c: Likewise.
2021-07-02Preparing to use shifts to eliminate redundant test/compare insns on H8Jeff Law3-95/+85
* config/h8300/h8300-protos.h (output_a_shift): Make first argument an array of rtx rather than a pointer to rtx. Add code argument. (compute_a_shift_length): Similarly. * config/h8300/h8300.c (h8300_shift_costs): Adjust now that the shift itself isn't an operand. Create dummy operand[0] to carry a mode and pass a suitable rtx code to compute_a_shift_length. (get_shift_alg): Adjust operand number of clobber in output templates. (output_a_shift): Make first argument an array of rtx rather than a pointer to rtx. Add code argument for the type of shift. Adjust now that the shift itself is no longer an operand. (compute_a_shift_length): Similarly. * config/h8300/shiftrotate.md (shiftqi, shifthi, shiftsi): Use an iterator rather than nshift_operator. (shiftqi_noscratch, shifthi_noscratch, shiftsi_noscratch): Likewise. (shiftqi_clobber_flags): Adjust to API changes in output_a_shift and compute_a_shift_length. (shiftqi_noscratch_clobber_flags): Likewise. (shifthi_noscratch_clobber_flags): Likewise. (shiftsi_noscratch_clobber_flags): Likewise.
2021-07-02Darwin, CTF, BTF: Do not run the DWARF debug link for BTF/CTF [PR101283].Iain Sandoe1-2/+2
Darwin uses an efficient two-stage process for debug linking. The static linker (ld64) notes the inputs required but does not link the debug. When required / on demand the debug is linked into a separate package by the debug linker (dsymutil). At present none of the Darwin tools consume or understand BTF/CTF. The static linker silently accepts the sections (but will not act on them as containing anything to be processed). However, the debug linker produces a warning that it has been presented with input with no [DWARF] debug content: warning: no debug symbols in executable (-arch x86_64). This causes several testsuite fails with excess errors. Signed-off-by: Iain Sandoe <iain@sandoe.co.uk> PR debug/101283 - Several tests fail on Darwin with -gctf/gbtf PR debug/101283 gcc/ChangeLog: * config/darwin.h (DSYMUTIL_SPEC): Do not try to run dsymutil for BTF/CTF.
2021-07-02Darwin, BTF: Provide a suitable section name for BTF [PR101283].Iain Sandoe1-2/+4
In a similar manner to r12-1960-gcc8453012f75d, this provides a placeholder section name for BTF data. This change groups BTF and CTF debug formats in the same segment, but keeps them in separate sections. As per the CTF section designation, this should be agreed or amended to an agreed form before GCC 12 ships. Signed-off-by: Iain Sandoe <iain@sandoe.co.uk> PR debug/101283 - Several tests fail on Darwin with -gctf/gbtf PR debug/101283 gcc/ChangeLog: * config/darwin.h (CTF_INFO_SECTION_NAME): Update the segment to include BTF. (BTF_INFO_SECTION_NAME): New.
2021-07-02Fix m32r target specific fallout from recent int->bool changesJeff Law2-7/+7
gcc/ChangeLog * config/m32r/m32r-protos.h (call_operand): Adjust return type. (small_data_operand, memreg_operand, small_insn_p): Likewise. * config/m32r/m32r.c (call_operand): Adjust return type. (small_data_operand, memreg_operand): Likewise.
2021-07-02Fix frv target specific fallout from recent int->bool changesJeff Law1-59/+59
gcc/ChangeLog * config/frv/frv-protos.h (integer_register_operand): Adjust return type. (frv_load_operand, gpr_or_fpr_operand, gpr_no_subreg_operand): Likewise. (fpr_or_int6_operand, gpr_or_int_operand); Likewise. (gpr_or_int12_operand, gpr_or_int10_operand); Likewise. (move_source_operand, move_destination_operand): Likewise. (condexec_source_operand, condexec_dest_operand): Likewise. (lr_operand, gpr_or_memory_operand, fpr_or_memory_operand): Likewise. (reg_or_0_operand, fcc_operand, icc_operand, cc_operand): Likewise. (fcr_operand, icr_operand, cr_operand, call_operand): Likewise. (fpr_operand, even_reg_operand, odd_reg_operand): Likewise. (even_gpr_operand, odd_gpr_operand, quad_fpr_operand): Likewise. (even_fpr_operand, odd_fpr_operand): Likewise. (dbl_memory_one_insn_operand, dbl_memory_two_insn_operand): Likewise. (int12_operand, int6_operand, int5_operand, uint5_operand): Likewise. (uint4_operand, uint1_operand, int_2word_operand): Likewise (upper_int16_operand, uint16_operand, symbolic_operand): Likewise. (relational_operator, float_relational_operator): Likewise. (ccr_eqne_operator, minmax_operator): Likewise. (condexec_si_binary_operator, condexec_si_media_operator): Likewise. (condexec_si_divide_operator, condexec_si_unary_operator): Likewise. (condexec_sf_conv_operator, condexec_sf_add_operator): Likewise. (intop_compare_operator, acc_operand, even_acc_operand): Likewise. (quad_acc_operand, accg_operand): Likewise.
2021-07-02Add description of how testsuite parallelization worksMaxim Kuvyrkov1-0/+34
... for the benefit of the next poor soul who will need to debug it. gcc/testsuite/ * lib/gcc-defs.exp: Add a comment.
2021-07-02Fix xstormy16 target specific fallout from recent int->bool changesJeff Law2-5/+5
gcc/ * config/stormy16/stormy16-protos.h (xstormy16_below_100_symbol): Change return type to a bool. (nonimmediate_nonstack_operand): Likewise. (xstormy16_splittable_below100_operand): Likewise. * config/stormy16/stormy16.c (xstormy16_below_100_symbol): Fix return type. (xstormy16_splittable_below100_operand): Likewise.
2021-07-02tree-optimization/101293 - further enhance LIMs ref canonicalizationRichard Biener2-4/+41
This makes sure to handle MEM[p + 4] and MEM[p].j with j at offset 4 as the same ref in store motion. For hashing we need to be more restrictive in what we handle since there's no poly-int handlers for inchash. For comparison we can compare poly_offsets directly. 2021-07-02 Richard Biener <rguenther@suse.de> PR tree-optimization/101293 * tree-ssa-loop-im.c (mem_ref_hasher::equal): Compare MEM_REF bases with combined offsets. (gather_mem_refs_stmt): Hash MEM_REFs as if their offset were combined with the rest of the offset. * gcc.dg/tree-ssa/ssa-lim-15.c: New testcase.
2021-07-02Change EH pointer encodings to PC relative on WindowsEric Botcazou1-1/+5
A big difference between ELF and PE-COFF is that, with the latter, you can build position-independent executables or DLLs without generating PIC; as a matter of fact, flag_pic has historically been forced to 0 for 32-bit: /* Don't allow flag_pic to propagate since gas may produce invalid code otherwise. */ \ do { \ flag_pic = TARGET_64BIT ? 1 : 0; \ } while (0) The reason is that the linker builds a .reloc section that collects the absolute relocations in the generated binary, and the loader uses them to relocate it at load time if need be (e.g. if --dynamicbase is enabled). Up to binutils 2.35, the GNU linker didn't build the .reloc section for executables and defaulted to --enable-auto-image-base for DLLs, which means that DLLs had an essentially unique load address and, therefore, need not be relocated by the loader in most cases. With binutils 2.36 and later, the GNU linker builds a .reloc section for executables (thus making them PIE), --enable-auto-image-base is disabled and --dynamicbase is enabled by default, which means that essentially all the binaries are relocated at load time. This badly breaks the 32-bit compiler configured to use DWARF-2 EH because the loader corrupts the .eh_frame section when processing the relocations contained in the .reloc section. gcc/ * config/i386/i386.c (asm_preferred_eh_data_format): Always use the PIC encodings for PE-COFF targets.
2021-07-02i386: Punt on broadcasts from TImode integers [PR101286]Jakub Jelinek2-0/+14
ix86_expand_vector_init_duplicate doesn't handle TImode -> V2TImode or TImode -> V4TImode broadcasts, so I think we should punt on TImode inner mode in ix86_broadcast_from_integer_constant, otherwise we ICE in ix86_expand_vector_move when ix86_broadcast_from_integer_constant returns non-NULL and ix86_expand_vector_init_duplicate returns false. In theory TImode element broadcasts could be handled by some permutations, but I'm not sure it is worth it. 2021-07-02 Jakub Jelinek <jakub@redhat.com> PR target/101286 * config/i386/i386-expand.c (ix86_broadcast_from_integer_constant): Return nullptr for TImode inner mode. * gcc.target/i386/avx2-pr101286.c: New test.
2021-07-02tree-optimization/101280 - re-revise interchange fix for PR101173Richard Biener1-2/+2
The following fixes up the revision of the original fix for PR101173 to properly guard all dependence checks with DDR_REVERSED_P or its inverse. 2021-07-01 Richard Biener <rguenther@suse.de> PR tree-optimization/101280 PR tree-optimization/101173 * gimple-loop-interchange.cc (tree_loop_interchange::valid_data_dependences): Properly guard all dependence checks with DDR_REVERSED_P or its inverse.
2021-07-02Clear odata for aes(enc|dec)(wide)?kl intrinsics when ZF is set.Hongyu Wang9-5/+72
For Keylocker aesenc/aesdec intrinsics, current implementation moves idata to odata unconditionally, which causes safety issue when the instruction meets runtime error. So we add a branch to clear odata when ZF is set after instruction exectution. gcc/ChangeLog: * config/i386/i386-expand.c (ix86_expand_builtin): Add branch to clear odata when ZF is set for asedecenc_expand and wideaesdecenc_expand. gcc/testsuite/ChangeLog: * gcc.target/i386/keylocker-aesdec128kl.c: Update test. * gcc.target/i386/keylocker-aesdec256kl.c: Likewise. * gcc.target/i386/keylocker-aesdecwide128kl.c: Likewise. * gcc.target/i386/keylocker-aesdecwide256kl.c: Likewise. * gcc.target/i386/keylocker-aesenc128kl.c: Likewise. * gcc.target/i386/keylocker-aesenc256kl.c: Likewise. * gcc.target/i386/keylocker-aesencwide128kl.c: Likewise. * gcc.target/i386/keylocker-aesencwide256kl.c: Likewise.
2021-07-01Update gen_autofdo_event.py and gcc-auto-profile.Eugene Rozenfeld1-7/+34
gen_autofdo_event.py was stumbling on models with stepping so I updated the script to handle this case similar to the code in https://github.com/andikleen/pmu-tools/blob/c6a5f63aede19def8886d6a8b74d7a55c38ca947/event_download.py The second change was to tolerate cases when the CPU supports PEBS but the perf command with /p fails. This can happen in, e.g., a virtual machine. I regenerated gcc-auto-profile using the updated script. contrib/ChangeLog: * gen_autofdo_event.py: handle stepping, non-working PEBS gcc/ChangeLog: * config/i386/gcc-auto-profile: regenerate
2021-07-02Fix typo in standard pattern name of trunc<mode><pmov_dst_4>2.liuhongt1-1/+3
gcc/ChangeLog * config/i386/sse.md (trunc<mode><pmov_dst_4>2): Refined to .. (trunc<mode><pmov_dst_4_lower>2): this.
2021-07-02Daily bump.GCC Administrator6-1/+355
2021-07-01input.c: move file caching globals to a new file_cache classDavid Malcolm3-194/+301
This moves some global state from input.c to a new file_cache class, of which an instance is owned by global_dc. Various state is also made private. No functional change intended. gcc/ChangeLog: * diagnostic.h (diagnostic_context::m_file_cache): New field. * input.c (class fcache): Rename to... (class file_cache_slot): ...this, making most members private and prefixing fields with "m_". (file_cache_slot::get_file_path): New accessor. (file_cache_slot::get_use_count): New accessor. (file_cache_slot::missing_trailing_newline_p): New accessor. (file_cache_slot::inc_use_count): New. (fcache_buffer_size): Move to... (file_cache_slot::buffer_size): ...here. (fcache_line_record_size): Move to... (file_cache_slot::line_record_size): ...here. (fcache_tab): Delete, in favor of global_dc->m_file_cache. (fcache_tab_size): Move to file_cache::num_file_slots. (diagnostic_file_cache_init): Update for move of fcache_tab to global_dc->m_file_cache. (diagnostic_file_cache_fini): Likewise. (lookup_file_in_cache_tab): Convert to... (file_cache::lookup_file): ...this. (diagnostics_file_cache_forcibly_evict_file): Update for move of fcache_tab to global_dc->m_file_cache, moving most of implementation to... (file_cache::forcibly_evict_file): ...this new function and... (file_cache_slot::evict): ...this new function. (evicted_cache_tab_entry): Convert to... (file_cache::evicted_cache_tab_entry): ...this. (add_file_to_cache_tab): Convert to... (file_cache::add_file): ...this, moving bulk of implementation to... (file_cache_slot::create): ..this new function. (file_cache::file_cache): New. (file_cache::~file_cache): New. (lookup_or_add_file_to_cache_tab): Convert to... (file_cache::lookup_or_add_file): ..this new function. (fcache::fcache): Rename to... (file_cache_slot::file_cache_slot): ...this, adding "m_" prefixes to fields. (fcache::~fcache): Rename to... (file_cache_slot::~file_cache_slot): ...this, adding "m_" prefixes to fields. (needs_read): Convert to... (file_cache_slot::needs_read_p): ...this. (needs_grow): Convert to... (file_cache_slot::needs_grow_p): ...this. (maybe_grow): Convert to... (file_cache_slot::maybe_grow): ...this. (read_data): Convert to... (file_cache_slot::read_data): ...this. (maybe_read_data): Convert to... (file_cache_slot::maybe_read_data): ...this. (get_next_line): Convert to... (file_cache_slot::get_next_line): ...this. (goto_next_line): Convert to... (file_cache_slot::goto_next_line): ...this. (read_line_num): Convert to... (file_cache_slot::read_line_num): ...this. (location_get_source_line): Update for moving of globals to global_dc->m_file_cache. (location_missing_trailing_newline): Likewise. * input.h (class file_cache_slot): New forward decl. (class file_cache): New. Signed-off-by: David Malcolm <dmalcolm@redhat.com>
2021-07-01Add IEEE 128-bit fp conditional move on PowerPC.Michael Meissner4-2/+209
This patch adds the support for power10 IEEE 128-bit floating point conditional move and for automatically generating min/max. In this patch, I simplified things compared to previous patches. Instead of allowing any four of the modes to be used for the conditional move comparison and the move itself could use different modes, I restricted the conditional move to just the same mode. I.e. you can do: _Float128 a, b, c, d, e, r; r = (a == b) ? c : d; But you can't do: _Float128 c, d, r; double a, b; r = (a == b) ? c : d; or: _Float128 a, b; double c, d, r; r = (a == b) ? c : d; This eliminates a lot of the complexity of the code, because you don't have to worry about the sizes being different, and the IEEE 128-bit types being restricted to Altivec registers, while the SF/DF modes can use any VSX register. I did not modify the existing support that allowed conditional moves where SFmode operands are compared and DFmode operands are moved (and vice versa). I modified the test cases that I added to reflect this change. I have also fixed the test for not equal to use '!=' instead of '=='. 2021-07-01 Michael Meissner <meissner@linux.ibm.com> gcc/ * config/rs6000/rs6000.c (rs6000_maybe_emit_fp_cmove): Add IEEE 128-bit floating point conditional move support. (have_compare_and_set_mask): Add IEEE 128-bit floating point types. * config/rs6000/rs6000.md (mov<mode>cc, IEEE128 iterator): New insn. (mov<mode>cc_p10, IEEE128 iterator): New insn. (mov<mode>cc_invert_p10, IEEE128 iterator): New insn. (fpmask<mode>, IEEE128 iterator): New insn. (xxsel<mode>, IEEE128 iterator): New insn. gcc/testsuite/ * gcc.target/powerpc/float128-cmove.c: New test. * gcc.target/powerpc/float128-minmax-3.c: New test.
2021-07-01Improve packed record layout support with -fdump-ada-specEric Botcazou2-8/+12
We cannot fully support packed record layout in -fdump-ada-spec, as packing in C and Ada does not behave the same, so we issue a warning. But simple cases are OK and can actually be handled without much work. gcc/c-family/ * c-ada-spec.c (packed_layout): New global variable. (dump_ada_declaration): Set it upon seeing a packed record type. Do not put the "aliased" keyword if it is set. (dump_ada_structure): Add Pack aspect if it is set and clear it. gcc/testsuite/ * c-c++-common/dump-ada-spec-14.c: Adjust dg-warning directive.
2021-07-01Fix duplicate name issues in output of -fdump-ada-spec #2Eric Botcazou1-8/+14
This extends the type name conflict detection mechanism to variables. gcc/c-family/ * c-ada-spec.c (check_name): Rename into... (check_type_name_conflict): ...this. Minor tweak. (dump_ada_function_declaration): Adjust to above renaming. (dump_ada_array_domains): Fix oversight. (dump_ada_declaration): Call check_type_name_conflict for variables.
2021-07-01Use intermediate integer type with proper signednessEric Botcazou1-4/+3
This is a minor regression present on mainline and 11 branch, whereby the value of the Enum_Rep attribute is always unsigned. gcc/ada/ PR ada/101094 * exp_attr.adb (Get_Integer_Type): Return an integer type with the same signedness as the input type.
2021-07-01Darwin: Define a suitable section name for CTF [PR101283]Iain Sandoe1-0/+4
This is a placeholder name ahead of any CTF implementation on LLVM (which sets Darwin ABI). Ideally, we would get agreement on this choice (or any replacement) before GCC12 is shipped. PR debug/101283 - Several tests fail on Darwin with -gctf PR debug/101283 gcc/ChangeLog: * config/darwin.h (CTF_INFO_SECTION_NAME): New.
2021-07-01x86: Add vec_duplicate<mode> expanderH.J. Lu3-4/+34
Add vec_duplicate<mode> expander for SSE2 if we can move from GPR to SSE register directly. * config/i386/i386-expand.c (ix86_expand_vector_init_duplicate): Make it global. * config/i386/i386-protos.h (ix86_expand_vector_init_duplicate): New prototype. * config/i386/sse.md (INT_BROADCAST_MODE): New mode iterator. (vec_duplicate<mode>): New expander.
2021-07-01x86: Convert CONST_WIDE_INT/CONST_VECTOR to broadcastH.J. Lu35-24/+590
1. Update move expanders to convert the CONST_WIDE_INT and CONST_VECTOR operands to vector broadcast from an integer with AVX. 2. Add ix86_gen_scratch_sse_rtx to return a scratch SSE register which won't increase stack alignment requirement and blocks transformation by the combine pass. A small benchmark: https://gitlab.com/x86-benchmarks/microbenchmark/-/tree/memset/broadcast shows that broadcast is a little bit faster on Intel Core i7-8559U: $ make gcc -g -I. -O2 -c -o test.o test.c gcc -g -c -o memory.o memory.S gcc -g -c -o broadcast.o broadcast.S gcc -g -c -o vec_dup_sse2.o vec_dup_sse2.S gcc -o test test.o memory.o broadcast.o vec_dup_sse2.o ./test memory : 147215 broadcast : 121213 vec_dup_sse2: 171366 $ broadcast is also smaller: $ size memory.o broadcast.o text data bss dec hex filename 132 0 0 132 84 memory.o 122 0 0 122 7a broadcast.o $ 3. Update PR 87767 tests to expect integer broadcast instead of broadcast from memory. 4. Update avx512f_cond_move.c to expect integer broadcast. A small benchmark: https://gitlab.com/x86-benchmarks/microbenchmark/-/tree/vpaddd/broadcast shows that integer broadcast is faster than embedded memory broadcast: $ make gcc -g -I. -O2 -march=skylake-avx512 -c -o test.o test.c gcc -g -c -o memory.o memory.S gcc -g -c -o broadcast.o broadcast.S gcc -o test test.o memory.o broadcast.o ./test memory : 425538 broadcast : 375260 $ gcc/ PR target/100865 * config/i386/i386-expand.c (ix86_expand_vector_init_duplicate): New prototype. (ix86_byte_broadcast): New function. (ix86_convert_const_wide_int_to_broadcast): Likewise. (ix86_expand_move): Convert CONST_WIDE_INT to broadcast if mode size is 16 bytes or bigger. (ix86_broadcast_from_integer_constant): New function. (ix86_expand_vector_move): Convert CONST_WIDE_INT and CONST_VECTOR to broadcast if mode size is 16 bytes or bigger. * config/i386/i386-protos.h (ix86_gen_scratch_sse_rtx): New prototype. * config/i386/i386.c (ix86_gen_scratch_sse_rtx): New function. gcc/testsuite/ PR target/100865 * gcc.target/i386/avx512f-broadcast-pr87767-1.c: Expect integer broadcast. * gcc.target/i386/avx512f-broadcast-pr87767-5.c: Likewise. * gcc.target/i386/avx512vl-broadcast-pr87767-1.c: Likewise. * gcc.target/i386/avx512vl-broadcast-pr87767-5.c: Likewise. * gcc.target/i386/avx512f_cond_move.c: Also pass -mprefer-vector-width=512 and expect integer broadcast. * gcc.target/i386/pr100865-1.c: New test. * gcc.target/i386/pr100865-2.c: Likewise. * gcc.target/i386/pr100865-3.c: Likewise. * gcc.target/i386/pr100865-4a.c: Likewise. * gcc.target/i386/pr100865-4b.c: Likewise. * gcc.target/i386/pr100865-5a.c: Likewise. * gcc.target/i386/pr100865-5b.c: Likewise. * gcc.target/i386/pr100865-6a.c: Likewise. * gcc.target/i386/pr100865-6b.c: Likewise. * gcc.target/i386/pr100865-6c.c: Likewise. * gcc.target/i386/pr100865-7a.c: Likewise. * gcc.target/i386/pr100865-7b.c: Likewise. * gcc.target/i386/pr100865-7c.c: Likewise. * gcc.target/i386/pr100865-8a.c: Likewise. * gcc.target/i386/pr100865-8b.c: Likewise. * gcc.target/i386/pr100865-8c.c: Likewise. * gcc.target/i386/pr100865-9a.c: Likewise. * gcc.target/i386/pr100865-9b.c: Likewise. * gcc.target/i386/pr100865-9c.c: Likewise. * gcc.target/i386/pr100865-10a.c: Likewise. * gcc.target/i386/pr100865-10b.c: Likewise. * gcc.target/i386/pr100865-11a.c: Likewise. * gcc.target/i386/pr100865-11b.c: Likewise. * gcc.target/i386/pr100865-11c.c: Likewise. * gcc.target/i386/pr100865-12a.c: Likewise. * gcc.target/i386/pr100865-12b.c: Likewise. * gcc.target/i386/pr100865-12c.c: Likewise.
2021-07-01i386: Return true/false instead of 1/0 from predicates.Uros Bizjak1-7/+7
No functional changes. 2021-07-01 Uroš Bizjak <ubizjak@gmail.com> gcc/ * config/i386/predicates.md (ix86_endbr_immediate_operand): Return true/false instead of 1/0. (movq_parallel): Ditto.
2021-07-01Return true/false instead of 1/0 from generic predicates.Uros Bizjak1-32/+32
No functional changes. 2021-07-01 Uroš Bizjak <ubizjak@gmail.com> gcc/ * recog.c (general_operand): Return true/false instead of 1/0. (register_operand): Ditto. (immediate_operand): Ditto. (const_int_operand): Ditto. (const_scalar_int_operand): Ditto. (const_double_operand): Ditto. (push_operand): Ditto. (pop_operand): Ditto. (memory_operand): Ditto. (indirect_operand): Ditto.
2021-07-01Change the type of predicates to bool.Uros Bizjak6-44/+45
The patch was tested on many targets, but some fallout is expected. To fix the build error, simply change the function type from int to bool, as was done in the patch for several targets. 2021-07-01 Uroš Bizjak <ubizjak@gmail.com> gcc/ * genpreds.c (write_predicate_subfunction): Change the type of written subfunction to bool. (write_one_predicate_function): Change the type of written function to bool. (write_tm_preds_h): Ditto. * recog.h (*insn_operand_predicate_fn): Change the type to bool. * recog.c (general_operand): Change the type to bool. (address_operand): Ditto. (register_operand): Ditto. (pmode_register_operand): Ditto. (scratch_operand): Ditto. (immediate_operand): Ditto. (const_int_operand): Ditto. (const_scalar_int_operand): Ditto. (const_double_operand): Ditto. (nonimmediate_operand): Ditto. (nonmemory_operand): Ditto. (push_operand): Ditto. (pop_operand): Ditto. (memory_operand): Ditto. (indirect_operand): Ditto. (ordered_comparison_operator): Ditto. (comparison_operator): Ditto. * config/i386/i386-expand.c (ix86_expand_sse_cmp): Change the type of indirect predicate function to bool. * config/rs6000/rs6000.c (easy_vector_constant): Change the type to bool. * config/mips/mips-protos.h (m16_based_address_p): Change the type of operand 3 to bool.