2
0
mirror of git://gcc.gnu.org/git/gcc.git synced 2025-03-22 10:10:59 +08:00

181718 Commits

Author SHA1 Message Date
Jakub Jelinek
049ce9d233 middle-end: __builtin_mul_overflow expansion improvements [PR95862]
The following patch adds some improvements for __builtin_mul_overflow
expansion.
One optimization is for the u1 * u2 -> sr case, as documented we normally
do:
     u1 * u2 -> sr
        res = (S) (u1 * u2)
        ovf = res < 0 || main_ovf (true)
where main_ovf (true) stands for jump on unsigned multiplication overflow.
If we know that the most significant bits of both operands are clear (such
as when they are zero extended from something smaller), we can
emit better coe by handling it like s1 * s2 -> sr, i.e. just jump on
overflow after signed multiplication.

Another two cases are s1 * s2 -> ur or s1 * u2 -> ur, if we know the minimum
precision needed to encode all values of both arguments summed together
is smaller or equal to destination precision (such as when the two arguments
are sign (or zero) extended from half precision types, we know the overflows
happen only iff one argument is negative and the other argument is positive
(not zero), because even if both have maximum possible values, the maximum
is still representable (e.g. for char * char -> unsigned short
0x7f * 0x7f = 0x3f01 and for char * unsigned char -> unsigned short
0x7f * 0xffU = 0x7e81) and as the result is unsigned, all negative results
do overflow, but are also representable if we consider the result signed
- all of them have the MSB set.  So, it is more efficient to just
do the normal multiplication in that case and compare the result considered
as signed value against 0, if it is smaller, overflow happened.

And the get_min_precision change is to improve the char to short handling,
we have there in the IL
  _2 = (int) arg_1(D);
promotion from C promotions from char or unsigned char arg, and the caller
adds a NOP_EXPR cast to short or unsigned short.  get_min_precision punts
on the narrowing cast though, it handled only widening casts, but we can
handle narrowing casts fine too, by recursing on the narrowing cast operands
and using it only if it has in the end smaller minimal precision, which
would duplicate the sign bits (or zero bits) to both the bits above the
narrowing conversion and also at least one below that.

2020-10-25  Jakub Jelinek  <jakub@redhat.com>

	PR rtl-optimization/95862
	* internal-fn.c (get_min_precision): For narrowing conversion, recurse
	on the operand and if the operand precision is smaller than the
	current one, return that smaller precision.
	(expand_mul_overflow): For s1 * u2 -> ur and s1 * s2 -> ur cases
	if the sum of minimum precisions of both operands is smaller or equal
	to the result precision, just perform normal multiplication and
	set overflow to the sign bit of the multiplication result.  For
	u1 * u2 -> sr if both arguments have the MSB known zero, use
	normal s1 * s2 -> sr expansion.

	* gcc.dg/builtin-artih-overflow-5.c: New test.
2020-11-25 15:42:38 +01:00
Jan Hubicka
45281f120d Free more of CFG
* cfg.c (free_block): New function.
	(clear_edges): Rename to ....
	(free_cfg): ... this one; also free BBs and vectors.
	(expunge_block): Update comment.
	* cfg.h (clear_edges): Rename to ...
	(free_cfg): ... this one.
	* cgraph.c (release_function_body): Use free_cfg.
2020-11-25 15:05:41 +01:00
Richard Biener
fddc7f0080 middle-end/97579 - lower VECTOR_BOOLEAN_TYPE_P VEC_COND_EXPRs
This makes sure to lower VECTOR_BOOLEAN_TYPE_P typed non-vector
mode VEC_COND_EXPRs so we don't try to use vcond to expand those.
That's required for x86 and gcn integer mode boolean vectors.

2020-11-25  Richard Biener  <rguenther@suse.de>

	PR middle-end/97579
	* gimple-isel.cc (gimple_expand_vec_cond_expr): Lower
	VECTOR_BOOLEAN_TYPE_P, non-vector mode VEC_COND_EXPRs.

	* gcc.dg/pr97579.c: New testcase.
2020-11-25 15:01:17 +01:00
Andrew Stubbs
52ce50d6c5 Fix atomic_capture-1.f90 testcase
The testcase had invalid assumptions about which loop iterations would run
first and last.

libgomp/ChangeLog

	* testsuite/libgomp.oacc-fortran/atomic_capture-1.f90 (main): Adjust
	expected results.
2020-11-25 13:55:45 +00:00
Ed Schonberg
a46fa6510d [Ada] Further optimization with uninitialized aggregates
gcc/ada/

	* freeze.adb (Is_Uninitialized_Aggregate): Move...
	* exp_util.adb (Is_Uninitialized_Aggregate): ... here.
	(Expand_Subtype_From_Expr): If the expression is an
	uninitialized aggregate, capture subtype for declared object and
	remove expression to suppress further superfluous expansion.
2020-11-25 08:22:47 -05:00
Ed Schonberg
55fae09dcb [Ada] Spurious error on instance with predicated actual
gcc/ada/

	* sem_eval.adb (Subtypes_Statically_Compatible): Scalar types
	with compatible static bounds are statically compatible if
	predicates are compatible, even if they are not static subtypes.
	Same for private types without discriminants.
2020-11-25 08:22:46 -05:00
Eric Botcazou
57966b4d2f [Ada] Fix couple of minor issues with local exception propagation
gcc/ada/

	* exp_ch11.adb (Expand_N_Raise_Statement): Use Is_Entity_Name
	consistently in tests on the name of the statement.
	* exp_prag.adb (Expand_Pragma_Check): In the local propagation
	case, wrap the raise statement in a block statement.
2020-11-25 08:22:45 -05:00
Piotr Trojanek
7a17384884 [Ada] Remove shadowing by a nested subprogram parameter
gcc/ada/

	* exp_ch8.adb (Expand_N_Exception_Renaming_Declaration): Move
	"Nam" constant after the body of a nested subprogram; change "T"
	from variable to constant.
2020-11-25 08:22:44 -05:00
Piotr Trojanek
ea89e1c31e [Ada] Merge duplicated processing for gnatmake -u and -U switches
gcc/ada/

	* make.adb (Scan_Make_Arg): Merge ELSIF branches for -u and -U.
2020-11-25 08:22:43 -05:00
Piotr Trojanek
47c2b77ffb [Ada] Document attribute Has_Tagged_Values in GNAT RM
gcc/ada/

	* doc/gnat_rm/implementation_defined_attributes.rst
	(Has_Tagged_Values): Document based on the existing description
	of Has_Access_Type and the comment for Has_Tagged_Component,
	which is where frontend evaluates this attribute.
	* gnat_rm.texi: Regenerate.
	* sem_attr.adb (Analyze_Attribute): Merge processing of
	Has_Access_Type and Has_Tagged_Component attributes.
	* sem_util.adb (Has_Access_Type): Fix casing in comment.
	* sem_util.ads (Has_Tagged_Component): Remove wrong (or
	outdated) comment about the use of this routine to implement the
	equality operator.
2020-11-25 08:22:42 -05:00
Piotr Trojanek
14a16e30ca [Ada] Minor whitespace fix in expansion of attribute Size
gcc/ada/

	* exp_attr.adb (Expand_Size_Attribute): Remove whitespace;
	simplify with a membership test, which are now allowed in the
	frontend code.
2020-11-25 08:22:41 -05:00
Piotr Trojanek
52b9a264dd [Ada] Use hardcoded names when converting aspects to pragmas
gcc/ada/

	* sem_ch13.adb (Analyze_One_Aspect): Fix inconsistent calls to
	Make_Aitem_Pragma.
2020-11-25 08:22:40 -05:00
Piotr Trojanek
6d97121d2f [Ada] Reuse Is_Named_Number where possible
gcc/ada/

	* sem_ch13.adb (Check_Expr_Constants): Simplify with
	Is_Named_Number.
	* sem_prag.adb (Process_Convention): Likewise.
2020-11-25 08:22:39 -05:00
Piotr Trojanek
28488f5ff5 [Ada] Simplify aspect processing with membership tests
gcc/ada/

	* sem_ch13.adb (Analyze_One_Aspect): Detect aspect identifiers
	with membership tests.
	(Check_Aspect_At_End_Of_Declarations): Likewise.
	(Freeze_Entity_Checks): Likewise; a local constant is no longer
	needed.
	(Is_Operational_Item): Similar simplification for attribute
	identifiers.
	(Is_Type_Related_Rep_Item): Likewise.
	(Resolve_Iterable_Operation): Detect names with a membership
	test.
	(Validate_Independence): Replace repeated Ekind with a
	membership test.
2020-11-25 08:22:38 -05:00
Piotr Trojanek
a79039c0eb [Ada] Fix copy-paste mistake in diagnostics for aspect Effective_Writes
gcc/ada/

	* sem_ch13.adb (Analyze_One_Aspect): Replace duplicate of
	Effective_Reads.
2020-11-25 08:22:37 -05:00
Piotr Trojanek
ad26cae122 [Ada] Simplify Ekind tests with wrappers and membership tests
gcc/ada/

	* einfo.adb: Use composite wrappers (e.g.
	Is_Subprogram_Or_Entry) and membership tests where it appears to
	improve clarity.
2020-11-25 08:22:36 -05:00
Piotr Trojanek
49c4dd7a22 [Ada] Simplify Is_Standard_xxx_Type routines with membership tests
gcc/ada/

	* einfo.adb (Is_Standard_Character_Type,
	Is_Standard_String_Type): Simplify.
	(Last_Formal): Use procedural variant of Next_Formal.
2020-11-25 08:22:35 -05:00
Piotr Trojanek
a24033ec70 [Ada] Consistently use explicit Entity_Id type instead of alias
gcc/ada/

	* einfo.adb: Replace "E" with Entity_Id in local object
	declarations.
2020-11-25 08:22:34 -05:00
Steve Baird
eb0d08adb6 [Ada] Don't constant-fold renamed qualified expressions
gcc/ada/

	* exp_ch2.adb (Expand_Entity_Reference): A new local predicate
	Is_Object_Renaming_Name indicates whether a given expression
	occurs (after looking through qualified expressions and type
	conversions) as the name of an object renaming declaration. If
	Current_Value is available but this new predicate is True, then
	ignore the availability of Current_Value.
2020-11-25 08:22:34 -05:00
Piotr Trojanek
2d80df4233 [Ada] Remove dead and duplicated diagnostics for generic access types
gcc/ada/

	* sem_ch12.adb (Instantiate_Type): Remove extra whitespace.
	(Validate_Access_Type_Instance): Remove dead (and duplicated)
	code.
2020-11-25 08:22:33 -05:00
Gary Dismukes
595c9aebad [Ada] Remove hyphens in two cases of "side-effect" used as a noun
gcc/ada/

	* exp_util.adb (Possible_Side_Effect_In_SPARK): Replace hyphen
	with a space in "side-effect" (two instances).
2020-11-25 08:22:32 -05:00
Justin Squirek
e480bca240 [Ada] Crash on right shift operator for signed integers
gcc/ada/

	* doc/gnat_rm/intrinsic_subprograms.rst (Shifts and Rotates):
	Document behavior on negative numbers
	* gnat_rm.texi: Regenerate.
	* sem_eval.adb (Fold_Shift): Set modulus to be based on the RM
	size for non-modular integer types.
2020-11-25 08:22:31 -05:00
Olivier Hainque
4d617c3f2a [Ada] Reinstate utime based code for vx6 in __gnat_copy_attribs
gcc/ada/

	* adaint.c (__gnat_copy_attribs): Reinstate code based on utime
	for timestamp processing on VxWorks 6.
2020-11-25 08:22:30 -05:00
Yannick Moy
a6fecb0671 [Ada] Minimize side-effect removal in GNATprove mode
gcc/ada/

	* exp_util.adb (Remove_Side_Effects): Only remove side-effects
	in GNATprove mode when this is useful.
	* sem_res.adb (Set_Slice_Subtype): Make sure in GNATprove mode
	to define the Itype when needed, so that run-time errors can be
	analyzed.
	* sem_util.adb (Enclosing_Declaration): Correctly take into
	account renaming declarations.
2020-11-25 08:22:29 -05:00
Eric Botcazou
9d41d78b05 [Ada] Adjust support for 128-bit integer types in System.Random_Numbers
gcc/ada/

	* libgnat/s-rannum.adb (Random_Discrete): Specifically deal with
	the case where the size of the base type is larger than 64 bits.
2020-11-25 08:22:28 -05:00
Yannick Moy
a8c229e14c [Ada] Fix internal compilation error on circular type in SPARK code
gcc/ada/

	* sem_ch3.adb (Access_Type_Declaration): Set Etype before
	checking for volatility compatibility.
2020-11-25 08:22:28 -05:00
Eric Botcazou
6d88dbdc5e [Ada] Add support for 128-bit integer types to GNAT.Random_Numbers
gcc/ada/

	* libgnat/g-rannum.ads (Random): New functions returning 128-bit.
	* libgnat/g-rannum.adb (Random): Implement them and alphabetize.
	(To_Signed): New unchecked conversion function for 128-bit.
2020-11-25 08:22:27 -05:00
Arnaud Charlet
bbf14e1350 [Ada] Allow debugging finalization-related expanded code
gcc/ada/

	* exp_ch7.adb (Build_Finalization_Master, Build_Finalizer,
	Build_Object_Declarations, Make_Deep_Array_Body,
	Wrap_Transient_Expression): Call Set_Debug_Info_Needed on
	temporaries when Debug_Generated_Code is True.
2020-11-25 08:22:26 -05:00
Liaiss Merzougue
cf4737dcec [Ada] Unrecursify Set_Digit/Set_Image_Unsigned procedure
gcc/ada/

	* libgnat/s-imagei.adb
	(Set_Digits): Rewrite the procedure to remove recursion.
	(Image_Integer, Set_Image_Integer): Update assertions and remove
	redundant ones.
	* libgnat/s-imageu.adb
	(Set_Image_Unsigned): Rewrite the procedure to remove recursion.
2020-11-25 08:22:25 -05:00
Piotr Trojanek
6b0c5c7227 [Ada] Remove repeated calls to Attribute_Name
gcc/ada/

	* exp_util.adb (Attribute_Constrained_Static_Value): Fix body
	box.
	* sem_attr.adb (Eval_Attribute): Replace repeated calls to
	Attribute_Name with a captured value of the Attribute_Id; also,
	remove extra parens around Is_Generic_Type.
2020-11-25 08:22:24 -05:00
Ghjuvan Lacambre
193040a071 [Ada] Fix crash on invalid pragma Profile
gcc/ada/

	* sem_prag.adb (Analyze_Pragma): Emit error on wrong argument
	nkind.
2020-11-25 08:22:24 -05:00
Piotr Trojanek
868268a8ec [Ada] Reuse Is_Named_Number where possible
gcc/ada/

	* sem_attr.adb, sem_prag.adb: Use Is_Named_Number.
2020-11-25 08:22:23 -05:00
Piotr Trojanek
90cb252f5f [Ada] Fix style and typos in code for expanding attribute references
gcc/ada/

	* exp_attr.adb, exp_util.adb: Fix style and typos in comments.
2020-11-25 08:22:22 -05:00
Piotr Trojanek
97a26d19d2 [Ada] Minor refine type of a counter variable
gcc/ada/

	* exp_attr.adb (Expand_N_Attribute_Reference): A variable that
	is only incremented in the code has now type Nat; conversion is
	now unnecessary.
2020-11-25 08:22:21 -05:00
Stam Markianos-Wright
bc771e6c3a arm: Add test that was missing from old commit [PR91816]
A while back I submitted GCC10 commit:

 44f77a6dea2f312ee1743f3dde465c1b8453ee13

for PR91816.

Turns out I was an idiot and forgot to include the test in the actual git commit.

Tested that the test still passes on a cross arm-none-eabi and also in a
Cortex A-15 bootstrap with no regressions.

gcc/testsuite/ChangeLog:
	PR target/91816
	* gcc.target/arm/pr91816.c: New test.
2020-11-25 12:59:19 +00:00
Jonathan Wakely
a5ccfd0460 libstdc++: Fix silly typos [PR 97936]
libstdc++-v3/ChangeLog:

	PR libstdc++/97936
	* include/bits/atomic_wait.h (__platform_wait): Check errno,
	not just the value of EAGAIN.
	(__waiters::__waiters()): Fix name of data member.
2020-11-25 12:16:07 +00:00
Jonathan Wakely
ad9cbcee54 libstdc++: Fix handling of futex wake [PR 97936]
The __platform_wait function is supposed to wait until *addr != old.
The futex syscall checks the initial value and returns EAGAIN if *addr
!= old is already true, which should cause __platform_wait to return.
Instead it loops and keeps doing a futex wait, which keeps returning
EAGAIN.

libstdc++-v3/ChangeLog:

	PR libstdc++/97936
	* include/bits/atomic_wait.h (__platform_wait): Return if futex
	sets EAGAIN.
	* testsuite/30_threads/latch/3.cc: Re-enable test.
	* testsuite/30_threads/semaphore/try_acquire_until.cc: Likewise.
2020-11-25 10:31:55 +00:00
Jakub Jelinek
a7285c8659 middle-end: Reject flexible array members in __builtin_clear_padding [PR97943]
As mentioned in the PR, we currently ICE on flexible array members in
structs and unions during __builtin_clear_padding processing.

Jason said in the PR he'd prefer an error in these cases over forcefully
handling it as [0] arrays (everything is padding then) or consider the
arrays to have as many whole elements as would fit into the tail padding.

So, this patch implements that.

2020-11-25  Jakub Jelinek  <jakub@redhat.com>

	PR middle-end/97943
	* gimple-fold.c (clear_padding_union, clear_padding_type): Error on and
	ignore flexible array member fields.  Ignore fields with
	error_mark_node type.

	* c-c++-common/builtin-clear-padding-2.c: New test.
	* c-c++-common/builtin-clear-padding-3.c: New test.
	* g++.dg/ext/builtin-clear-padding-1.C: New test.
	* gcc.dg/builtin-clear-padding-2.c: New test.
2020-11-25 10:37:58 +01:00
GCC Administrator
1e2c9a2761 Daily bump. 2020-11-25 09:34:01 +00:00
Martin Liska
d3e763efcb changelog: fix parsing of a revert commit
contrib/ChangeLog:

	* gcc-changelog/git_commit.py: Use revert_regex instead
	of string prefix.  Convert sets to literals.
2020-11-25 07:56:57 +01:00
Jonathan Wakely
a3313a2214 libstdc++: Disable failing tests [PR 97936]
These tests are unstable and causing failures due to timeouts. Disable
them until the cause can be found, so that testing doesn't have to wait
for them to timeout.

libstdc++-v3/ChangeLog:

	PR libstdc++/97936
	PR libstdc++/97944
	* testsuite/29_atomics/atomic_integral/wait_notify.cc: Disable.
	Do not require pthreads, but add -pthread when appropriate.
	* testsuite/30_threads/jthread/95989.cc: Likewise.
	* testsuite/30_threads/latch/3.cc: Likewise.
	* testsuite/30_threads/semaphore/try_acquire_until.cc: Likewise.
2020-11-24 23:41:28 +00:00
Martin Sebor
211d68dda1 PR c/97955 - ICE in build_array_type_1 on invalid redeclaration of function with VLA parameter
gcc/c-family/ChangeLog:

	* c-warn.c (warn_parm_array_mismatch): Avoid invalid redeclarations.

gcc/testsuite/ChangeLog:

	* gcc.dg/pr97955.c: New test.
2020-11-24 15:23:57 -07:00
Martin Sebor
f2a5cdff04 Add a note.
gcc/testsuite/ChangeLog:
	* gcc.dg/Wstringop-overflow-47.c: Add a note.
2020-11-24 13:31:42 -07:00
Jason Merrill
92a30040c8 c++: ICE with int{} in template. [PR97899]
split_nonconstant_init_1 was confused by a CONSTRUCTOR with non-aggregate
type, which (with COMPOUND_LITERAL_P set) we use in a template to represent
a braced functional cast.  It seems to me that there's no good reason to do
split_nonconstant_init at all in a template.

gcc/cp/ChangeLog:

	PR c++/97899
	* typeck2.c (store_init_value): Don't split_nonconstant_init in a
	template.

gcc/testsuite/ChangeLog:

	PR c++/97899
	* g++.dg/cpp0x/initlist-template3.C: New test.
2020-11-24 14:57:56 -05:00
Ulrich Weigand
ce2d9549f2 Revert: "Fix -ffast-math flags handling inconsistencies"
This reverts commit c4fa3728ab4f78984a549894e0e8c4d6a253e540,
which caused a regression in the default for flag_excess_precision.

2020-11-24  Ulrich Weigand  <uweigand@de.ibm.com>

gcc/
	PR tree-optimization/97970
	* doc/invoke.texi (-ffast-math): Revert last change.
	* opts.c: Revert last change.
2020-11-24 19:30:01 +01:00
Martin Sebor
1805dbc58b Adjust regex pattern to expect an additional attribute and function return type
gcc/testsuite/ChangeLog:

	* gfortran.dg/gomp/declare-target-4.f90: Adjust pattern to expect
	an additional attribute and function return type.
2020-11-24 09:57:40 -07:00
Vladimir N. Makarov
bc8f0f1f88 [PR97933] LRA: find correctly last empty dest block.
gcc/

2020-11-24  Vladimir Makarov  <vmakarov@redhat.com>

	PR bootstrap/97933
	* lra.c (lra_process_new_insns): Stop on the first real insn after
	head of e->dest.
2020-11-24 11:36:23 -05:00
Richard Earnshaw
f30a9a8d9e arm: correctly handle negating INT_MIN in arm_split_atomic_op [PR97534]
arm_split_atomic_op handles subtracting a constant by converting it
into addition of the negated constant.  But if the type of the operand
is int and the constant is -1 we currently end up generating invalid
RTL which can lead to an abort later on.

The problem is that in a HOST_WIDE_INT, INT_MIN is represented as
0xffffffff80000000 and the negation of this is 0x0000000080000000, but
that's not a valid constant for use in SImode operations.

The fix is straight-forward which is to use gen_int_mode rather than
simply GEN_INT.  This knows how to correctly sign-extend the negated
constant when this is needed.

gcc/
	PR target/97534
	* config/arm/arm.c (arm_split_atomic_op): Use gen_int_mode when
	negating a const_int.
gcc/testsuite
	* gcc.dg/pr97534.c: New test.
2020-11-24 16:35:11 +00:00
Nathan Sidwell
13f93cf533 preprocessor: Add deferred macros
Deferred macros are needed for C++ modules.  Header units may export
macro definitions and undefinitions.  These are resolved lazily at the
point of (potential) use.  (The language specifies that, it's not just
a useful optimization.)  Thus, identifier nodes grow a 'deferred'
field, which fortunately doesn't expand the structure on 64-bit
systems as there was padding there.  This is non-zero on NT_MACRO
nodes, if the macro is deferred.  When such an identifier is lexed, it
is resolved via a callback that I added recently.  That will either
provide the macro definition, or discover it there was an overriding
undef.  Either way the identifier is no longer a deferred macro.
Notice it is now possible for NT_MACRO nodes to have a NULL macro
expansion.

	libcpp/
	* include/cpplib.h (struct cpp_hashnode): Add deferred field.
	(cpp_set_deferred_macro): Define.
	(cpp_get_deferred_macro): Declare.
	(cpp_macro_definition): Reformat, add overload.
	(cpp_macro_definition_location): Deal with deferred macro.
	(cpp_alloc_token_string, cpp_compare_macro): Declare.
	* internal.h (_cpp_notify_macro_use): Return bool
	(_cpp_maybe_notify_macro_use): Likewise.
	* directives.c (do_undef): Check macro is not undef before
	warning.
	(do_ifdef, do_ifndef): Deal with deferred macro.
	* expr.c (parse_defined): Likewise.
	* lex.c (cpp_allocate_token_string): Break out of ...
	(create_literal): ... here.  Call it.
	(cpp_maybe_module_directive): Deal with deferred macro.
	* macro.c (cpp_get_token_1): Deal with deferred macro.
	(warn_of_redefinition): Deal with deferred macro.
	(compare_macros): Rename to ...
	(cpp_compare_macro): ... here.  Make extern.
	(cpp_get_deferred_macro): New.
	(_cpp_notify_macro_use): Deal with deferred macro, return bool
	indicating definedness.
	(cpp_macro_definition): Deal with deferred macro.
2020-11-24 08:31:03 -08:00
Richard Sandiford
489be3119e aarch64: Fix aapcs64 testsuite failures
Various aapcs64 tests were failing at -O1 and above because
the assignments to testfunc_ptr were being deleted as dead.
That in turn happened because FUNC_VAL_CHECK hid the tail call
to myfunc using an LR asm trick:

    asm volatile ("mov %0, x30" : "=r" (saved_return_address));
    asm volatile ("mov x30, %0" : : "r" ((unsigned long long) myfunc));

and so the compiler couldn't see any calls that might read
testfunc_ptr.

That in itself could be fixed by adding a memory clobber to the
second asm above, forcing the compiler to keep both the testfunc_ptr
and the saved_return_address assignments.  But since this is an ABI
test, it seems better to make sure that we don't do any IPA at all.
The fact that doing IPA caused a problem was kind-of helpful and
so it might be better to avoid making the test “work” in the
presence of IPA.

The patch therefore just replaced “noinline” with “noipa”.

gcc/testsuite/
	* gcc.target/aarch64/aapcs64/abitest.h (FUNC_VAL_CHECK): Use
	noipa rather than noinline.
	* gcc.target/aarch64/aapcs64/abitest-2.h (FUNC_VAL_CHECK): Likewise.
2020-11-24 15:01:45 +00:00