Andre Vieira [Wed, 10 Nov 2021 09:51:53 +0000 (09:51 +0000)]
[AArch64] Fix big-endian testisms introduced by NEON gimple lowering patch
This patch reverts the tests for big-endian after the NEON gimple lowering
patch. The earlier patch only lowers NEON loads and stores for little-endian,
meaning the codegen now differs between endinanness so we need target specific
testing.
gcc/testsuite/ChangeLog:
* gcc.target/aarch64/fmla_intrinsic_1.c: Fix big-endian testism.
* gcc.target/aarch64/fmls_intrinsic_1.c: Likewise.
* gcc.target/aarch64/fmul_intrinsic_1.c: Likewise.
Jan Hubicka [Wed, 10 Nov 2021 09:25:51 +0000 (10:25 +0100)]
Fix modref_tree::remap_params
gcc/ChangeLog:
* ipa-modref-tree.h (modref_tree::remap_params): Fix off-by-one error.
Jakub Jelinek [Wed, 10 Nov 2021 09:24:49 +0000 (10:24 +0100)]
rs6000, libgcc: Fix up -Wmissing-prototypes warning on rs6000/linux-unwind.h
Jonathan reported and I've verified a
In file included from ../../../libgcc/unwind-dw2.c:412:
./md-unwind-support.h:398:6: warning: no previous prototype for ‘ppc_backchain_fallback’ [-Wmissing-prototypes]
398 | void ppc_backchain_fallback (struct _Unwind_Context *context, void *a)
| ^~~~~~~~~~~~~~~~~~~~~~
warning on powerpc*-linux* libgcc build.
All the other MD_* macro functions are static, so I think the following
is the right thing rather than adding a previous prototype for
ppc_backchain_fallback.
2021-11-10 Jakub Jelinek <jakub@redhat.com>
* config/rs6000/linux-unwind.h (ppc_back_fallback): Make it static,
formatting fix.
liuhongt [Mon, 25 Oct 2021 05:59:51 +0000 (13:59 +0800)]
Improve integer bit test on __atomic_fetch_[or|and]_* returns
commit
adedd5c173388ae505470df152b9cb3947339566
Author: Jakub Jelinek <jakub@redhat.com>
Date: Tue May 3 13:37:25 2016 +0200
re PR target/49244 (__sync or __atomic builtins will not emit 'lock bts/btr/btc')
optimized bit test on __atomic_fetch_or_* and __atomic_fetch_and_* returns
with lock bts/btr/btc by turning
mask_2 = 1 << cnt_1;
_4 = __atomic_fetch_or_* (ptr_6, mask_2, _3);
_5 = _4 & mask_2;
into
_4 = ATOMIC_BIT_TEST_AND_SET (ptr_6, cnt_1, 0, _3);
_5 = _4;
and
mask_6 = 1 << bit_5(D);
_1 = ~mask_6;
_2 = __atomic_fetch_and_4 (v_8(D), _1, 0);
_3 = _2 & mask_6;
_4 = _3 != 0;
into
mask_6 = 1 << bit_5(D);
_1 = ~mask_6;
_11 = .ATOMIC_BIT_TEST_AND_RESET (v_8(D), bit_5(D), 1, 0);
_4 = _11 != 0;
But it failed to optimize many equivalent, but slighly different cases:
1.
_1 = __atomic_fetch_or_4 (ptr_6, 1, _3);
_4 = (_Bool) _1;
2.
_1 = __atomic_fetch_and_4 (ptr_6, ~1, _3);
_4 = (_Bool) _1;
3.
_1 = __atomic_fetch_or_4 (ptr_6, 1, _3);
_7 = ~_1;
_5 = (_Bool) _7;
4.
_1 = __atomic_fetch_and_4 (ptr_6, ~1, _3);
_7 = ~_1;
_5 = (_Bool) _7;
5.
_1 = __atomic_fetch_or_4 (ptr_6, 1, _3);
_2 = (int) _1;
_7 = ~_2;
_5 = (_Bool) _7;
6.
_1 = __atomic_fetch_and_4 (ptr_6, ~1, _3);
_2 = (int) _1;
_7 = ~_2;
_5 = (_Bool) _7;
7.
_1 = __atomic_fetch_or_4 (ptr_6, 0x80000000, _3);
_5 = (signed int) _1;
_4 = _5 < 0;
8.
_1 = __atomic_fetch_and_4 (ptr_6, 0x7fffffff, _3);
_5 = (signed int) _1;
_4 = _5 < 0;
9.
_1 = 1 << bit_4(D);
mask_5 = (unsigned int) _1;
_2 = __atomic_fetch_or_4 (v_7(D), mask_5, 0);
_3 = _2 & mask_5;
10.
mask_7 = 1 << bit_6(D);
_1 = ~mask_7;
_2 = (unsigned int) _1;
_3 = __atomic_fetch_and_4 (v_9(D), _2, 0);
_4 = (int) _3;
_5 = _4 & mask_7;
We make
mask_2 = 1 << cnt_1;
_4 = __atomic_fetch_or_* (ptr_6, mask_2, _3);
_5 = _4 & mask_2;
and
mask_6 = 1 << bit_5(D);
_1 = ~mask_6;
_2 = __atomic_fetch_and_4 (v_8(D), _1, 0);
_3 = _2 & mask_6;
_4 = _3 != 0;
the canonical forms for this optimization and transform cases 1-9 to the
equivalent canonical form. For cases 10 and 11, we simply remove the cast
before __atomic_fetch_or_4/__atomic_fetch_and_4 with
_1 = 1 << bit_4(D);
_2 = __atomic_fetch_or_4 (v_7(D), _1, 0);
_3 = _2 & _1;
and
mask_7 = 1 << bit_6(D);
_1 = ~mask_7;
_3 = __atomic_fetch_and_4 (v_9(D), _1, 0);
_6 = _3 & mask_7;
_5 = (int) _6;
2021-11-04 H.J. Lu <hongjiu.lu@intel.com>
Hongtao Liu <hongtao.liu@intel.com>
gcc/
PR middle-end/102566
* match.pd (nop_atomic_bit_test_and_p): New match.
* tree-ssa-ccp.c (convert_atomic_bit_not): New function.
(gimple_nop_atomic_bit_test_and_p): New prototype.
(optimize_atomic_bit_test_and): Transform equivalent, but slighly
different cases to their canonical forms.
gcc/testsuite/
PR middle-end/102566
* g++.target/i386/pr102566-1.C: New test.
* g++.target/i386/pr102566-2.C: Likewise.
* g++.target/i386/pr102566-3.C: Likewise.
* g++.target/i386/pr102566-4.C: Likewise.
* g++.target/i386/pr102566-5a.C: Likewise.
* g++.target/i386/pr102566-5b.C: Likewise.
* g++.target/i386/pr102566-6a.C: Likewise.
* g++.target/i386/pr102566-6b.C: Likewise.
* gcc.target/i386/pr102566-1a.c: Likewise.
* gcc.target/i386/pr102566-1b.c: Likewise.
* gcc.target/i386/pr102566-2.c: Likewise.
* gcc.target/i386/pr102566-3a.c: Likewise.
* gcc.target/i386/pr102566-3b.c: Likewise.
* gcc.target/i386/pr102566-4.c: Likewise.
* gcc.target/i386/pr102566-5.c: Likewise.
* gcc.target/i386/pr102566-6.c: Likewise.
* gcc.target/i386/pr102566-7.c: Likewise.
* gcc.target/i386/pr102566-8a.c: Likewise.
* gcc.target/i386/pr102566-8b.c: Likewise.
* gcc.target/i386/pr102566-9a.c: Likewise.
* gcc.target/i386/pr102566-9b.c: Likewise.
* gcc.target/i386/pr102566-10a.c: Likewise.
* gcc.target/i386/pr102566-10b.c: Likewise.
* gcc.target/i386/pr102566-11.c: Likewise.
* gcc.target/i386/pr102566-12.c: Likewise.
* gcc.target/i386/pr102566-13.c: New test.
* gcc.target/i386/pr102566-14.c: New test.
Eric Botcazou [Fri, 5 Nov 2021 11:07:42 +0000 (12:07 +0100)]
[Ada] Minor cleanup in translation of calls to subprograms
gcc/ada/
* gcc-interface/ada-tree.h (DECL_STUBBED_P): Delete.
* gcc-interface/decl.c (gnat_to_gnu_entity): Do not set it.
* gcc-interface/trans.c (Call_to_gnu): Use GNAT_NAME local variable
and adjust accordingly. Replace test on DECL_STUBBED_P with direct
test on Convention and move it down in the processing.
Bob Duff [Fri, 5 Nov 2021 11:54:33 +0000 (07:54 -0400)]
[Ada] Warn for bidirectional characters
gcc/ada/
* scng.adb (Check_Bidi): New procedure to give warning. Note
that this is called only for non-ASCII characters, so should not
be an efficiency issue.
(Slit): Call Check_Bidi for wide characters in string_literals.
(Minus_Case): Call Check_Bidi for wide characters in comments.
(Char_Literal_Case): Call Check_Bidi for wide characters in
character_literals. Move Accumulate_Checksum down, because
otherwise, if Err is True, the Code is uninitialized.
* errout.ads: Make the obsolete nature of "Insertion character
?" more prominent; one should not have to read several
paragraphs before finding out that it's obsolete.
Bob Duff [Fri, 5 Nov 2021 12:54:23 +0000 (08:54 -0400)]
[Ada] Avoid warnings regarding rep clauses in generics -- follow-on
gcc/ada/
* repinfo.adb (List_Component_Layout): Initialize Sbit.
Piotr Trojanek [Fri, 5 Nov 2021 11:12:11 +0000 (12:12 +0100)]
[Ada] Fix comments about expansion of array equality
gcc/ada/
* exp_ch4.adb (Expand_Array_Equality): Fix inconsistent casing
in comment about the template for expansion of array equality;
now we use lower case for true/false/boolean.
(Handle_One_Dimension): Fix comment about the template for
expansion of array equality.
Bob Duff [Wed, 3 Nov 2021 16:06:28 +0000 (12:06 -0400)]
[Ada] Avoid warnings regarding rep clauses in generics
gcc/ada/
* repinfo.adb (List_Common_Type_Info, List_Object_Info): Add
check for In_Generic_Scope.
(List_Component_Layout): Check for known static values.
* sem_ch13.adb (Check_Record_Representation_Clause): Add check
for In_Generic_Scope.
Etienne Servais [Wed, 3 Nov 2021 14:48:42 +0000 (15:48 +0100)]
[Ada] ACATS BDC1002 shall not error on arbitrary aspect
gcc/ada/
* aspects.adb, aspects.ads (Is_Aspect_Id): New function.
* namet-sp.ads, namet-sp.adb (Aspect_Spell_Check,
Attribute_Spell_Check): New Functions.
* par-ch13.adb (Possible_Misspelled_Aspect): Removed.
(With_Present): Use Aspect_Spell_Check, use Is_Aspect_Id.
(Get_Aspect_Specifications): Use Aspect_Spell_Check,
Is_Aspect_Id, Bad_Aspect.
* par-sync.adb (Resync_Past_Malformed_Aspect): Use Is_Aspect_Id.
* sem_ch13.adb (Check_One_Attr): Use Is_Aspect_Id.
* sem_prag.adb (Process_Restrictions_Or_Restriction_Warnings):
Introduce the Process_No_Specification_Of_Aspect, emit a warning
instead of an error on unknown aspect, hint for typos.
Introduce Process_No_Use_Of_Attribute to add spell check for
attributes too.
(Set_Error_Msg_To_Profile_Name): Use Is_Aspect_Id.
* sem_util.adb (Bad_Attribute): Use Attribute_Spell_Check.
(Bad_Aspect): New function.
* sem_util.ads (Bad_Aspect): New function.
Patrick Bernardi [Wed, 3 Nov 2021 21:55:50 +0000 (17:55 -0400)]
[Ada] Do not assume a priority value of zero is a valid priority
gcc/ada/
* libgnarl/s-taskin.adb (Initialize_ATCB): Initialize
T.Common.Current_Priority to Priority'First.
* libgnarl/s-taskin.ads (Unspecified_Priority): Redefined as -1.
* libgnat/system-rtems.ads: Start priority range from 1, as 0 is
reserved by the operating system.
Pierre-Alexandre Bazin [Thu, 4 Nov 2021 09:48:46 +0000 (10:48 +0100)]
[Ada] Prove double precision integer arithmetic unit
gcc/ada/
* libgnat/a-nbnbig.ads: Mark the unit as Pure.
* libgnat/s-aridou.adb: Add contracts and ghost code for proof.
(Scaled_Divide): Reorder operations and use of temporaries in
two places to facilitate proof.
* libgnat/s-aridou.ads: Add full functional contracts.
* libgnat/s-arit64.adb: Mark in SPARK.
* libgnat/s-arit64.ads: Add contracts similar to those from
s-aridou.ads.
* rtsfind.ads: Document the limitation that runtime units
loading does not work for private with-clauses.
Piotr Trojanek [Mon, 1 Nov 2021 08:20:17 +0000 (09:20 +0100)]
[Ada] Don't carry action bodies for expansion of array equality
gcc/ada/
* exp_ch3.adb (Make_Eq_Body): Adapt call to
Expand_Record_Equality.
* exp_ch4.ads, exp_ch4.adb (Expand_Composite_Equality): Remove
Bodies parameter; adapt comment; fix style in body; adapt calls
to Expand_Record_Equality.
(Expand_Array_Equality): Adapt calls to
Expand_Composite_Equality.
(Expand_Record_Equality): Remove Bodies parameter; adapt
comment; adapt call to Expand_Composite_Equality.
* exp_ch8.adb (Build_Body_For_Renaming): Adapt call to
Expand_Record_Equality.
Piotr Trojanek [Sun, 31 Oct 2021 19:52:04 +0000 (20:52 +0100)]
[Ada] Use predefined equality for arrays inside records
gcc/ada/
* exp_ch4.adb (Expand_Composite_Equality): Handle arrays inside
records just like scalars; only records inside records need
dedicated handling.
Eric Botcazou [Wed, 3 Nov 2021 16:38:53 +0000 (17:38 +0100)]
[Ada] Fix oversight in latest change to Has_Compatible_Type
gcc/ada/
* sem_type.ads (Has_Compatible_Type): Add For_Comparison parameter.
* sem_type.adb (Has_Compatible_Type): Put back the reversed calls
to Covers guarded with For_Comparison.
* sem_ch4.adb (Analyze_Membership_Op) <Try_One_Interp>: Remove new
reversed call to Covers and set For_Comparison to true instead.
(Find_Comparison_Types) <Try_One_Interp>: Likewise
(Find_Equality_Types) <Try_One_Interp>: Likewise.
Yannick Moy [Tue, 2 Nov 2021 14:43:42 +0000 (15:43 +0100)]
[Ada] Create explicit ghost mirror unit for big integers
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.
Etienne Servais [Fri, 29 Oct 2021 14:42:39 +0000 (16:42 +0200)]
[Ada] Fix Constraint error on rexgexp close bracket find algorithm
gcc/ada/
* libgnat/s-regexp.adb (Check_Well_Formed_Pattern): Fix
Constraint_Error on missing close bracket.
Piotr Trojanek [Wed, 27 Oct 2021 20:04:55 +0000 (22:04 +0200)]
[Ada] Extend optimized equality of 2-element arrays
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.
Etienne Servais [Fri, 1 Oct 2021 15:04:11 +0000 (17:04 +0200)]
[Ada] Warn when interfaces swapped between full and partial view
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.
Eric Botcazou [Tue, 2 Nov 2021 15:54:36 +0000 (16:54 +0100)]
[Ada] Add guard against previous error for peculiar ACATS test
gcc/ada/
* sem_ch4.adb (Find_Non_Universal_Interpretations): Add guard.
Yannick Moy [Tue, 2 Nov 2021 14:05:55 +0000 (15:05 +0100)]
[Ada] Better error message on missing parentheses
gcc/ada/
* par-ch4.adb (P_Primary): Adapt test for getting error message
on missing parentheses.
liuhongt [Mon, 8 Nov 2021 07:49:17 +0000 (15:49 +0800)]
Extend is_cond_scalar_reduction to handle bit_and/bit_xor/bit_ior.
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.
konglin1 [Wed, 27 Oct 2021 09:15:05 +0000 (17:15 +0800)]
i386: Support complex fma/conj_fma for _Float16.
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.
Aldy Hernandez [Wed, 10 Nov 2021 07:03:34 +0000 (08:03 +0100)]
Remove unused gimple-ssa-evr-analyze.h header file.
gcc/ChangeLog:
* tree-ssa-threadedge.c: Do not include
gimple-ssa-evrp-analyze.h.
* value-pointer-equiv.cc: Same.
Aldy Hernandez [Tue, 9 Nov 2021 16:55:52 +0000 (17:55 +0100)]
Include PHI threading restrictions in backthreader diagnostics.
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.
konglin1 [Mon, 1 Nov 2021 02:43:34 +0000 (10:43 +0800)]
i386: Optimization for mm512_set1_pch.
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.
liuhongt [Thu, 4 Nov 2021 08:05:45 +0000 (16:05 +0800)]
Simplify (trunc)MAX/MIN((extend)a, (extend)b) to MAX/MIN(a,b)
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.
Andrew Pinski [Sat, 6 Nov 2021 06:29:13 +0000 (06:29 +0000)]
aarch64: [PR101529] Fix vector shuffle insertion expansion
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.
Sandra Loosemore [Tue, 9 Nov 2021 03:10:58 +0000 (19:10 -0800)]
Nios2: Add TARGET_CAN_INLINE_P hook.
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.
GCC Administrator [Wed, 10 Nov 2021 00:16:28 +0000 (00:16 +0000)]
Daily bump.
David Malcolm [Thu, 4 Nov 2021 21:58:27 +0000 (17:58 -0400)]
c: more precise locations for some -Wpragmas diagnostics
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>
Bill Schmidt [Tue, 9 Nov 2021 21:26:00 +0000 (15:26 -0600)]
rs6000: Match recent builtins changes in new builtins support
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.
Bernhard Reutner-Fischer [Fri, 12 Oct 2018 21:57:21 +0000 (23:57 +0200)]
Fortran: Fix memory leak in finalization wrappers [PR68800]
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.
François Dumont [Wed, 13 Oct 2021 20:04:32 +0000 (22:04 +0200)]
libstdc++: [_GLIBCXX_DEBUG] Implement unordered container merge
The _GLIBCXX_DEBUG unordered containers need a dedicated merge implementation
so that any existing iterator on the transfered nodes is properly invalidated.
Add typedef/using declarations for everything used as-is from normal implementation.
libstdc++-v3/ChangeLog:
* include/bits/hashtable_policy.h (__distance_fw): Replace class keyword with
typename.
* include/bits/hashtable.h (_Hashtable<>::_M_merge_unique): Remove noexcept
qualification. Use const_iterator for node extraction/reinsert.
(_Hashtable<>::_M_merge_multi): Likewise. Compute new hash code before extract.
* include/debug/safe_container.h (_Safe_container<>): Make all methods
protected.
* include/debug/safe_unordered_container.h
(_Safe_unordered_container<>::_UContInvalidatePred<_ExtractKey, _Source>): New.
(_Safe_unordered_container<>::_UMContInvalidatePred<_ExtractKey, _Source>): New.
(_Safe_unordered_container<>::_UContMergeGuard<_Source, _InvalidatePred>): New.
(_Safe_unordered_container<>::_S_uc_guard<_ExtractKey, _Source>): New.
(_Safe_unordered_container<>::_S_umc_guard<_ExtractKey, _Source>): New.
(_Safe_unordered_container<>::_M_invalide_all): Make public.
(_Safe_unordered_container<>::_M_invalide_if): Likewise.
(_Safe_unordered_container<>::_M_invalide_local_if): Likewise.
* include/debug/unordered_map
(unordered_map<>::mapped_type, pointer, const_pointer): New typedef.
(unordered_map<>::reference, const_reference, difference_type): New typedef.
(unordered_map<>::get_allocator, empty, size, max_size): Add usings.
(unordered_map<>::bucket_count, max_bucket_count, bucket): Add usings.
(unordered_map<>::hash_function, key_equal, count, contains): Add usings.
(unordered_map<>::operator[], at, rehash, reserve): Add usings.
(unordered_map<>::merge): New.
(unordered_multimap<>::mapped_type, pointer, const_pointer): New typedef.
(unordered_multimap<>::reference, const_reference, difference_type): New typedef.
(unordered_multimap<>::get_allocator, empty, size, max_size): Add usings.
(unordered_multimap<>::bucket_count, max_bucket_count, bucket): Add usings.
(unordered_multimap<>::hash_function, key_equal, count, contains): Add usings.
(unordered_multimap<>::rehash, reserve): Add usings.
(unordered_multimap<>::merge): New.
* include/debug/unordered_set
(unordered_set<>::mapped_type, pointer, const_pointer): New typedef.
(unordered_set<>::reference, const_reference, difference_type): New typedef.
(unordered_set<>::get_allocator, empty, size, max_size): Add usings.
(unordered_set<>::bucket_count, max_bucket_count, bucket): Add usings.
(unordered_set<>::hash_function, key_equal, count, contains): Add usings.
(unordered_set<>::rehash, reserve): Add usings.
(unordered_set<>::merge): New.
(unordered_multiset<>::mapped_type, pointer, const_pointer): New typedef.
(unordered_multiset<>::reference, const_reference, difference_type): New typedef.
(unordered_multiset<>::get_allocator, empty, size, max_size): Add usings.
(unordered_multiset<>::bucket_count, max_bucket_count, bucket): Add usings.
(unordered_multiset<>::hash_function, key_equal, count, contains): Add usings.
(unordered_multiset<>::rehash, reserve): Add usings.
(unordered_multiset<>::merge): New.
* testsuite/23_containers/unordered_map/debug/merge1_neg.cc: New test.
* testsuite/23_containers/unordered_map/debug/merge2_neg.cc: New test.
* testsuite/23_containers/unordered_map/debug/merge3_neg.cc: New test.
* testsuite/23_containers/unordered_map/debug/merge4_neg.cc: New test.
* testsuite/23_containers/unordered_multimap/debug/merge1_neg.cc: New test.
* testsuite/23_containers/unordered_multimap/debug/merge2_neg.cc: New test.
* testsuite/23_containers/unordered_multimap/debug/merge3_neg.cc: New test.
* testsuite/23_containers/unordered_multimap/debug/merge4_neg.cc: New test.
* testsuite/23_containers/unordered_multiset/debug/merge1_neg.cc: New test.
* testsuite/23_containers/unordered_multiset/debug/merge2_neg.cc: New test.
* testsuite/23_containers/unordered_multiset/debug/merge3_neg.cc: New test.
* testsuite/23_containers/unordered_multiset/debug/merge4_neg.cc: New test.
* testsuite/23_containers/unordered_set/debug/merge1_neg.cc: New test.
* testsuite/23_containers/unordered_set/debug/merge2_neg.cc: New test.
* testsuite/23_containers/unordered_set/debug/merge3_neg.cc: New test.
* testsuite/23_containers/unordered_set/debug/merge4_neg.cc: New test.
* testsuite/util/testsuite_abi.h: [_GLIBCXX_DEBUG] Use normal unordered
container implementation.
Andrew Pinski [Tue, 9 Nov 2021 09:56:10 +0000 (09:56 +0000)]
[Committed] Fix tree-optimization/103152: Still one more -signed1bit issue
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.
Andrew MacLeod [Tue, 9 Nov 2021 14:29:23 +0000 (09:29 -0500)]
Keep x_range_query NULL for global ranges.
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.
Aldy Hernandez [Tue, 9 Nov 2021 09:49:32 +0000 (10:49 +0100)]
Dump details of an attempt to register a jump threading path.
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.
Aldy Hernandez [Tue, 9 Nov 2021 09:45:26 +0000 (10:45 +0100)]
Return NULL for maybe_register_path when unprofitable.
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.
Martin Jambor [Tue, 9 Nov 2021 16:54:23 +0000 (17:54 +0100)]
Introduce build_debug_expr_decl
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.
Martin Liska [Tue, 9 Nov 2021 13:57:00 +0000 (14:57 +0100)]
Remove dead Fortran function.
gcc/fortran/ChangeLog:
* symbol.c (gfc_get_ultimate_derived_super_type): Remove.
Bill Schmidt [Tue, 9 Nov 2021 15:23:55 +0000 (09:23 -0600)]
rs6000: Debug support for builtins changes
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.
Marek Polacek [Mon, 8 Nov 2021 17:55:52 +0000 (12:55 -0500)]
c++: Skip unnamed bit-fields more
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.
Marek Polacek [Tue, 9 Nov 2021 16:28:54 +0000 (11:28 -0500)]
ipa: Fix typo in ipa-modref.c
gcc/ChangeLog:
* ipa-modref.c (analyze_parms): Fix a typo.
Kito Cheng [Mon, 8 Nov 2021 14:45:49 +0000 (22:45 +0800)]
[PR/target 102957] Allow Z*-ext extension with only 2 char.
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.
Thomas Schwinge [Fri, 5 Nov 2021 13:42:21 +0000 (14:42 +0100)]
Restore 'GOMP_OPENACC_DIM' environment variable parsing
... that got broken by recent commit
c057ed9c52c6a63a1a692268f916b1a9131cd4b7
"openmp: Fix up strtoul and strtoull uses in libgomp", resulting in spurious
FAILs for tests specifying 'dg-set-target-env-var "GOMP_OPENACC_DIM" "[...]"'.
libgomp/
* env.c (parse_gomp_openacc_dim): Restore parsing.
Jan Hubicka [Tue, 9 Nov 2021 15:48:09 +0000 (16:48 +0100)]
Merge IPA solution with local one in ipa-modref
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.
Aldy Hernandez [Tue, 9 Nov 2021 14:33:12 +0000 (15:33 +0100)]
Document --param=threader-debug.
gcc/ChangeLog:
* doc/invoke.texi (Invoking GCC): Document --param=threader-debug.
Jonathan Wakely [Tue, 9 Nov 2021 15:11:11 +0000 (15:11 +0000)]
libstdc++: Make test print which random_device tokens work
libstdc++-v3/ChangeLog:
* testsuite/26_numerics/random/random_device/cons/token.cc:
Print results of random_device_available checks.
Jonathan Wakely [Tue, 9 Nov 2021 09:34:23 +0000 (09:34 +0000)]
libstdc++: Do not use 64-bit DARN on 32-bit powerpc [PR103146]
We need to use the 64-bit DARN to detect failure without bias, but it's
not available in 32-bit mode.
libstdc++-v3/ChangeLog:
PR libstdc++/103146
* src/c++11/random.cc: Check __powerpc64__ not __powerpc__.
Jonathan Wakely [Thu, 4 Nov 2021 15:51:37 +0000 (15:51 +0000)]
libstdc++: Support getentropy and arc4random in std::random_device
This adds additional "getentropy" and "arc4random" tokens to
std::random_device. The former is supported on Glibc and OpenBSD (and
apparently wasm), and the latter is supported on various BSDs.
libstdc++-v3/ChangeLog:
* acinclude.m4 (GLIBCXX_CHECK_GETENTROPY, GLIBCXX_CHECK_ARC4RANDOM):
Define.
* configure.ac (GLIBCXX_CHECK_GETENTROPY, GLIBCXX_CHECK_ARC4RANDOM):
Use them.
* config.h.in: Regenerate.
* configure: Regenerate.
* src/c++11/random.cc (random_device): Add getentropy and
arc4random as sources.
* testsuite/26_numerics/random/random_device/cons/token.cc:
Check new tokens.
* testsuite/26_numerics/random/random_device/entropy.cc:
Likewise.
Jonathan Wakely [Tue, 9 Nov 2021 10:31:18 +0000 (10:31 +0000)]
libstdc++: Make spurious std::random_device FAIL less likely
It's possible that independent reads from /dev/random and /dev/urandom
could produce the same value by chance. Retry if that happens. The
chances of it happening twice are miniscule.
libstdc++-v3/ChangeLog:
* testsuite/26_numerics/random/random_device/cons/token.cc:
Retry if random devices produce the same value.
Jakub Jelinek [Tue, 9 Nov 2021 14:29:36 +0000 (15:29 +0100)]
c++: Fix ICE on complex constant with -frounding-math [PR103114]
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.
Patrick Palka [Tue, 9 Nov 2021 14:09:43 +0000 (09:09 -0500)]
c++: bogus error w/ tentative type parse of concept-id [PR98394]
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.
Patrick Palka [Tue, 9 Nov 2021 14:09:12 +0000 (09:09 -0500)]
c++: unexpanded pack in var tmpl partial spec [PR100652]
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.
Martin Liska [Tue, 9 Nov 2021 13:42:26 +0000 (14:42 +0100)]
Define m_rtx_reuse_manager only if not GENERATOR_FILE.
gcc/ChangeLog:
* print-rtl.c (rtx_writer::rtx_writer): Make the compilation
conditional based on
* print-rtl.h (class rtx_writer): Likewise.
Thomas Schwinge [Tue, 31 Aug 2021 21:30:25 +0000 (23:30 +0200)]
Generalize 'gcc/input.h:struct location_hash'
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'.
Aldy Hernandez [Tue, 9 Nov 2021 09:43:25 +0000 (10:43 +0100)]
Cleanup path solver dumps.
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.
Aldy Hernandez [Tue, 9 Nov 2021 09:14:25 +0000 (10:14 +0100)]
Remove TDF_THREADING flag in favor of param.
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=.
Thomas Schwinge [Tue, 9 Nov 2021 09:55:15 +0000 (10:55 +0100)]
Get rid of infinite recursion for 'typedef' used with GTY-marked '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.
Przemyslaw Wirkus [Tue, 9 Nov 2021 09:40:05 +0000 (09:40 +0000)]
arm: add armv9-a architecture to -march
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.
Martin Jambor [Tue, 9 Nov 2021 10:32:20 +0000 (11:32 +0100)]
ipa: Fix segfault when remapping debug_binds with expressions (PR 103132)
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.
Ghjuvan Lacambre [Tue, 2 Nov 2021 10:32:24 +0000 (11:32 +0100)]
[Ada] Fix Codepeer warning
gcc/ada/
* freeze.adb (Check_Inherited_Conditions): Initialize
Ifaces_List.
Eric Botcazou [Wed, 27 Oct 2021 21:51:07 +0000 (23:51 +0200)]
[Ada] Tidy up implementation of Has_Compatible_Type
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.
Justin Squirek [Fri, 29 Oct 2021 19:42:28 +0000 (15:42 -0400)]
[Ada] Invalid GPR_PROJECT_PATH_FILE confuses gnatls
gcc/ada/
* gnatls.adb (Initialize_Default_Project_Path): Remove early
abort on invalid path.
Eric Botcazou [Mon, 1 Nov 2021 09:30:51 +0000 (10:30 +0100)]
[Ada] Print Storage_Pool and Procedure_To_Call fields
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.
Patrick Bernardi [Thu, 28 Oct 2021 22:05:16 +0000 (18:05 -0400)]
[Ada] Do not indicate a pending abort if the task is already aborting
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.
Patrick Bernardi [Thu, 28 Oct 2021 19:05:17 +0000 (15:05 -0400)]
[Ada] RTEMS: use atomic primitive packages on aarch64
gcc/ada/
* Makefile.rtl: Add ATOMICS_TARGET_PAIRS and
ATOMICS_BUILTINS_TARGET_PAIRS to LIBGNAT_TARGET_PAIRS for
aarch64-rtems.
Justin Squirek [Sat, 30 Oct 2021 03:43:38 +0000 (23:43 -0400)]
[Ada] Hang on compilation of unit with type extension in body
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.
Justin Squirek [Fri, 29 Oct 2021 20:40:17 +0000 (16:40 -0400)]
[Ada] Crash on expansion of tagged membership test
gcc/ada/
* exp_ch4.adb (Tagged_Membership): Use corresponding record type
when expanding a tagged membership test on protected types.
Alexandre Oliva [Wed, 27 Oct 2021 21:26:27 +0000 (18:26 -0300)]
[Ada] Improve integration of strub with type systems
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.
Etienne Servais [Fri, 29 Oct 2021 10:32:11 +0000 (12:32 +0200)]
[Ada] Initialize Current_Source_Unit
gcc/ada/
* sinput.ads: Initialize Current_Source_Unit to No_Unit.
Piotr Trojanek [Wed, 27 Oct 2021 11:33:53 +0000 (13:33 +0200)]
[Ada] Use atomics in runtime on ARM and Aarch64 VxWorks
gcc/ada/
* Makefile.rtl (ARM and Aarch64 VxWorks): Use atomic variants of
runtime units.
* libgnat/a-strunb__shared.ads: Mention AARCH64 and ARM as
supported.
* libgnat/s-atocou.ads: Likewise.
Ghjuvan Lacambre [Wed, 27 Oct 2021 11:26:38 +0000 (13:26 +0200)]
[Ada] Accessibility fix
gcc/ada/
* sem_util.adb (Accessibility_Level): Use init_proc_level_formal
instead of computing a new accessibility level from Scope_Depth
(E).
Johannes Kliemann [Mon, 25 Oct 2021 13:53:59 +0000 (13:53 +0000)]
[Ada] Add gcc specs with vxworks7 base addresses for cert
gcc/ada/
* vxworks7-cert-rtp-link.spec: Replace the definition of
__wrs_rtp_base with the base_link spec.
* vxworks7-cert-rtp-base-link.spec: Add base_link spec with
__wrs_rtp_base definition for all architectures.
* vxworks7-cert-rtp-base-link__ppc64.spec: Add base_link spec
with __wrs_rtp_base definition for ppc64.
* vxworks7-cert-rtp-base-link__x86.spec: Add base_link spec with
__wrs_rtp_base definition for x86.
* vxworks7-cert-rtp-base-link__x86_64.spec: Add base_link spec
with __wrs_rtp_base definition for x86_64.
Piotr Trojanek [Wed, 27 Oct 2021 18:58:37 +0000 (20:58 +0200)]
[Ada] Cleanup copying of parameter lists
gcc/ada/
* sem_util.adb (Copy_Parameter_List): Refactor to remove
repeated calls to First_Formal.
Piotr Trojanek [Wed, 27 Oct 2021 18:43:24 +0000 (20:43 +0200)]
[Ada] Cleanup building of renamed equality
gcc/ada/
* exp_ch8.adb (Build_Body_For_Renaming): Remove unnecessary
calls to Sloc; set Handled_Statement_Sequence when building
subprogram body; whitespace cleanup.
Piotr Trojanek [Wed, 27 Oct 2021 15:32:52 +0000 (17:32 +0200)]
[Ada] Refine type in expansion of array equality
gcc/ada/
* exp_ch4.adb (Handle_One_Dimension): Parameter N must be always
positive, because it is translated into expression of 'First and
'Last.
Piotr Trojanek [Wed, 27 Oct 2021 14:34:20 +0000 (16:34 +0200)]
[Ada] Simplify building of entity occurrences
gcc/ada/
* tbuild.adb (New_Occurrence_Of): Simplify by reusing
Make_Identifier.
Etienne Servais [Tue, 26 Oct 2021 16:08:47 +0000 (18:08 +0200)]
[Ada] Return a valid value when handling Constraint_Error
gcc/ada/
* scng.adb (Set_Start_Column): Return Column_Number'Last when
handling Constraint_Error. Plus reformat a strangely 7 level if
loop.
Piotr Trojanek [Tue, 26 Oct 2021 16:05:43 +0000 (18:05 +0200)]
[Ada] Simplify expansion of array equality
gcc/ada/
* exp_ch4.adb (Test_Empty_Arrays): Simplify with Evolve_Or_Else;
remove unnecessary call to Relocate_Node.
(Test_Lengths_Correspond): Likewise.
Piotr Trojanek [Wed, 27 Oct 2021 08:33:32 +0000 (10:33 +0200)]
[Ada] Reference in Unbounded_String is almost never null
gcc/ada/
* libgnat/a-strunb.adb (Deallocate): Rename Reference_Copy to
Old, to make the code similar to other routines in this package.
(Realloc_For_Chunk): Use a temporary, deallocate the previous
string using a null-allowing copy of the string reference.
Ghjuvan Lacambre [Wed, 27 Oct 2021 08:26:00 +0000 (10:26 +0200)]
[Ada] sem_util.adb: fix typos in Accessibility_Level docs
gcc/ada/
* sem_util.adb (Accessibility_Level): Fix typos.
Tom Tromey [Wed, 6 Oct 2021 20:11:24 +0000 (14:11 -0600)]
[Ada] Document the SuSE kernel bug
gcc/ada/
* doc/gnat_ugn/platform_specific_information.rst: Document the
SuSE kernel bug.
* gnat_ugn.texi: Regenerate.
Gary Dismukes [Tue, 26 Oct 2021 00:45:50 +0000 (20:45 -0400)]
[Ada] Errors on globals in expressions of predicate aspects in generic bodies
gcc/ada/
* sem_ch13.adb (Freeze_Entity_Checks): Analyze the expression of
a pragma Predicate associated with an aspect at the freeze point
of the type, to ensure that references to globals get saved when
the aspect occurs within a generic body. Also, add
Aspect_Static_Predicate to the choices of the membership test of
the enclosing guard.
Piotr Trojanek [Tue, 26 Oct 2021 15:57:59 +0000 (17:57 +0200)]
[Ada] Tune comment about expansion of array equality
gcc/ada/
* exp_ch4.adb (Arr_Attr): Refine type of the parameter from Int
to Pos; refine name of the parameter from Num to Dim; fix
reference to "Expr" in comment.
Steve Baird [Thu, 21 Oct 2021 17:47:06 +0000 (10:47 -0700)]
[Ada] Add missing regular expression syntax error check
gcc/ada/
* libgnat/s-regexp.adb (Compile.Check_Well_Formed_Patern): When
a "|" operator is encountered in a pattern, check that it is not
the last character of the pattern.
Yannick Moy [Tue, 26 Oct 2021 10:21:40 +0000 (12:21 +0200)]
[Ada] Complete support for prefixed call on subtypes/derived types
gcc/ada/
* sem_ch3.adb (Analyze_Subtype_Declaration,
Derived_Type_Declaration): Initialize list of primitive
operations when Extensions_Allowed.
Piotr Trojanek [Mon, 25 Oct 2021 19:15:58 +0000 (21:15 +0200)]
[Ada] Fix detection of array aggregates with single others associations
gcc/ada/
* checks.adb (Apply_Constraint_Check): Guard against calling
Choices when the first association in an array aggregate is a
N_Iterated_Component_Association node.
Yannick Moy [Mon, 25 Oct 2021 10:48:22 +0000 (12:48 +0200)]
[Ada] Fix support for prefixed call with incomplete type declarations
gcc/ada/
* sem_ch3.adb (Analyze_Incomplete_Type_Decl): Add the missing
initialization.
Piotr Trojanek [Mon, 25 Oct 2021 14:33:24 +0000 (16:33 +0200)]
[Ada] Guard against illegal items in Global but not Depends
gcc/ada/
* sem_prag.adb (Check_Usage): Guard against calling Usage_Error
with illegal Item_Id. The intention to do this was already
described in the comment but not implemented.
Etienne Servais [Wed, 22 Sep 2021 15:20:27 +0000 (17:20 +0200)]
[Ada] Build activation chain for BIP only when needed
gcc/ada/
* exp_ch6.adb (Expand_Actuals): Add a condition to check for the
possibility of task.
Aldy Hernandez [Fri, 8 Oct 2021 13:54:23 +0000 (15:54 +0200)]
Convert strlen pass from evrp to ranger.
The following patch converts the strlen pass from evrp to ranger,
leaving DOM as the last remaining user.
No additional cleanups have been done. For example, the strlen pass
still has uses of VR_ANTI_RANGE, and the sprintf still passes around
pairs of integers instead of using a proper range. Fixing this
could further improve these passes.
Basically the entire patch is just adjusting the calls to range_of_expr
to include context. The previous context of si->stmt was mostly
empty, so not really useful ;-).
With ranger we are now able to remove the range calculation from
before_dom_children entirely. Just working with the ranger on-demand
catches all the strlen and sprintf testcases with the exception of
builtin-sprintf-warn-22.c which is due to a limitation of the sprintf
code. I have XFAILed the test and documented what the problem is.
On a positive note, these changes found two possible sprintf overflow
bugs in the C++ and Fortran front-ends which I have fixed below.
Tested on x86-64 Linux.
gcc/ChangeLog:
* tree-ssa-strlen.c (compare_nonzero_chars): Pass statement
context to ranger.
(get_addr_stridx): Same.
(get_stridx): Same.
(get_range_strlen_dynamic): Same.
(handle_builtin_strlen): Same.
(handle_builtin_strchr): Same.
(handle_builtin_strcpy): Same.
(maybe_diag_stxncpy_trunc): Same.
(handle_builtin_stxncpy_strncat): Same.
(handle_builtin_memcpy): Same.
(handle_builtin_strcat): Same.
(handle_alloc_call): Same.
(handle_builtin_memset): Same.
(handle_builtin_string_cmp): Same.
(handle_pointer_plus): Same.
(count_nonzero_bytes_addr): Same.
(count_nonzero_bytes): Same.
(handle_store): Same.
(fold_strstr_to_strncmp): Same.
(handle_integral_assign): Same.
(check_and_optimize_stmt): Same.
(class strlen_dom_walker): Replace evrp with ranger.
(strlen_dom_walker::before_dom_children): Remove evrp.
(strlen_dom_walker::after_dom_children): Remove evrp.
* gimple-ssa-warn-access.cc (maybe_check_access_sizes):
Restrict sprintf output.
gcc/cp/ChangeLog:
* ptree.c (cxx_print_xnode): Add more space to pfx array.
gcc/fortran/ChangeLog:
* misc.c (gfc_dummy_typename): Make sure ts->kind is
non-negative.
gcc/testsuite/ChangeLog:
* gcc.dg/tree-ssa/builtin-sprintf-warn-22.c: XFAIL.
Rasmus Villemoes [Fri, 5 Nov 2021 14:37:33 +0000 (15:37 +0100)]
libstdc++: only define _GLIBCXX_HAVE_TLS for VxWorks >= 6.6
According to
https://gcc.gnu.org/legacy-ml/gcc-patches/2008-03/msg01698.html, the
TLS support, including the __tls_lookup function, was added to VxWorks
in 6.6.
It certainly doesn't exist on our VxWorks 5 platform, but the fallback
code in eh_globals.cc using __gthread_key_create() etc. used to work
just fine.
libstdc++-v3/ChangeLog:
* config/os/vxworks/os_defines.h (_GLIBCXX_HAVE_TLS): Only
define for VxWorks >= 6.6.
Martin Liska [Tue, 9 Nov 2021 08:46:09 +0000 (09:46 +0100)]
Fix clang -Wcast-qual warning.
gcc/ChangeLog:
* genconditions.c (write_one_condition): Add const qualifier
to pointer casting.
Jeff Law [Tue, 9 Nov 2021 04:23:34 +0000 (23:23 -0500)]
Minor optimization of variable bit testing
gcc/
* match.pd: New pattern to simplify (1 << n) & M ==/!= 0 for M
being a power of 2.
gcc/testsuite
* gcc.dg/tree-ssa/bittest.c: New test
GCC Administrator [Tue, 9 Nov 2021 00:16:21 +0000 (00:16 +0000)]
Daily bump.
Bill Schmidt [Mon, 8 Nov 2021 21:08:59 +0000 (15:08 -0600)]
rs6000: Add escape-newline support for builtins files
2021-11-08 Bill Schmidt <wschmidt@linux.ibm.com>
gcc/
* config/rs6000/rs6000-builtin-new.def (VEC_INIT_V16QI): Use
escape-newline support.
(VEC_INIT_V4SI): Likewise.
(VEC_INIT_V8HI): Likewise.
(PACK_V1TI): Likewise.
(DIVDEU): Likewise.
(VFIRSTMISMATCHOREOSINDEX_V16QI): Likewise.
(VFIRSTMISMATCHOREOSINDEX_V8HI): Likewise.
(VFIRSTMISMATCHOREOSINDEX_V4SI): Likewise.
(CMPRB2): Likewise.
(VSTDCP): Likewise.
(VSIEDP): Likewise.
(FMAF128_ODD): Likewise.
(VSCEQPUO): Likewise.
(VSIEQP): Likewise.
(VSIEQPF): Likewise.
(VSTDCQP): Likewise.
(PACK_TD): Likewise.
(TABORTDC): Likewise.
(TABORTDCI): Likewise.
(SE_LXVRBX): Likewise.
(SE_LXVRHX): Likewise.
(SE_LXVRWX): Likewise.
(SE_LXVRDX): Likewise.
(VREPLACE_UN_UV2DI): Likewise.
(VREPLACE_UN_UV4SI): Likewise.
(VREPLACE_UN_V2DI): Likewise.
(VREPLACE_ELT_UV2DI): Likewise.
(VREPLACE_ELT_V2DI): Likewise.
(ZE_LXVRBX): Likewise.
(ZE_LXVRHX): Likewise.
(ZE_LXVRWX): Likewise.
(ZE_LXVRDX): Likewise.
(CFUGED): Likewise.
(CNTLZDM): Likewise.
(CNTTZDM): Likewise.
(PDEPD): Likewise.
(PEXTD): Likewise.
(PMXVBF16GER2): Likewise.
(PMXVBF16GER2_INTERNAL): Likewise.
(PMXVBF16GER2NN): Likewise.
(PMXVBF16GER2NN_INTERNAL): Likewise.
(PMXVBF16GER2NP): Likewise.
(PMXVBF16GER2NP_INTERNAL): Likewise.
(PMXVBF16GER2PN): Likewise.
(PMXVBF16GER2PN_INTERNAL): Likewise.
(PMXVBF16GER2PP): Likewise.
(PMXVBF16GER2PP_INTERNAL): Likewise.
(PMXVF16GER2): Likewise.
(PMXVF16GER2_INTERNAL): Likewise.
(PMXVF16GER2NN): Likewise.
(PMXVF16GER2NN_INTERNAL): Likewise.
(PMXVF16GER2NP): Likewise.
(PMXVF16GER2NP_INTERNAL): Likewise.
(PMXVF16GER2PN): Likewise.
(PMXVF16GER2PN_INTERNAL): Likewise.
(PMXVF16GER2PP): Likewise.
(PMXVF16GER2PP_INTERNAL): Likewise.
(PMXVF32GER_INTERNAL): Likewise.
(PMXVF32GERNN): Likewise.
(PMXVF32GERNN_INTERNAL): Likewise.
(PMXVF32GERNP): Likewise.
(PMXVF32GERNP_INTERNAL): Likewise.
(PMXVF32GERPN): Likewise.
(PMXVF32GERPN_INTERNAL): Likewise.
(PMXVF32GERPP): Likewise.
(PMXVF32GERPP_INTERNAL): Likewise.
(PMXVF64GER): Likewise.
(PMXVF64GER_INTERNAL): Likewise.
(PMXVF64GERNN): Likewise.
(PMXVF64GERNN_INTERNAL): Likewise.
(PMXVF64GERNP): Likewise.
(PMXVF64GERNP_INTERNAL): Likewise.
(PMXVF64GERPN): Likewise.
(PMXVF64GERPN_INTERNAL): Likewise.
(PMXVF64GERPP): Likewise.
(PMXVF64GERPP_INTERNAL): Likewise.
(PMXVI16GER2): Likewise.
(PMXVI16GER2_INTERNAL): Likewise.
(PMXVI16GER2PP): Likewise.
(PMXVI16GER2PP_INTERNAL): Likewise.
(PMXVI16GER2S): Likewise.
(PMXVI16GER2S_INTERNAL): Likewise.
(PMXVI16GER2SPP): Likewise.
(PMXVI16GER2SPP_INTERNAL): Likewise.
(PMXVI4GER8): Likewise.
(PMXVI4GER8_INTERNAL): Likewise.
(PMXVI4GER8PP): Likewise.
(PMXVI4GER8PP_INTERNAL): Likewise.
(PMXVI8GER4): Likewise.
(PMXVI8GER4_INTERNAL): Likewise.
(PMXVI8GER4PP): Likewise.
(PMXVI8GER4PP_INTERNAL): Likewise.
(PMXVI8GER4SPP): Likewise.
(PMXVI8GER4SPP_INTERNAL): Likewise.
* config/rs6000/rs6000-gen-builtins.c (MAXLINES): New macro.
(linebuf): Increase size.
(lines): New variable.
(lastline): Likewise.
(real_line_pos): New function.
(diag): Change signature.
(bif_diag): Change signature; support escape-newline handling.
(ovld_diag): Likewise.
(fatal): Move earlier.
(consume_whitespace): Adjust diag call.
(advance_line): Add escape-newline handling; call fatal.
(safe_inc_pos): Adjust diag call.
(match_identifier): Likewise.
(match_integer): Likewise.
(match_to_right_bracket): Call fatal instead of diag; adjust diag
call.
(match_basetype): Adjust diag calls.
(match_bracketed_pair): Likewise.
(match_const_restriction): Likewise.
(match_type): Likewise.
(parse_args): Likewise.
(parse_bif_attrs): Likewise.
(complete_vector_type): Likewise.
(complete_base_type): Likewise.
(parse_prototype): Likewise.
(parse_bif_entry): Likewise.
(parse_bif_stanza): Likewise.
(parse_ovld_entry): Likewise.
(parse_ovld_stanza): Likewise.
(main): Allocate buffers for lines[].
Eric Botcazou [Mon, 8 Nov 2021 21:09:16 +0000 (22:09 +0100)]
Fix couple of issues in large PIC model on x86-64/VxWorks
The first issue is that the !gotoff_operand path of legitimize_pic_address
in the large PIC model does not make use of REG when it is available, which
breaks for thunks because new pseudo-registers can no longer be created.
And the second issue is that the system compiler (LLVM) generates @GOTOFF
in large model even for RTP, so we do the same.
gcc/
* config/i386/i386.c (legitimize_pic_address): Adjust comment and
use the REG argument on the CM_LARGE_PIC code path as well.
* config/i386/predicates.md (gotoff_operand): Do not treat VxWorks
specially with the large code models.
Jan Hubicka [Mon, 8 Nov 2021 17:58:03 +0000 (18:58 +0100)]
Remove workaround allowing interposition of nested functions.
* gimple.c (gimple_call_static_chain_flags): Revert the workaround
allowing interposition since issues with binds_to_local_def were
hopefully solved.
Andrew MacLeod [Mon, 8 Nov 2021 14:32:42 +0000 (09:32 -0500)]
Don't calculate new values when using the private context callback.
When using rangers private callback mechanism to provide context
to fold_stmt calls, we are only suppose to be using the cache in read
only mode, never calculate new values.
gcc/
PR tree-optimization/103122
* gimple-range.cc (gimple_ranger::range_of_expr): Request the cache
entry with "calulate new values" set to false.
gcc/testsuite/
* g++.dg/pr103122.C: New.