Hi.
CPP/CPPFLAGS were changed by commit 84401ce5fb. That commit uses CPP as a default for CPP_FOR_BUILD. Unless CPP is defined, GNU make defaults CPP as `$(CC) -E'. Given the context, this is now incorrect, since CC_FOR_BUILD should be used.
Fixes PR103011.
-- Pekka
gcc/Changelog:
* configure: Regenerate.
* configure.ac: For CPP_FOR_BUILD use $(CC_FOR_BUILD) -E instead of
$(CPP).
musl only uses PT_GNU_STACK to set default thread stack size and has no
executable stack support[0], so there is no reason not to emit the
.note.GNU-stack section on musl builds.
[0]: https://lore.kernel.org/all/20190423192534.GN23599@brightrain.aerifal.cx/T/#u
gcc
* configure: Regenerate.
* configure.ac: Define TARGET_LIBC_GNUSTACK on musl.
We need to revise the PCH memory allocation scheme to enable
support for PIE on aarch64. The rewrite uses a similar scheme
to the one used on Linux.
We attempt to identify VM segments for each arch/OS version that
are always available to the compiler (note this is not general,
it only needs to work for the cc1* exes).
If we cannot find the preferred segment we fall back to allowing
the kernel to supply one - this is more likely to fail when the
PCH read-in occurs (but that is trapped).
In doing this we obviate the need to unmap any part of the
compiler __DATA segment - thus fixing PR 55610.
Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
gcc/ChangeLog:
PR target/55610
* config/host-darwin.c (TRY_EMPTY_VM_SPACE,
SAFE_ALLOC_SIZE): New.
(darwin_gt_pch_get_address): Rewrite to use nominated
memory segments rather than part of the compiler __DATA
segment.
(darwin_gt_pch_use_address): Likewise.
FreeBSD 1 and FreeBSD 2, both still a.out, have been end of life for
over two decades and GCC has not been supporting them for ages, too,
so simply remove references.
gcc:
* doc/install.texi (*-*-freebsd*): Remove references to
FreeBSD 1 and FreeBSD 2.
Switch off long long variant overflow code by preprocessor if the
build compiler has __builtin_smul_overflow.
gcc/ChangeLog:
PR rtl-optimization/103437
* ira-color.c (setup_allocno_priorities): Switch off backup code
for overflow if compiler has __builtin_smul_overflow. Use <
for comparison with -INT_MAX.
The move constructor for the fully-dynamic std::basic_string was not
noexcept until recently, so the std::logic_error and std::runtime_error
move constructors were defined to make non-throwing copies of their
string members, instead of potentially-throwing moves.
Now that move construction is always noexecpt, the exception classes can
always move the string. The fully-dynamic string move assignment was
always noexcept, so I don't know why I special-cased the move assignment
operators of the exception classes. That can be changed too.
libstdc++-v3/ChangeLog:
* src/c++11/cow-stdexcept.cc [_GLIBCXX_FULY_DYNAMIC_STRING]
(logic_error, runtime_error): Remove custom definitions.
The bitmap_allocator, __mt_alloc and __pool_alloc extensions are no
longer suitable for use as the base class of std::allocator, because
they have not been updated to meet the C++20 requirements. There is a
patch attached to PR 103340 which addresses that, but more work would be
needed to solve the linking errors that occur when the library is
configured to use them.
Using --enable-libstdcxx-allocator=bitmap wouldn't even bootstrap for
the past few years, and I can't find any gcc-testresults reports using
any of these allocators. This patch removes the configure option to use
these as the std::allocator base class. The allocators are still in the
tree and can be used directly, you just can't configure the library to
use one of them as the base class of std::allocator.
libstdc++-v3/ChangeLog:
PR libstdc++/103340
PR libstdc++/103400
PR libstdc++/103381
* acinclude.m4 (GLIBCXX_ENABLE_ALLOCATOR): Remove mt, bitmap
and pool options.
* configure: Regenerate.
* config/allocator/bitmap_allocator_base.h: Removed.
* config/allocator/mt_allocator_base.h: Removed.
* config/allocator/pool_allocator_base.h: Removed.
* doc/xml/manual/allocator.xml: Update.
* doc/xml/manual/configure.xml: Update.
* doc/xml/manual/evolution.xml: Document removal.
* doc/xml/manual/mt_allocator.xml: Editorial tweaks.
* doc/html/manual/*: Regenerate.
The relaxed load is already optimal, checking the __single_threaded
global before doing a non-atomic load isn't an optimization.
libstdc++-v3/ChangeLog:
* include/bits/cow_string.h (basic_string::_M_is_leaked()):
Revert change to check __is_single_threaded() before using
atomic load.
This patch enables the new built-in infastructure for the Power back end.
To avoid any patches causing regressions that would affect bisection, this is a
combined patch that also includes all the test suite changes and the necessary
modifications to altivec.h. The patches included here are the following:
https://gcc.gnu.org/pipermail/gcc-patches/2021-November/584638.htmlhttps://gcc.gnu.org/pipermail/gcc-patches/2021-September/578613.htmlhttps://gcc.gnu.org/pipermail/gcc-patches/2021-November/584829.htmlhttps://gcc.gnu.org/pipermail/gcc-patches/2021-September/578614.html
The third of these four was broken up into multiple patches for review, but
effectively all pieces of it were accepted after an independent patch that
modified the error handling for overloaded builtins.
2021-12-02 Bill Schmidt <wschmidt@linux.ibm.com>
gcc/
* config/rs6000/altivec.h: Delete a number of #defines that are now
superfluous. Alphabetize. Include rs6000-vecdefines.h. Include some
synonyms.
* config/rs6000/rs6000-builtin-new.def (CMPB): Flag as no32bit.
(BPERMD): Flag as 32bit (needing special handling for 32-bit).
(UNPACK_TD): Return unsigned long long instead of unsigned long.
(GET_TEXASR): Return unsigned long instead of unsigned long long.
(GET_TEXASRU): Likewise.
(GET_TFHAR): Likewise.
(GET_TFIAR): Likewise.
(SET_TEXASR): Pass unsigned long instead of unsigned long long.
(SET_TEXASRU): Likewise.
(SET_TFHAR): Likewise.
(SET_TFIAR): Likewise.
(TABORTDC): Likewise.
(TABORTDCI): Likewise.
* config/rs6000/rs6000-call.c (rs6000_expand_new_builtin): Fix error
handling for no32bit. Add 32bit handling for RS6000_BIF_BPERMD.
* config/rs6000/rs6000-gen-builtins.c (write_init_file): Initialize
new_builtins_are_live to 1.
gcc/testsuite/
* gcc.target/powerpc/bfp/scalar-extract-exp-2.c: Adjust expected error
message.
* gcc.target/powerpc/bfp/scalar-extract-sig-2.c: Likewise.
* gcc.target/powerpc/bfp/scalar-insert-exp-2.c: Likewise.
* gcc.target/powerpc/bfp/scalar-insert-exp-5.c: Likewise.
* gcc.target/powerpc/bfp/scalar-insert-exp-8.c: Likewise.
* gcc.target/powerpc/bfp/scalar-test-neg-2.c: Likewise.
* gcc.target/powerpc/bfp/scalar-test-neg-3.c: Likewise.
* gcc.target/powerpc/bfp/scalar-test-neg-5.c: Likewise.
* gcc.target/powerpc/byte-in-set-2.c: Likewise.
* gcc.target/powerpc/cmpb-2.c: Likewise.
* gcc.target/powerpc/cmpb-3.c: Likewise.
* gcc.target/powerpc/cmpb32-2.c: Likewise.
* gcc.target/powerpc/crypto-builtin-2.c: Likewise.
* gcc.target/powerpc/fold-vec-splat-floatdouble.c: Remove invalid
test and adjust xxpermdi count.
* gcc.target/powerpc/fold-vec-splat-longlong.c: Remove invalid
tests and adjust instruction counts.
* gcc.target/powerpc/fold-vec-splat-misc-invalid.c: Adjust expected
error messages.
* gcc.target/powerpc/int_128bit-runnable.c: Adjust instruction counts.
* gcc.target/powerpc/pr80315-1.c: Adjust expected error message.
* gcc.target/powerpc/pr80315-2.c: Likewise.
* gcc.target/powerpc/pr80315-3.c: Likewise.
* gcc.target/powerpc/pr80315-4.c: Likewise.
* gcc.target/powerpc/pr88100.c: Likewise.
* gcc.target/powerpc/pragma_misc9.c: Likewise.
* gcc.target/powerpc/pragma_power8.c: Undef _RS6000_VECDEFINES_H.
* gcc.target/powerpc/pragma_power9.c: Likewise.
* gcc.target/powerpc/test_fpscr_drn_builtin_error.c: Adjust expected
error messages.
* gcc.target/powerpc/test_fpscr_rn_builtin_error.c: Likewise.
* gcc.target/powerpc/vec-gnb-2.c: Likewise.
* gcc.target/powerpc/vsu/vec-all-nez-7.c: Likewise.
* gcc.target/powerpc/vsu/vec-any-eqz-7.c: Likewise.
* gcc.target/powerpc/vsu/vec-cmpnez-7.c: Likewise.
* gcc.target/powerpc/vsu/vec-cntlz-lsbb-2.c: Likewise.
* gcc.target/powerpc/vsu/vec-cnttz-lsbb-2.c: Likewise.
* gcc.target/powerpc/vsu/vec-xl-len-13.c: Likewise.
* gcc.target/powerpc/vsu/vec-xst-len-12.c: Likewise.
gcc/ada/
* gcc-interface/gigi.h (aggregate_type_contains_array_p): Delete.
(type_has_variable_size): Declare.
* gcc-interface/decl.c (adjust_packed): Return 0 only if the field
type is an array with variable size.
* gcc-interface/utils.c (aggregate_type_contains_array_p): Make
static and remove SELF_REFERENTIAL parameter.
(type_has_variable_size): Make public.
(create_field_decl): Adjust call to aggregate_type_contains_array_p.
gcc/ada/
* libgnat/s-arit32.adb: Add ghost instances and lemmas.
(Scaled_Divide32): Add ghost code to prove. Minor code
modification to return early in error when divisor is zero.
* libgnat/s-arit32.ads: Add ghost instances and utilities.
(Scaled_Divide32): Add contract.
gcc/ada/
* libgnat/s-aridou.adb (Log_Single_Size, Big_0): New ghost
constants.
(Lemma_Mult_Non_Negative, Lemma_Mult_Non_Positive,
Lemma_Not_In_Range_Big2xx64): New lemmas on big integers.
(Double_Divide): Remove justifications. Amend for that local
lemma Prove_Overflow_Case.
(Scaled_Divide): Remove justifications. Insert for that local
lemmas Prove_Negative_Dividend, Prove_Positive_Dividend and
Prove_Q_Too_Big, and amend local lemma Prove_Overflow. To prove
the loop invariant on (Shift mod 2 = 0), introduce local ghost
variable Iter to count loop iterations, and relate its value to
the value of Shift through Log_Single_Size, with the help of
local lemma Prove_Power. Deal with proof regression by adding
new local lemma Prove_First_Iteration and local ghost variable
D123.
* libgnat/s-arit64.ads (Multiply_With_Ovflo_Check64): Remove
unnecessary Pure_Function on function as package is Pure.
gcc/ada/
* doc/gnat_rm/standard_and_implementation_defined_restrictions.rst
(No_Dispatching_Calls): Fix whitespace in example code.
* gnat_rm.texi: Regenerate.
* exp_ch13.adb (Expand_N_Freeze_Entity): Replace low-level
membership test with a high-level wrapper.
* exp_ch3.adb (Expand_Freeze_Record_Type): Remove unnecessary
initialization of list of wrapper declarations and unnecessary
guard for list of their bodies (if no bodies are created then
Append_Freeze_Actions is a no-op).
gcc/ada/
* sem_ch12.adb (Freeze_Package_Instance): Consistently consider
the freeze node of the parent and use large inequality for
Slocs.
(Freeze_Subprogram_Instance): Likewise.
(Insert_Freeze_Node_For_Instance): For an instance in a package
spec with no source body that immediately follows, consider the
body of the package for the placement of the freeze node and go
to the outer level if there is no such body.
gcc/ada/
* exp_ch13.ads (Expand_N_Freeze_Entity): Add note about a SPARK
twin.
* exp_ch3.ads (Freeze_Type): Likewise.
* exp_spark.adb (Expand_SPARK_N_Freeze_Entity): Mimic what is
done in Freeze_Entity.
(SPARK_Freeze_Type): Mimic what is done in Freeze_Type; add call
to Make_Predefined_Primitive_Eq_Spec.
gcc/ada/
* exp_ch3.adb (Make_Predefined_Primitive_Specs): Move code for
spec of dispatching equality.
(Predefined_Primitive_Bodies): Move code for body if dispatching
equality.
(Make_Predefined_Primitive_Eq_Spec): Separated code for spec of
dispatching equality.
(Predefined_Primitive_Eq_Body): Separated code for body of
dispatching equality.
* exp_ch3.ads: Update.
gcc/ada/
* libgnat/s-valuti.ads (Scan_Natural_Ghost): Split body from
spec and put it into private part, so that GNATprove can pick it
both when analysing the unit and its clients.
gcc/ada/
* freeze.adb (Freeze_Entity): Replace First_Entity/Next_Entity
with First_Component/Next_Component; remove condition with Ekind
equal to E_Component.
* sem_ch13.adb (Check_Record_Representation_Clause): Likewise
for component-or-discriminant.
* sem_util.adb (Is_Fully_Initialized_Type): Likewise; rename Ent
to a more specific Comp.
* sem_warn.adb (Check_References): Likewise.
gcc/ada/
* sem_warn.adb (Warn_On_Unassigned_Out_Parameter): Move inner
loop at the beginning of subprogram, so it is executed only
once; fix order in the "add an ad hoc" phrase.
gcc/ada/
* libgnat/i-c.adb: Add ghost code.
(C_Length_Ghost): New ghost functions to query the C length of a
string.
(To_Ada): Insert constant Count_Cst where needed to comply with
SPARK. Homogeneize code between variants for char, wchar_t,
char16_t and char32_t. Use char16_nul and char32_nul
systematically instead of their value. Fix the type of index To
to be Integer instead of Positive, to avoid a possible range
check failure on an empty Target. Insert an exit statement to
avoid a possible overflow failure when the last index in Target
is Natural'Last (possibly on a small string as well).
* libgnat/i-c.ads: Add contracts.
(C_Length_Ghost): New ghost functions to query the C length of a
string.
* libgnat/s-os_lib.adb: Remove pragma Compiler_Unit_Warning
causing a spurious error during compilation of GNAT, as this
pragma is not needed anymore now that we bootstrap (stage1) with
the base compiler runtime.
gcc/ada/
* libgnat/s-valboo.adb (First_Non_Space_Ghost): Move to
utilities.
(Value_Boolean): Prefix call to First_Non_Space_Ghost.
* libgnat/s-valboo.ads (First_Non_Space_Ghost): Move to
utilities.
(Is_Boolean_Image_Ghost, Value_Boolean): Prefix call to
First_Non_Space_Ghost.
* libgnat/s-valuer.adb (Scan_Raw_Real): Adapt to change of
function Scan_Exponent to procedure.
* libgnat/s-valueu.adb (Scan_Raw_Unsigned): Adapt to change of
function Scan_Exponent to procedure.
* libgnat/s-valuti.adb (First_Non_Space_Ghost): Function moved
here.
(Last_Number_Ghost): New ghost query function.
(Scan_Exponent): Change function with side-effects into
procedure, to mark in SPARK. Prove procedure wrt contract.
Change type of local P to avoid possible range check failure (it
is not known whether this can be activated by callers).
(Scan_Plus_Sign, Scan_Sign): Change type of local P to avoid
possible range check failure. Add loop invariants and assertions
for proof.
(Scan_Trailing_Blanks): Add loop invariant.
(Scan_Underscore): Remove SPARK_Mode Off.
* libgnat/s-valuti.ads (First_Non_Space_Ghost): Function moved
here.
(Last_Number_Ghost, Only_Number_Ghost, Is_Natural_Format_Ghost,
Scan_Natural_Ghost): New ghost query functions.
(Scan_Plus_Sign, Scan_Sign, Scan_Exponent, Scan_Trailing_Blanks,
Scan_Underscore): Add functional contracts.
gcc/ada/
* libgnat/s-imgboo.adb: Mark in SPARK.
* libgnat/s-imgboo.ads: Mark in SPARK. Change from Pure to
Preelaborate unit in order to be able to depend on
System.Val_Bool.
(Image_Boolean): Functionally specify the result of the
procedure by calling System.Val_Bool.Value_Boolean on the
result.
* libgnat/s-valboo.adb: Mark in SPARK.
(First_Non_Space_Ghost): New ghost function.
(Value_Boolean): Change type of L and F to avoid possible range
check failure on empty Str.
* libgnat/s-valboo.ads: Mark in SPARK. Duplicate with-clause
from body in the spec to be able to call
System.Val_Util.Only_Space_Ghost in the contract.
(First_Non_Space_Ghost): New ghost function computing the first
non-space character in a string.
(Is_Boolean_Image_Ghost): New ghost function computing whether a
string is the image of a boolean value.
(Value_Boolean): Add in precondition the conditions to avoid
raising Constraint_Error. This precondition is never executed,
and only used in proof, thanks to the use of pragma
Assertion_Policy. Given that precondition, the postcondition can
simply check the first non-space character to decide whether
True or False is read.
* libgnat/s-valuti.adb: Mark in SPARK, but use SPARK_Mode Off on
all subprograms not yet proved.
(Bad_Value): Annotate expected exception.
(Normalize_String): Rewrite to avoid possible overflow when
incrementing F in the first loop. Add loop invariants.
* libgnat/s-valuti.ads: Mark in SPARK.
(Bad_Value): Add Depends contract to avoid warning on unused S.
(Only_Space_Ghost): New ghost function to query if string has
only space in the specified range.
(Normalize_String): Add functional contract.
(Scan_Exponent): Mark spec as not in SPARK as this function has
side-effects.
__builtin_smul_overflow can be unavailable for some C++ compilers.
Add long long multiplication as backup for overflow processing.
gcc/ChangeLog:
PR rtl-optimization/103437
* ira-color.c (setup_allocno_priorities): Use long long
multiplication as backup for overflow processing.
This is the library fix for PR103520 that also prevents the garbage
collector from releasing live memory. However this requires that the
host compiler has been patched with this fix, so the GC will remain
disabled in the D front-end for now until enough time has passed for
this to have trickled down into enough releases.
libphobos/ChangeLog:
* libdruntime/core/thread/osthread.d (callWithStackShell): Push all
callee-save registers on the stack for AArch64 and ARM.
This optimizes right shift rounding narrow instructions to
rounding add narrow high where one vector is 0 when the shift amount is half
that of the original input type.
i.e.
uint32x4_t foo (uint64x2_t a, uint64x2_t b)
{
return vrshrn_high_n_u64 (vrshrn_n_u64 (a, 32), b, 32);
}
now generates:
foo:
movi v3.4s, 0
raddhn v0.2s, v2.2d, v3.2d
raddhn2 v0.4s, v2.2d, v3.2d
instead of:
foo:
rshrn v0.2s, v0.2d, 32
rshrn2 v0.4s, v1.2d, 32
ret
On Arm cores this is an improvement in both latency and throughput.
Because a vector zero is needed I created a new method
aarch64_gen_shareable_zero that creates zeros using V4SI and then takes a subreg
of the zero to the desired type. This allows CSE to share all the zero
constants.
gcc/ChangeLog:
* config/aarch64/aarch64-protos.h (aarch64_gen_shareable_zero): New.
* config/aarch64/aarch64-simd.md (aarch64_rshrn<mode>,
aarch64_rshrn2<mode>): Generate rounding half-ing add when appropriate.
* config/aarch64/aarch64.c (aarch64_gen_shareable_zero): New.
gcc/testsuite/ChangeLog:
* gcc.target/aarch64/advsimd-intrinsics/shrn-1.c: New test.
* gcc.target/aarch64/advsimd-intrinsics/shrn-2.c: New test.
* gcc.target/aarch64/advsimd-intrinsics/shrn-3.c: New test.
* gcc.target/aarch64/advsimd-intrinsics/shrn-4.c: New test.
We process overflows in cost calculations but for huge functions
priority calculation can overflow as priority can be bigger the cost
used for it. The patch fixes the problem.
gcc/ChangeLog:
PR rtl-optimization/103437
* ira-color.c (setup_allocno_priorities): Process multiplication
overflow.
This updates the testcase bic-bitmask-18.c to seach for " = 0;" as an expression
so it doesn't match any other partial expressions.
gcc/testsuite/ChangeLog:
PR testsuite/103479
* gcc.dg/bic-bitmask-18.c: Update regexpr to expect = 0;.
Here we issue a bogus:
error: '(0 ? fake_tuple_size_v<int> : fake_tuple_size_v<int>)' is not a constant expression
because cxx_constant_value in expand_integer_pack gets
*(0 ? VIEW_CONVERT_EXPR<const int>(fake_tuple_size_v) : VIEW_CONVERT_EXPR<const int>(fake_tuple_size_v))
which is a REFERENCE_REF_P and we evaluate its operand to 3, so we end
up with *3 and that fails. Sounds like we need to get rid of the
REFERENCE_REF_P then. That is what tsubst_copy_and_build/INDIRECT_REF
will do:
if (REFERENCE_REF_P (t))
{
/* A type conversion to reference type will be enclosed in
such an indirect ref, but the substitution of the cast
will have also added such an indirect ref. */
r = convert_from_reference (r);
}
so I think it's reasonable to call instantiate_non_dependent_expr_sfinae.
PR c++/94490
gcc/cp/ChangeLog:
* pt.c (expand_integer_pack): Call
instantiate_non_dependent_expr_sfinae.
gcc/testsuite/ChangeLog:
* g++.dg/ext/integer-pack5.C: New test.