aboutsummaryrefslogtreecommitdiff
path: root/gcc
AgeCommit message (Collapse)AuthorFilesLines
2021-11-10[Ada] Create explicit ghost mirror unit for big integersYannick Moy5-9/+37
gcc/ada/ * Makefile.rtl: Add unit. * libgnat/a-nbnbin__ghost.adb: Move... * libgnat/a-nbnbig.adb: ... here. Mark ghost as ignored. * libgnat/a-nbnbin__ghost.ads: Move... * libgnat/a-nbnbig.ads: ... here. Add comment for purpose of this unit. Mark ghost as ignored. * libgnat/s-widthu.adb: Use new unit. * sem_aux.adb (First_Subtype): Adapt to the case of a ghost type whose freeze node is rewritten to a null statement.
2021-11-10[Ada] Fix Constraint error on rexgexp close bracket find algorithmEtienne Servais1-48/+59
gcc/ada/ * libgnat/s-regexp.adb (Check_Well_Formed_Pattern): Fix Constraint_Error on missing close bracket.
2021-11-10[Ada] Extend optimized equality of 2-element arraysPiotr Trojanek1-13/+11
gcc/ada/ * exp_ch4.adb (Expand_Array_Equality): Remove check of the array bound being an N_Range node; use Type_High_Bound/Type_Low_Bound, which handle all kinds of array bounds.
2021-11-10[Ada] Warn when interfaces swapped between full and partial viewEtienne Servais1-21/+53
gcc/ada/ * sem_ch3.adb (Derived_Type_Declaration): Introduce a subprogram for tree transformation. If a tree transformation is performed, then warn that it would be better to reorder the interfaces.
2021-11-10[Ada] Add guard against previous error for peculiar ACATS testEric Botcazou1-0/+6
gcc/ada/ * sem_ch4.adb (Find_Non_Universal_Interpretations): Add guard.
2021-11-10[Ada] Better error message on missing parenthesesYannick Moy1-2/+4
gcc/ada/ * par-ch4.adb (P_Primary): Adapt test for getting error message on missing parentheses.
2021-11-10Extend is_cond_scalar_reduction to handle bit_and/bit_xor/bit_ior.liuhongt4-8/+95
This will enable transformation like - # sum1_50 = PHI <prephitmp_64(13), 0(4)> - # sum2_52 = PHI <sum2_21(13), 0(4)> + # sum1_50 = PHI <_87(13), 0(4)> + # sum2_52 = PHI <_89(13), 0(4)> # ivtmp_62 = PHI <ivtmp_61(13), 64(4)> i.2_7 = (long unsigned int) i_49; _8 = i.2_7 * 8; ... vec1_i_38 = vec1_29 >> _10; vec2_i_39 = vec2_31 >> _10; _11 = vec1_i_38 & 1; - _63 = tmp_37 ^ sum1_50; - prephitmp_64 = _11 == 0 ? sum1_50 : _63; + _ifc__86 = _11 != 0 ? tmp_37 : 0; + _87 = sum1_50 ^ _ifc__86; _12 = vec2_i_39 & 1; : so that vectorizer won't failed due to /* If this isn't a nested cycle or if the nested cycle reduction value is used ouside of the inner loop we cannot handle uses of the reduction value. */ if (nlatch_def_loop_uses > 1 || nphi_def_loop_uses > 1) { if (dump_enabled_p ()) dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location, "reduction used in loop.\n"); return NULL; } gcc/ChangeLog: PR tree-optimization/103126 * tree-vect-loop.c (neutral_op_for_reduction): Remove static. * tree-vectorizer.h (neutral_op_for_reduction): Declare. * tree-if-conv.c : Include tree-vectorizer.h. (is_cond_scalar_reduction): Handle BIT_XOR_EXPR/BIT_IOR_EXPR/BIT_AND_EXPR. (convert_scalar_cond_reduction): Ditto. gcc/testsuite/ChangeLog: * gcc.target/i386/ifcvt-reduction-logic-op.c: New test.
2021-11-10i386: Support complex fma/conj_fma for _Float16.konglin12-0/+63
Support cmla_optab, cmul_optab, cmla_conj_optab, cmul_conj_optab for vector _Float16. gcc/ChangeLog: * config/i386/sse.md (cmul<conj_op><mode>3): add new define_expand. (cmla<conj_op><mode>4): Likewise gcc/testsuite/ChangeLog: * gcc.target/i386/avx512fp16-vector-complex-float.c: New test.
2021-11-10Remove unused gimple-ssa-evr-analyze.h header file.Aldy Hernandez2-2/+0
gcc/ChangeLog: * tree-ssa-threadedge.c: Do not include gimple-ssa-evrp-analyze.h. * value-pointer-equiv.cc: Same.
2021-11-10Include PHI threading restrictions in backthreader diagnostics.Aldy Hernandez1-25/+22
I forgot to include the path dump when failing a path in resolve_phi. To do so I abstracted dump_path into its own function, which made me realize we had another copy with slightly different output. I've merged everything and cleaned it up. gcc/ChangeLog: * tree-ssa-threadbackward.c (back_threader::maybe_register_path_dump): Abstract path dumping... (dump_path): ...here. (back_threader::resolve_phi): Call dump_path. (debug): Same.
2021-11-10i386: Optimization for mm512_set1_pch.konglin12-0/+87
This patch is to support fold _mm512_fmadd_pch (a, _mm512_set1_pch(*(b)), c) to 1 instruction vfmaddcph (%rsp){1to16}, %zmm1, %zmm2; gcc/ChangeLog: * config/i386/sse.md (fma_<complexpairopname>_<mode>_pair): Add new define_insn. (fma_<mode>_fmaddc_bcst): Add new define_insn_and_split. (fma_<mode>_fcmaddc_bcst): Likewise gcc/testsuite/ChangeLog: * gcc.target/i386/avx512fp16vl-complex-broadcast-1.c: New test.
2021-11-10Simplify (trunc)MAX/MIN((extend)a, (extend)b) to MAX/MIN(a,b)liuhongt2-0/+55
a and b are same type as trunc type and has less precision than extend type. gcc/ChangeLog: PR target/102464 * match.pd: Simplify (trunc)fmax/fmin((extend)a, (extend)b) to MAX/MIN(a,b) gcc/testsuite/ChangeLog: * gcc.target/i386/pr102464-maxmin.c: New test.
2021-11-10aarch64: [PR101529] Fix vector shuffle insertion expansionAndrew Pinski3-2/+53
The function aarch64_evpc_ins would reuse the target even though it might be the same register as the two inputs. Instead of checking to see if we can reuse the target, just use the original input directly. Committed as approved after bootstrapped and tested on aarch64-linux-gnu with no regressions. PR target/101529 gcc/ChangeLog: * config/aarch64/aarch64.c (aarch64_evpc_ins): Don't use target as an input, use original one. gcc/testsuite/ChangeLog: * c-c++-common/torture/builtin-convertvector-2.c: New test. * c-c++-common/torture/builtin-shufflevector-2.c: New test.
2021-11-09Nios2: Add TARGET_CAN_INLINE_P hook.Sandra Loosemore5-0/+161
2021-11-09 Sandra Loosemore <sandra@codesourcery.com> gcc/ * config/nios2/nios2.c (nios2_can_inline_p): New. (TARGET_CAN_INLINE_P): Define. gcc/testsuite/ * gcc.target/nios2/custom-fp-inline-1.c: New. * gcc.target/nios2/custom-fp-inline-2.c: New. * gcc.target/nios2/custom-fp-inline-3.c: New. * gcc.target/nios2/custom-fp-inline-4.c: New.
2021-11-10Daily bump.GCC Administrator7-1/+516
2021-11-09c: more precise locations for some -Wpragmas diagnosticsDavid Malcolm2-12/+107
gcc/c-family/ChangeLog: * c-pragma.c (GCC_BAD_AT): New macro. (GCC_BAD2_AT): New macro. (handle_pragma_pack): Use the location of the pertinent token when issuing diagnostics about invalid constants/actions, and trailing junk. (handle_pragma_target): Likewise for non-string "GCC option". (handle_pragma_message): Likewise for trailing junk. gcc/testsuite/ChangeLog: * gcc.dg/bad-pragma-locations.c: New test. Signed-off-by: David Malcolm <dmalcolm@redhat.com>
2021-11-09rs6000: Match recent builtins changes in new builtins supportBill Schmidt2-14/+39
2021-11-09 Bill Schmidt <wschmidt@linux.ibm.com> gcc/ * config/rs6000/rs6000-call.c (rs6000_gimple_fold_new_builtin): Disable gimple fold for RS6000_BIF_{XVMINDP,XVMINSP,VMINFP} and RS6000_BIF_{XVMAXDP,XVMAXSP,VMAXFP} when fast-math is not set. (lxvrse_expand_builtin): Modify the expansion for sign extension. All extensions are done within VSX registers. gcc/testsuite/ * gcc.target/powerpc/p10_vec_xl_sext.c: Fix long long case.
2021-11-09Fortran: Fix memory leak in finalization wrappers [PR68800]Bernhard Reutner-Fischer4-25/+20
If a finalization is not required we created a namespace containing formal arguments for an internal interface definition but never used any of these. So the whole sub_ns namespace was not wired up to the program and consequently was never freed. The fix is to simply not generate any finalization wrappers if we know that it will be unused. Note that this reverts back to the original r190869 (8a96d64282ac534cb597f446f02ac5d0b13249cc) handling for this case by reverting this specific part of r194075 (f1ee56b4be7cc3892e6ccc75d73033c129098e87) for PR fortran/37336. valgrind summary for e.g. gfortran.dg/abstract_type_3.f03 and gfortran.dg/abstract_type_4.f03 where ".orig" is pristine trunk and ".mine" contains this fix: at3.orig.vg:LEAK SUMMARY: at3.orig.vg- definitely lost: 8,460 bytes in 11 blocks at3.orig.vg- indirectly lost: 13,288 bytes in 55 blocks at3.orig.vg- possibly lost: 0 bytes in 0 blocks at3.orig.vg- still reachable: 572,278 bytes in 2,142 blocks at3.orig.vg- suppressed: 0 bytes in 0 blocks at3.orig.vg- at3.orig.vg-Use --track-origins=yes to see where uninitialised values come from at3.orig.vg-ERROR SUMMARY: 38 errors from 33 contexts (suppressed: 0 from 0) -- at3.mine.vg:LEAK SUMMARY: at3.mine.vg- definitely lost: 344 bytes in 1 blocks at3.mine.vg- indirectly lost: 7,192 bytes in 18 blocks at3.mine.vg- possibly lost: 0 bytes in 0 blocks at3.mine.vg- still reachable: 572,278 bytes in 2,142 blocks at3.mine.vg- suppressed: 0 bytes in 0 blocks at3.mine.vg- at3.mine.vg-ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0) at3.mine.vg-ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0) at4.orig.vg:LEAK SUMMARY: at4.orig.vg- definitely lost: 13,751 bytes in 12 blocks at4.orig.vg- indirectly lost: 11,976 bytes in 60 blocks at4.orig.vg- possibly lost: 0 bytes in 0 blocks at4.orig.vg- still reachable: 572,278 bytes in 2,142 blocks at4.orig.vg- suppressed: 0 bytes in 0 blocks at4.orig.vg- at4.orig.vg-Use --track-origins=yes to see where uninitialised values come from at4.orig.vg-ERROR SUMMARY: 18 errors from 16 contexts (suppressed: 0 from 0) -- at4.mine.vg:LEAK SUMMARY: at4.mine.vg- definitely lost: 3,008 bytes in 3 blocks at4.mine.vg- indirectly lost: 4,056 bytes in 11 blocks at4.mine.vg- possibly lost: 0 bytes in 0 blocks at4.mine.vg- still reachable: 572,278 bytes in 2,142 blocks at4.mine.vg- suppressed: 0 bytes in 0 blocks at4.mine.vg- at4.mine.vg-ERROR SUMMARY: 3 errors from 3 contexts (suppressed: 0 from 0) at4.mine.vg-ERROR SUMMARY: 3 errors from 3 contexts (suppressed: 0 from 0) gcc/fortran/ChangeLog: 2018-10-12 Bernhard Reutner-Fischer <aldot@gcc.gnu.org> PR fortran/68800 * class.c (generate_finalization_wrapper): Do not leak finalization wrappers if they will not be used. * expr.c (gfc_free_actual_arglist): Formatting fix. * gfortran.h (gfc_free_symbol): Pass argument by reference. (gfc_release_symbol): Likewise. (gfc_free_namespace): Likewise. * symbol.c (gfc_release_symbol): Adjust acordingly. (free_components): Set procedure pointer components of derived types to NULL after freeing. (free_tb_tree): Likewise. (gfc_free_symbol): Set sym to NULL after freeing. (gfc_free_namespace): Set namespace to NULL after freeing.
2021-11-09[Committed] Fix tree-optimization/103152: Still one more -signed1bit issueAndrew Pinski2-2/+13
When I fixed PR 102622, I accidently left behind a TYPE_PRECISION check which I had there for checking before hand. This check is not needed as the code will handle it correctly anyways. Committed as obvious after a bootstrap/test on x86_64-linux-gnu. PR tree-optimization/10352 gcc/ChangeLog: * match.pd: Remove check of TYPE_PRECISION for the a?0:pow2 case. gcc/testsuite/ChangeLog: * gcc.c-torture/execute/pr10352-1.c: New test.
2021-11-09Keep x_range_query NULL for global ranges.Andrew MacLeod5-23/+19
Instead of x_range_query always pointing to an object, have it default to NULL and return a pointer to the global query in that case. * function.c (allocate_struct_function): Don't set x_range_query. * function.h (get_range_query): Move to value-query.h. * gimple-range.cc (enable_ranger): Check that query is currently NULL. (disable_ranger): Clear function current query field. * value-query.cc (get_global_range_query): Relocate to: * value-query.h (get_global_range_query): Here and inline. (get_range_query): Relocate here from function.h.
2021-11-09Dump details of an attempt to register a jump threading path.Aldy Hernandez1-0/+34
The goal with these sets of patches is to improve the detailed dumps for the threader, as I hope we eventually reach the point when I'm not the only one looking at these dumps ;-). This patch adds candidate paths to the detailed threading dumps to make it easier to see the decisions the threader makes. With it we can now grep for the discovery logic in action: $ grep ^path: a.ii.*thread* a.ii.034t.ethread:path: 4->5->xx REJECTED a.ii.034t.ethread:path: 3->5->8 SUCCESS a.ii.034t.ethread:path: 4->5->6 SUCCESS a.ii.034t.ethread:path: 0->2->xx REJECTED a.ii.034t.ethread:path: 0->2->xx REJECTED ... ... a.ii.111t.threadfull1:path: 14->22->23->xx REJECTED (unreachable) a.ii.111t.threadfull1:path: 15->22->23->xx REJECTED (unreachable) a.ii.111t.threadfull1:path: 16->22->23->xx REJECTED (unreachable) In addition to this, if --param=threader-debug=all is used, one can see the entire chain of events leading up to the ultimate threading decision: ============================================== path_range_query: compute_ranges for path: 2->5 Registering killing_def (path_oracle) _3 Registering killing_def (path_oracle) _1 range_defined_in_block (BB2) for _1 is _Bool VARYING Registering killing_def (path_oracle) _2 range_defined_in_block (BB2) for _2 is _Bool VARYING range_defined_in_block (BB2) for _3 is _Bool VARYING outgoing_edge_range_p for b_10(D) on edge 2->5 is int VARYING ... ... [BBs and gimple along path] ... path: 2->5->xx REJECTED Tested on x86-64 Linux. gcc/ChangeLog: * tree-ssa-threadbackward.c (back_threader::maybe_register_path_dump): New. (back_threader::maybe_register_path): Call maybe_register_path_dump.
2021-11-09Return NULL for maybe_register_path when unprofitable.Aldy Hernandez1-18/+20
This is a minor cleanup for maybe_register_path to return NULL when the path is unprofitable. It is needed for a follow-up patch to generate better dumps from the threader. There is no change in behavior, since the only call to this function bails on !profitable_path_p. Tested on x86-64 Linux. gcc/ChangeLog: * tree-ssa-threadbackward.c (back_threader::maybe_register_path): Return NULL when unprofitable.
2021-11-09Introduce build_debug_expr_declMartin Jambor8-28/+20
This patch introduces a helper function build_debug_expr_decl to build DEBUG_EXPR_DECL tree nodes in the most common way and replaces with a call of this function all code pieces which build such a DECL itself and sets its mode to the TYPE_MODE of its type. There still remain 11 instances of open-coded creation of a DEBUG_EXPR_DECL which set the mode of the DECL to something else. It would probably be a good idea to figure out that has any effect and if not, convert them to calls of build_debug_expr_decl too. But this patch deliberately does not introduce any functional changes. gcc/ChangeLog: 2021-11-08 Martin Jambor <mjambor@suse.cz> * tree.h (build_debug_expr_decl): Declare. * tree.c (build_debug_expr_decl): New function. * cfgexpand.c (avoid_deep_ter_for_debug): Use build_debug_expr_decl instead of building a DEBUG_EXPR_DECL. * ipa-param-manipulation.c (ipa_param_body_adjustments::prepare_debug_expressions): Likewise. * omp-simd-clone.c (ipa_simd_modify_stmt_ops): Likewise. * tree-ssa-ccp.c (optimize_atomic_bit_test_and): Likewise. * tree-ssa-phiopt.c (spaceship_replacement): Likewise. * tree-ssa-reassoc.c (make_new_ssa_for_def): Likewise.
2021-11-09Remove dead Fortran function.Martin Liska1-17/+0
gcc/fortran/ChangeLog: * symbol.c (gfc_get_ultimate_derived_super_type): Remove.
2021-11-09rs6000: Debug support for builtins changesBill Schmidt1-7/+188
2021-11-09 Bill Schmidt <wschmidt@linux.ibm.com> gcc/ * config/rs6000/rs6000-call.c (rs6000_type_string): New function. (def_builtin): Change debug formatting for easier parsing and include more information. (rs6000_init_builtins): Add dump of autogenerated builtins. (altivec_init_builtins): Dump __builtin_altivec_mask_for_load for completeness.
2021-11-09c++: Skip unnamed bit-fields moreMarek Polacek3-5/+26
As Jason noticed in <https://gcc.gnu.org/pipermail/gcc-patches/2021-November/583592.html>, we shouldn't require an initializer for an unnamed bit-field, because, as [class.bit] says, they cannot be initialized. gcc/cp/ChangeLog: * class.c (default_init_uninitialized_part): Use next_initializable_field. * method.c (walk_field_subobs): Skip unnamed bit-fields. gcc/testsuite/ChangeLog: * g++.dg/init/bitfield6.C: New test.
2021-11-09ipa: Fix typo in ipa-modref.cMarek Polacek1-1/+1
gcc/ChangeLog: * ipa-modref.c (analyze_parms): Fix a typo.
2021-11-10[PR/target 102957] Allow Z*-ext extension with only 2 char.Kito Cheng2-1/+5
We was assume the Z* extension should be more than 2 char, so we put an assertion there, but it should just an error or warning rather than an assertion, however RISC-V has add `Zk` extension, which just 2 char, so actually, we should just allow that. gcc/ChangeLog PR target/102957 * common/config/riscv/riscv-common.c (multi_letter_subset_rank): Remove assertion for Z*-ext. gcc/testsuite/ChangeLog * gcc.target/riscv/pr102957.c: New.
2021-11-09Merge IPA solution with local one in ipa-modrefJan Hubicka1-18/+69
gcc/ChangeLog: * ipa-modref.c (analyze_parms): Add past_flags, past_retslot_flags and past_static_chain; merge past summary with current one. (analyze_function): Update.
2021-11-09Document --param=threader-debug.Aldy Hernandez1-0/+3
gcc/ChangeLog: * doc/invoke.texi (Invoking GCC): Document --param=threader-debug.
2021-11-09c++: Fix ICE on complex constant with -frounding-math [PR103114]Jakub Jelinek2-3/+7
The FE uses build_complex which assumes that fold_convert will fold value to a constant. With -frounding-math that isn't guaranteed though. So, the patch instead fold_build2s COMPLEX_EXPR, which will result in build_complex if both arguments are constants, and otherwise will build COMPLEX_EXPR. build_zero_cst is an optimization for fold_convert (type, integer_zero_node). 2021-11-09 Jakub Jelinek <jakub@redhat.com> PR c++/103114 * parser.c (cp_parser_userdef_numeric_literal): Use fold_build2 with COMPLEX_EXPR arg instead of build_complex, use build_zero_cst instead of fold_convert from integer_zero_node. * g++.dg/ext/complex10.C: New test.
2021-11-09c++: bogus error w/ tentative type parse of concept-id [PR98394]Patrick Palka3-4/+33
Here when tentatively parsing the if condition as a declaration, we try to treat C<1> as the start of a constrained placeholder type, which we quickly reject because C doesn't accept a type as its first argument. But since we're parsing tentatively, we shouldn't emit an error in this case. In passing, also fix PR85846 by only overriding 'tentative' to false when given a concept-name, and not also when given a concept-id that has an empty argument list. PR c++/98394 PR c++/85846 gcc/cp/ChangeLog: * parser.c (cp_parser_placeholder_type_specifier): Declare static. Don't override tentative to false when tmpl is a concept-id with empty argument list. Don't emit a "does not constrain a type" error when tentative. gcc/testsuite/ChangeLog: * g++.dg/cpp2a/concepts-pr98394.C: New test. * g++.dg/cpp2a/concepts-pr85846.C: New test.
2021-11-09c++: unexpanded pack in var tmpl partial spec [PR100652]Patrick Palka2-5/+17
Here we're failing to spot a bare parameter pack appearing in the argument list of a variable template partial specialization because we only look for them within the decl's TREE_TYPE, which is sufficient for class templates but not for variable templates. PR c++/100652 gcc/cp/ChangeLog: * pt.c (push_template_decl): Check for bare parameter packs in the argument list of a variable template partial specialization. gcc/testsuite/ChangeLog: * g++.dg/cpp1y/var-templ69.C: New test.
2021-11-09Define m_rtx_reuse_manager only if not GENERATOR_FILE.Martin Liska2-3/+7
gcc/ChangeLog: * print-rtl.c (rtx_writer::rtx_writer): Make the compilation conditional based on * print-rtl.h (class rtx_writer): Likewise.
2021-11-09Generalize 'gcc/input.h:struct location_hash'Thomas Schwinge1-2/+22
This is currently only used here ('gcc/input.h:class string_concat_db'), but is actually generally useful, so advertize it as such. Per the rationale given, we may use 'BUILTINS_LOCATION' as spare value for 'Deleted', in addition to the existing use of 'UNKNOWN_LOCATION' as spare value for 'Empty'. gcc/ * input.h (location_hash): Use 'BUILTINS_LOCATION' as spare value for 'Deleted'. Turn into a '#define'.
2021-11-09Cleanup path solver dumps.Aldy Hernandez2-8/+9
This patch makes the path solver dumps a bit more consistent. Tested on x86-64 Linux. gcc/ChangeLog: * gimple-range-path.cc (path_range_query::dump): Clean up. (path_range_query::compute_ranges): Same. * value-relation.cc (path_oracle::dump): Same.
2021-11-09Remove TDF_THREADING flag in favor of param.Aldy Hernandez5-15/+31
I am returning a TDF_* flag to the queue of available entries as I am unconvinced that we need to burn an entire flag for internal debugging constructs, especially since we seem to be running out of them. I've added a --param=threader-debug entry similar to the one we use for ranger debugging. Currently this only affects the backward threader, but since the DOM threader is an outlier and on the chopping block, I avoided using the "backward" name. Tested on x86-64 Linux. gcc/ChangeLog: * dumpfile.c (dump_options): Remove TDF_THREADING entry. * dumpfile.h (enum dump_flag): Remove TDF_THREADING and adjust remaining entries. * flag-types.h (enum threader_debug): New. * gimple-range-path.cc (DEBUG_SOLVER): Use param_threader_debug. * params.opt: Add entry for --param=threader-debug=.
2021-11-09Get rid of infinite recursion for 'typedef' used with GTY-marked ↵Thomas Schwinge2-1/+13
'gcc/diagnostic-spec.h:nowarn_map' [PR101204, PR103157] Reproduced with clang version 10.0.0-4ubuntu1: gtype-desc.c:11333:1: warning: all paths through this function will call itself [-Winfinite-recursion] ... as well as some GCC's '-O2 -fdump-tree-optimized': void gt_pch_nx(int_hash<unsigned int, 0u, 4294967295u>*, gt_pointer_operator, void*) ([...]) { <bb 2>: <bb 3>: goto <bb 3>; } That three-arguments 'gt_pch_nx' function as well as two one-argument 'gt_ggc_mx', 'gt_pch_nx' functions now turn empty: [...] void -gt_ggc_mx (int_hash<location_t,0,UINT_MAX>& x_r ATTRIBUTE_UNUSED) +gt_ggc_mx (struct xint_hash_t& x_r ATTRIBUTE_UNUSED) { - int_hash<location_t,0,UINT_MAX> * ATTRIBUTE_UNUSED x = &x_r; - gt_ggc_mx (&((*x))); + struct xint_hash_t * ATTRIBUTE_UNUSED x = &x_r; } [...] void -gt_pch_nx (int_hash<location_t,0,UINT_MAX>& x_r ATTRIBUTE_UNUSED) +gt_pch_nx (struct xint_hash_t& x_r ATTRIBUTE_UNUSED) { - int_hash<location_t,0,UINT_MAX> * ATTRIBUTE_UNUSED x = &x_r; - gt_pch_nx (&((*x))); + struct xint_hash_t * ATTRIBUTE_UNUSED x = &x_r; } [...] void -gt_pch_nx (int_hash<location_t,0,UINT_MAX>* x ATTRIBUTE_UNUSED, +gt_pch_nx (struct xint_hash_t* x ATTRIBUTE_UNUSED, ATTRIBUTE_UNUSED gt_pointer_operator op, ATTRIBUTE_UNUSED void *cookie) { - gt_pch_nx (&((*x)), op, cookie); } [...] gcc/ PR middle-end/101204 PR other/103157 * diagnostic-spec.h (typedef xint_hash_t): Turn into... (struct xint_hash_t): ... this. * doc/gty.texi: Update.
2021-11-09arm: add armv9-a architecture to -marchPrzemyslaw Wirkus9-8/+79
In this patch: + Add `armv9-a` to -march. + Update multilib with armv9-a and armv9-a+simd. gcc/ChangeLog: * config/arm/arm-cpus.in (armv9): New define. (ARMv9a): New group. (armv9-a): New arch definition. * config/arm/arm-tables.opt: Regenerate. * config/arm/arm.h (BASE_ARCH_9A): New arch enum value. * config/arm/t-aprofile: Added armv9-a and armv9+simd. * config/arm/t-arm-elf: Added arm9-a, v9_fps and all_v9_archs to MULTILIB_MATCHES. * config/arm/t-multilib: Added v9_a_nosimd_variants and v9_a_simd_variants to MULTILIB_MATCHES. * doc/invoke.texi: Update docs. gcc/testsuite/ChangeLog: * gcc.target/arm/multilib.exp: Update test with armv9-a entries. * lib/target-supports.exp (v9a): Add new armflag. (__ARM_ARCH_9A__): Add new armdef.
2021-11-09ipa: Fix segfault when remapping debug_binds with expressions (PR 103132)Martin Jambor2-8/+38
My initial implementation of the method ipa_param_body_adjustments::remap_with_debug_expressions was based on the assumption that if it was asked to remap an expression (as opposed to a simple SSA_NAME), the expression would not contain an SSA_NAME operand which is to be debug-reset. While that is true for when called from ipa_param_body_adjustments::prepare_debug_expressions, it turns out it is not true when invoked from remap_gimple_stmt in tree-inline.c. This patch adds a simple logic to handle such cases and simply map the entire value to NULL_TREE in those cases. gcc/ChangeLog: 2021-11-08 Martin Jambor <mjambor@suse.cz> PR ipa/103132 * ipa-param-manipulation.c (replace_with_mapped_expr): Early return with error_mark_mode when part of expression is mapped to NULL. (ipa_param_body_adjustments::remap_with_debug_expressions): Set mapped value to NULL if walk_tree returns error_mark_mode. gcc/testsuite/ChangeLog: 2021-11-08 Martin Jambor <mjambor@suse.cz> PR ipa/103132 * gcc.dg/ipa/pr103132.c: New test.
2021-11-09[Ada] Fix Codepeer warningGhjuvan Lacambre1-1/+1
gcc/ada/ * freeze.adb (Check_Inherited_Conditions): Initialize Ifaces_List.
2021-11-09[Ada] Tidy up implementation of Has_Compatible_TypeEric Botcazou2-48/+39
gcc/ada/ * sem_ch4.adb (Analyze_Membership_Op) <Find_Interpretation>: Handle both overloaded and non-overloaded cases. <Try_One_Interp>: Do a reversed call to Covers if the outcome of the call to Has_Compatible_Type is false. Simplify implementation after change to Find_Interpretation. (Analyze_User_Defined_Binary_Op): Be prepared for previous errors. (Find_Comparison_Types) <Try_One_Interp>: Do a reversed call to Covers if the outcome of the call to Has_Compatible_Type is false. (Find_Equality_Types) <Try_One_Interp>: Likewise. * sem_type.adb (Has_Compatible_Type): Remove the reversed calls to Covers. Add explicit return on all paths.
2021-11-09[Ada] Invalid GPR_PROJECT_PATH_FILE confuses gnatlsJustin Squirek1-43/+39
gcc/ada/ * gnatls.adb (Initialize_Default_Project_Path): Remove early abort on invalid path.
2021-11-09[Ada] Print Storage_Pool and Procedure_To_Call fieldsEric Botcazou1-5/+49
gcc/ada/ * sprint.adb (Sprint_Node_Actual) <N_Allocator>: Also print the Procedure_To_Call field if it is present. <N_Extended_Return_Statement>: Also print the Storage_Pool and Procedure_To_Call fields if they are present. <N_Free_Statement>: Likewise. <N_Simple_Return_Statement>: Likewise.
2021-11-09[Ada] Do not indicate a pending abort if the task is already abortingPatrick Bernardi2-1/+2
gcc/ada/ * libgnarl/s-tasini.adb (Check_Abort_Status): Don't return 1 if the task is aborting. * libgnarl/s-tasini.ads (Check_Abort_Status): Update comment.
2021-11-09[Ada] RTEMS: use atomic primitive packages on aarch64Patrick Bernardi1-0/+7
gcc/ada/ * Makefile.rtl: Add ATOMICS_TARGET_PAIRS and ATOMICS_BUILTINS_TARGET_PAIRS to LIBGNAT_TARGET_PAIRS for aarch64-rtems.
2021-11-09[Ada] Hang on compilation of unit with type extension in bodyJustin Squirek1-0/+8
gcc/ada/ * exp_util.adb (Ancestor_Primitive): Prevent return of an subprogram alias when the ancestor primitive of the alias is the same as Subp.
2021-11-09[Ada] Crash on expansion of tagged membership testJustin Squirek1-0/+11
gcc/ada/ * exp_ch4.adb (Tagged_Membership): Use corresponding record type when expanding a tagged membership test on protected types.
2021-11-09[Ada] Improve integration of strub with type systemsAlexandre Oliva16-87/+747
gcc/ada/ * strub.adb, strub.ads: New files. * exp_attr.adb (Access_Cases): Copy strub mode to subprogram type. * exp_disp.adb (Expand_Dispatching_Call): Likewise. * freeze.adb (Check_Inherited_Conditions): Check that strub modes match overridden subprograms and interfaces. (Freeze_All): Renaming declarations too. * sem_attr.adb (Resolve_Attribute): Reject 'Access to strub-annotated data object. * sem_ch3.adb (Derive_Subprogram): Copy strub mode to inherited subprogram. * sem_prag.adb (Analyze_Pragma): Propagate Strub Machine_Attribute from access-to-subprogram to subprogram type when required, but not from access-to-data to data type. Mark the entity that got the pragma as having a gigi rep item. * sem_res.adb (Resolve): Reject implicit conversions that would change strub modes. (Resolve_Type_Conversions): Reject checked conversions between incompatible strub modes. * doc/gnat_rm/security_hardening_features.rst: Update. * gnat_rm.texi: Regenerate. * libgnat/a-except.ads (Raise_Exception): Revert strub-callable annotation in public subprogram. * libgnat/s-arit128.ads (Multiply_With_Ovflo_Check128): Likewise. * libgnat/s-arit64.ads (Multiply_With_Ovflo_Check64): Likewise. * libgnat/s-secsta.ads (SS_Allocate): Likewise. (SS_Mark, SS_Release): Likewise. * gcc-interface/Make-lang.in (GNAT_ADA_OBJS): Add ada/strub.o.
2021-11-09[Ada] Initialize Current_Source_UnitEtienne Servais1-4/+4
gcc/ada/ * sinput.ads: Initialize Current_Source_Unit to No_Unit.