Commit graph

184975 commits

Author SHA1 Message Date
Jonathan Wakely
0e79e63026 libstdc++: Fix definition of std::remove_cvref_t
I originally defined std::remove_cvref_t in terms of the internal
__remove_cvref_t trait, to avoid instantiating the remove_cvref class
template. However, as described in P1715R0 that is observable by users
and is thus non-conforming.

This defines remove_cvref_t as specified in the standard.

libstdc++-v3/ChangeLog:

	* include/std/type_traits (remove_cvref_t): Define in terms of
	remove_cvref.
	* testsuite/20_util/remove_cvref/value.cc: Check alias.
2021-05-06 13:41:15 +01:00
Jonathan Wakely
7411554686 Revert "libstdc++: Use unsigned char argument to std::isdigit"
This reverts commit d0d6ca0197.
2021-05-06 13:41:09 +01:00
Jakub Jelinek
cfd65e8d52 phiopt: Use gphi *phi instead of gimple *phi some more
Various functions in phiopt are also called with a gphi * but use
gimple * argument for it.

2021-05-06  Jakub Jelinek  <jakub@redhat.com>

	* tree-ssa-phiopt.c (value_replacement, minmax_replacement,
	abs_replacement, xor_replacement,
	cond_removal_in_popcount_clz_ctz_pattern,
	replace_phi_edge_with_variable): Change type of phi argument from
	gimple * to gphi *.
2021-05-06 14:05:06 +02:00
Richard Biener
a1ac9ffb5a Avoid update_ssa quadraticness in loop splitting
We already take care to not apply loop splitting to IL produced
by splitting so we should be able to delay updating SSA and
loop-closed SSA that was left broken after loop versioning
until after we processed all opportunities.

2021-05-06  Richard Biener  <rguenther@suse.de>

	* tree-ssa-loop-split.c (split_loop): Delay updating SSA form.
	Output an opt-info message.
	(do_split_loop_on_cond): Likewise.
	(tree_ssa_split_loops): Update SSA form here.
2021-05-06 13:54:02 +02:00
Richard Biener
1698f496c5 Fix IPA SRA removal of DECL_BY_REFERENCE return
While doing bogus call LHS removal I noticed that cloning with
dropping a return value creates a bogus replacement for a
DECL_BY_REFERENCE DECL_RESULT, resulting in MEM_REFs of
aggregates rather than pointers.  The following fixes this
latent issue.

2021-05-06  Richard Biener  <rguenther@suse.de>

	* tree-inline.c (tree_function_versioning): Fix DECL_BY_REFERENCE
	return variable removal.
2021-05-06 13:54:02 +02:00
Christophe Lyon
e82e87a851 testsuite: gcc.c-torture/execute/ieee/cdivchkld.c needs fmaxl
The new test gcc.c-torture/execute/ieee/cdivchkld.c needs fmaxl(),
which may not be available, for instance on aarch64-elf with newlib.
As discussed in the PR, requiring c99_runtime enables to skip the test
in this case.

2021-05-06  Christophe Lyon  <christophe.lyon@linaro.org>

	PR testsuite/100355
	gcc/testsuite/
	* gcc.c-torture/execute/ieee/cdivchkld.x: New.
2021-05-06 09:05:52 +00:00
Marius Hillenbrand
3c33c00f43 IBM Z: Fix error checking for builtin vec_permi
The builtin vec_permi is peculiar in that its immediate operand is
encoded differently than the immediate operand that is backing the
builtin. This fixes the check for the immediate operand, adding a
regression test in the process.

This partially reverts commit 3191c1f448

2021-05-06  Marius Hillenbrand  <mhillen@linux.ibm.com>

gcc/ChangeLog:

	* config/s390/s390-builtins.def (O_M5, O1_M5, ...): Remove unused macros.
	(s390_vec_permi_s64, s390_vec_permi_b64, s390_vec_permi_u64)
	(s390_vec_permi_dbl, s390_vpdi): Use the O3_U2 type for the immediate
	operand.
	* config/s390/s390.c (s390_const_operand_ok): Remove unused
	values.

gcc/testsuite/ChangeLog:

	* gcc.target/s390/zvector/imm-range-error-1.c: Fix test for
	__builtin_s390_vpdi.
	* gcc.target/s390/zvector/vec-permi.c: New test for builtin
	vec_permi.
2021-05-06 10:49:18 +02:00
Jakub Jelinek
ad96c867e1 phiopt: Optimize (x <=> y) cmp z [PR94589]
genericize_spaceship genericizes i <=> j to approximately
({ int c; if (i == j) c = 0; else if (i < j) c = -1; else c = 1; c; })
for strong ordering and
({ int c; if (i == j) c = 0; else if (i < j) c = -1; else if (i > j) c = 1; else c = 2; c; })
for partial ordering.
The C++ standard supports then == or != comparisons of that against
strong/partial ordering enums, or </<=/==/!=/>/>= comparisons of <=> result
against literal 0.

In some cases we already optimize that but in many cases we keep performing
all the 2 or 3 comparisons, compute the spaceship value and then compare
that.

The following patch recognizes those patterns if the <=> operands are
integral types or floating point (the latter only for -ffast-math) and
optimizes it to the single comparison that is needed (plus adds debug stmts
if needed for the spaceship result).

There is one thing I'd like to address in a follow-up: the pr94589-2.C
testcase should be matching just 12 times each, but runs
into operator>=(partial_ordering, unspecified) being defined as
(_M_value&1)==_M_value
rather than _M_value>=0.  When not honoring NaNs, the 2 case should be
unreachable and so (_M_value&1)==_M_value is then equivalent to _M_value>=0,
but is not a single use but two uses.  I'll need to pattern match that case
specially.

2021-05-06  Jakub Jelinek  <jakub@redhat.com>

	PR tree-optimization/94589
	* tree-ssa-phiopt.c (tree_ssa_phiopt_worker): Call
	spaceship_replacement.
	(cond_only_block_p, spaceship_replacement): New functions.

	* gcc.dg/pr94589-1.c: New test.
	* gcc.dg/pr94589-2.c: New test.
	* gcc.dg/pr94589-3.c: New test.
	* gcc.dg/pr94589-4.c: New test.
	* g++.dg/opt/pr94589-1.C: New test.
	* g++.dg/opt/pr94589-2.C: New test.
	* g++.dg/opt/pr94589-3.C: New test.
	* g++.dg/opt/pr94589-4.C: New test.
2021-05-06 10:15:40 +02:00
Richard Biener
b5254d6b75 ipa/100373 - fix emutls lowering compare-debug issue
emutls figured that tls uses in debug-insns need lowering but
that obviously has effects on code-generation as can be seen
in the following IL diff with the new testcase:

   <bb 2> [local count: 1073741824]:
-  a = 0;
+  # DEBUG BEGIN_STMT
   _4 = __builtin___emutls_get_address (&__emutls_v.b);
+  # DEBUG D#1 => *_4
+  # DEBUG d => (long int) D#1
+  # DEBUG BEGIN_STMT
+  a = 0;
+  # DEBUG BEGIN_STMT
   *_4 = 0;
   return;

where it figured the debug use of b in the original

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  # DEBUG D#1 => b
  # DEBUG d => (long int) D#1
  # DEBUG BEGIN_STMT
  a = 0;

needs lowering (it maybe does when we want to produce perfect
debug but that's just bad luck).

The following patch fixes this by avoiding to create a new
emutls address when visiting debug stmts and instead resets them.
Another option might be to simply not lower debug stmt uses
but I have no way to verify actual debug info for this.

2021-05-05  Richard Biener  <rguenther@suse.de>

	PR ipa/100373
	* tree-emutls.c (gen_emutls_addr): Pass in whether we're
	dealing with a debug use and only query existing addresses
	if so.
	(lower_emutls_1): Avoid splitting out addresses for debug
	stmts, reset the debug stmt when we fail to find existing
	lowered addresses.
	(lower_emutls_phi_arg): Set wi.stmt.

	* gcc.dg/pr100373.c: New testcase.
2021-05-06 10:08:16 +02:00
Javier Miranda
2fd7689cb2 [Ada] ACATS 4.1R-c611a04: Class-wide preconditions in dispatching calls
gcc/ada/

	* exp_disp.adb (Build_Class_Wide_Check): Extending the
	functionality of this routine to climb to the ancestors
	searching for the enclosing overridden dispatching primitive
	that has a class-wide precondition to generate the check.
2021-05-06 03:51:45 -04:00
Piotr Trojanek
60b803a7f1 [Ada] Avoid repeated analysis of constraint ranges
gcc/ada/

	* sem_ch3.adb (Constraint_Index): Remove redundant problematic
	analysis.
2021-05-06 03:51:44 -04:00
Arnaud Charlet
05b7561e37 [Ada] Assert failure on E_Enumeration_Literal and front-end unnesting
gcc/ada/

	* exp_unst.adb (Note_Uplevel_Bound): Exclude
	E_Enumeration_Literal.
2021-05-06 03:51:43 -04:00
Arnaud Charlet
369965ea43 [Ada] Bad expansion with -gnato2 and if expression
gcc/ada/

	* exp_ch4.adb (Expand_N_If_Expression):
	Apply_Arithmetic_Overflow_Check will not deal with
	Then/Else_Actions so skip minimizing overflow checks if any
	actions are present.
2021-05-06 03:51:42 -04:00
Boris Yakobowski
c4aeb3c3a2 [Ada] In CodePeer mode, use regular-exception handling
gcc/ada/

	* gnat1drv.adb (Adjust_Global_Switches): Simplify logic.
2021-05-06 03:51:41 -04:00
Arnaud Charlet
cfcbb5c741 [Ada] AI12-0411: Add "bool" to Interfaces.C
gcc/ada/

	* libgnat/i-c.ads (bool): New type.
	* libgnat/i-cexten.ads, libgnat/i-cexten__128.ads (bool): Now
	a subtype of Interfaces.C.bool.
	* libgnarl/s-interr__vxworks.adb (Interrupt_Manager): Qualify
	False.
	* libgnarl/s-interr.adb, libgnarl/s-interr__hwint.adb,
	libgnarl/s-tasini.adb, libgnarl/s-tasren.adb,
	libgnarl/s-tassta.adb, libgnarl/s-tpobmu.adb,
	libgnarl/s-tpobop.adb, libgnarl/s-tpopmo.adb: Replace
	Assert (False) by Assert (Standard.False).
2021-05-06 03:51:40 -04:00
Ghjuvan Lacambre
364ffbe348 [Ada] Explain meaning of Non_Std_Executable
gcc/ada/

	* make.adb (Compute_Executable): Document parameter.
2021-05-06 03:51:39 -04:00
Eric Botcazou
b6f9471df1 [Ada] Do not second-guess the hardware for underflow handling of Scaling
gcc/ada/

	* libgnat/s-fatgen.adb (Scaling): Use single handling of
	underflow.  Add pragma Annotate.
2021-05-06 03:51:38 -04:00
Ghjuvan Lacambre
1075946d06 [Ada] Make Is_OK_Static_Subtype use Is_Static_Subtype
gcc/ada/

	* sem_eval.adb (Is_OK_Static_Subtype): Call Is_Static_Subtype,
	remove redundant checks.
2021-05-06 03:51:38 -04:00
Piotr Trojanek
a86fbc250c [Ada] Remove repeated calls in Resolve_Range
gcc/ada/

	* sem_res.adb (First_Last_Ref): Simplify "if [condition] then
	return True" in "return [condition]".
	(Resolve_Range): Remove calls appearing in IF condition from the
	THEN statements.
2021-05-06 03:51:37 -04:00
Piotr Trojanek
ef4a0de035 [Ada] Use high-level Make_Character_Literal instead of low-level New_Node
gcc/ada/

	* sem_case.adb (Missing_Choice): Fix typo in comment.
	(Lit_Of): Simplify with Make_Character_Literal.
	(Check_Choices): Remove extra spaces in parameter
	specifications.
	* sem_case.ads: Same reformatting.
2021-05-06 03:51:36 -04:00
Ed Schonberg
e84d25c995 [Ada] Missing semantic error on ineffective Others_Clause
gcc/ada/

	* exp_aggr.adb (Expand_Array_Aggregate): If the expression in an
	Others_Clause has not been analyzed because previous analysis of
	the enclosing aggregate showed the clause to be ineffective i.e.
	cover a null range, analyze it now to detect a possible type
	illegality.
2021-05-06 03:51:35 -04:00
Eric Botcazou
bcc6807c4b [Ada] Fix off-by-one bug in underflow handling of Scaling
gcc/ada/

	* libgnat/s-fatgen.adb (Scaling): Fix off-by-one bug for underflow.
2021-05-06 03:51:34 -04:00
Arnaud Charlet
e18e1b5f52 [Ada] Assert failure on pragma Inline in procedure body
gcc/ada/

	* sem_ch6.adb (Is_Inline_Pragma): Protect against N not being a
	list member in both branches.
2021-05-06 03:51:33 -04:00
Piotr Trojanek
952da35cc6 [Ada] Remove hardcoded pragma Warnings from the formal vectors library
gcc/ada/

	* libgnat/a-cofove.adb (Insert_Space): Remove hardcoded pragma
	Warnings.
2021-05-06 03:51:32 -04:00
Piotr Trojanek
0632f86866 [Ada] Set Raises_CE flag only in Apply_Compile_Time_Constraint_Error
gcc/ada/

	* sem_ch4.adb (Analyze_Selected_Component): Remove explicit call
	to Set_Raises_Constraint_Error on statically missing component.
	* sem_eval.adb (Eval_Arithmetic_Op): Likewise for static
	divisions by integer and real zeros.
	* sem_util.adb (Apply_Compile_Time_Constraint_Error): Call
	Set_Raises_Constraint_Error before exiting early in GNATprove
	mode.
2021-05-06 03:51:31 -04:00
Justin Squirek
55b93bbc21 [Ada] Spurious constraint error on conversion of access types
gcc/ada/

	* checks.adb (Make_Discriminant_Constraint_Check): Add check for
	null when the type being converted is an access type.
2021-05-06 03:51:30 -04:00
Arnaud Charlet
5413faaec7 [Ada] Fix handling of PATs
gcc/ada/

	* exp_pakd.adb (Expand_Packed_Eq): Fix handling of PATs.
2021-05-06 03:51:30 -04:00
Piotr Trojanek
6068795883 [Ada] Remove unused initial value in Read_Library_Info_From_Full
gcc/ada/

	* osint.adb (Read_Library_Info_From_Full): Cleanup unused
	initial value.
2021-05-06 03:51:29 -04:00
Eric Botcazou
d07cc0d126 [Ada] Document a few more characteristics of floating-point support
gcc/ada/

	* doc/gnat_rm/implementation_defined_characteristics.rst (3.5.7):
	Mention the IEEE standard explicitly.  Use current format names.
	Document assumed rounding mode and new features of I/O support.
	* gnat_rm.texi: Regenerate.
2021-05-06 03:51:28 -04:00
Eric Botcazou
1bc178bb6c [Ada] Reset x87 FPU to 64-bit precision for floating-point I/O on Linux
gcc/ada/

	* init.c (__gnat_init_float): Use full version on Linux too.
2021-05-06 03:51:27 -04:00
Eric Botcazou
799dfd944a [Ada] Make new implementation of System.Fat_Gen.Valid more robust
gcc/ada/

	* libgnat/s-fatgen.adb (Valid): Do a bit comparison with 0.0
	when denormalized numbers are not supported.
2021-05-06 03:51:26 -04:00
Piotr Trojanek
af9833a10a [Ada] Fix restriction No_Enumeration_Maps on both Image attributes
gcc/ada/

	* sem_attr.adb (Check_Enum_Image): Reword comment; add
	Check_Enumeration_Maps parameter.  Now this routine combines
	both referencing enumeration literals and checking restriction
	No_Enumeration_Maps, if required.
	(Analyze_Attribute): Remove duplicated code and instead call
	Check_Enum_Image.
2021-05-06 03:51:25 -04:00
Piotr Trojanek
e45796fe05 [Ada] Remove redundant condition for Image attribute and Ada version
gcc/ada/

	* sem_attr.adb (Analyze_Image_Attribute): Remove redundant
	condition; add a missing header box.
2021-05-06 03:51:24 -04:00
Gary Dismukes
0c1f6ae39d [Ada] Add mention of underscore and fix grammar error in doc for -gnatd
gcc/ada/

	* doc/gnat_ugn/building_executable_programs_with_gnat.rst: Add
	mention of underscore and fix grammar error in doc for -gnatd.
	* gnat_ugn.texi: Regenerate.
2021-05-06 03:51:24 -04:00
Eric Botcazou
cd4fb7180e [Ada] Implement tiered support for floating-point exponentiation
gcc/ada/

	* Makefile.rtl (GNATRTL_NONTASKING_OBJS): Add s-exponr, s-exnflt
	and s-exnlfl.
	* exp_ch4.adb (Expand_N_Op_Expon): Use RE_Exn_Float for Short_Float.
	* rtsfind.ads (RTU_Id): Add System_Exn_Flt and System_Exn_LFlt.
	(RE_Id): Adjust entries for RE_Exn_Float and RE_Exn_Long_Float.
	(RE_Unit_Table): Likewise.
	* libgnat/s-exnflt.ads: New file.
	* libgnat/s-exnlfl.ads: Likewise.
	* libgnat/s-exnllf.ads: Change to mere instantiation.
	* libgnat/s-exnllf.adb: Move implementation to...
	* libgnat/s-exponr.ads: New generic unit.
	* libgnat/s-exponr.adb: ...here and also make it generic.
	(Expon): Do the computation in double precision internally.
2021-05-06 03:51:23 -04:00
Piotr Trojanek
bed6d583e3 [Ada] Style cleanups related to writing of ALI files
gcc/ada/

	* lib-writ.adb, osint.adb, osint.ads: Cleanup.
2021-05-06 03:51:22 -04:00
Piotr Trojanek
04598eb03b [Ada] Remove excessive conditions in iterations across components
gcc/ada/

	* exp_ch3.adb (Expand_Freeze_Array_Type): Remove excessive
	condition.
	(Expand_N_Object_Declaration): Likewise.
	(Build_Equivalent_Aggregate): Likewise.
	(Initialization_Warning): Likewise; change another excessive
	condition into assertion.
	* freeze.adb (Freeze_Entity): Remove excessive condition.
2021-05-06 03:51:21 -04:00
Ed Schonberg
c2f94a898f [Ada] Crash on if_expression used as index of discriminant-dependent array
gcc/ada/

	* sem_res.adb (Resolve_If_Expression): If the context of the
	expression is an indexed_component, resolve the expression and
	its dependent_expressions with the base type of the index, to
	ensure that an index check is generated when resolving the
	enclosing indexxed_component, and avoid an improper use of
	discriminants out of scope, when the index type is
	discriminant-dependent.
2021-05-06 03:51:20 -04:00
Arnaud Charlet
afab03da75 [Ada] Fix typos
gcc/ada/

	* einfo.ads, exp_prag.adb, exp_util.adb: Fix typos.
2021-05-06 03:51:19 -04:00
Christoph Muellner
e1fcf14f33 RISC-V: Generate helpers for cbranch4.
On RISC-V we are facing the fact, that our conditional branches
require Pmode conditions. Currently, we generate them explicitly
with a check for Pmode and then calling the proper generator
(i.e. gen_cbranchdi4 on RV64 and gen_cbranchsi4 on RV32).
Let's simplify this code by generating the INSN helpers
and use gen_cbranch4 (Pmode).

	gcc/
	PR target/100266
	* config/riscv/riscv.c (riscv_block_move_loop): Use cbranch helper.
	* config/riscv/riscv.md (cbranch<mode>4): Generate helpers.
	(stack_protect_test): Use cbranch helper.
2021-05-05 18:15:42 -07:00
GCC Administrator
449480114a Daily bump. 2021-05-06 00:16:37 +00:00
Eric Botcazou
e8d1ca7d2c Fix PR target/100402
This is a regression for 64-bit Windows present from mainline down to the 9
branch and introduced by the fix for PR target/99234.  Again SEH, but with
a twist related to the way MinGW implements setjmp/longjmp, which turns out
to be piggybacked on SEH with recent versions of MinGW, i.e. the longjmp
performs a bona-fide unwinding of the stack, because it calls RtlUnwindEx
with the second argument initially passed to setjmp, which is the result of
__builtin_frame_address (0) in the MinGW header file:

  define setjmp(BUF) _setjmp((BUF), __builtin_frame_address (0))

This means that we directly expose the frame pointer to the SEH machinery
here (unlike with regular exception handling where we use an intermediate
CFA) and thus that we cannot do whatever we want with it.  The old code
would leave it unaligned, i.e. not multiple of 16, whereas the new code
aligns it, but this breaks for some reason; at least it appears that a
.seh_setframe directive with 0 as second argument always works, so the
fix aligns it this way.

gcc/
	PR target/100402
	* config/i386/i386.c (ix86_compute_frame_layout): For a SEH target,
	always return the establisher frame for __builtin_frame_address (0).
gcc/testsuite/
	* gcc.c-torture/execute/20210505-1.c: New test.
2021-05-05 22:53:35 +02:00
Ivan Sorokin
a0b4e09ab0 x86: Build only one __cpu_model/__cpu_features2 variables
GCC -O2 generated quite bad code for this function:

bool
f (void)
{
  return __builtin_cpu_supports("popcnt")
	 && __builtin_cpu_supports("ssse3");
}

f:
	movl	__cpu_model+12(%rip), %edx
	movl	%edx, %eax
	shrl	$6, %eax
	andl	$1, %eax
	andl	$4, %edx
	movl	$0, %edx
	cmove	%edx, %eax
	ret

The problem was caused by the fact that internally every invocation of
__builtin_cpu_supports built a new variable __cpu_model and a new type
__processor_model.  Because of this, GIMPLE level optimizers weren't able
to CSE the loads of __cpu_model and optimize bit-operations properly.

Improve GCC -O2 code generation by caching __cpu_model and__cpu_features2
variables as well as their types:

f:
        movl    __cpu_model+12(%rip), %eax
        andl    $68, %eax
        cmpl    $68, %eax
        sete    %al
        ret

2021-05-05  Ivan Sorokin <vanyacpp@gmail.com>
	    H.J. Lu <hjl.tools@gmail.com>

gcc/

	PR target/91400
	* config/i386/i386-builtins.c (ix86_cpu_model_type_node): New.
	(ix86_cpu_model_var): Likewise.
	(ix86_cpu_features2_type_node): Likewise.
	(ix86_cpu_features2_var): Likewise.
	(fold_builtin_cpu): Cache __cpu_model and __cpu_features2 with
	their types.

gcc/testsuite/

	PR target/91400
	* gcc.target/i386/pr91400-1.c: New test.
	* gcc.target/i386/pr91400-2.c: Likewise.
2021-05-05 11:42:11 -07:00
Martin Sebor
2254b3233b PR middle-end/100325 - missing warning with -O0 on sprintf overflow with pointer plus offset
gcc/ChangeLog:

	* passes.def (pass_warn_printf): Run after SSA.

gcc/testsuite/ChangeLog:

	* gcc.dg/tree-ssa/builtin-sprintf-warn-26.c: New test.
2021-05-05 11:07:39 -06:00
Patrick Palka
2b71ca688b libstdc++: Don't constrain some enable_borrowed_range specializations
These constraints are already present on the template we're partially
specializing for.

libstdc++-v3/ChangeLog:

	* include/bits/ranges_util.h (enable_borrowed_range<subrange>):
	Remove constraints on this partial specialization.
	* include/std/ranges (enable_borrowed_range<iota_view>):
	Likewise.
2021-05-05 12:07:52 -04:00
Patrick Palka
2663727d85 libstdc++: Implement LWG 3517/3520 for join_view/transform_view
libstdc++-v3/ChangeLog:

	* include/std/ranges (transform_view::_Iterator::iter_swap):
	Remove as per LWG 3520.
	(join_view::_Iterator::iter_swap): Add indirectly_swappable
	constraint as per LWG 3517.
2021-05-05 12:07:32 -04:00
Prathamesh Kulkarni
d9937da063 arm/97903: Missed optimization in lowering test operation.
gcc/ChangeLog:

2021-05-05  Prathamesh Kulkarni  <prathamesh.kulkarni@linaro.org>

	* config/arm/neon.md (neon_vtst_combine<mode>): New pattern.
	* config/arm/predicates.md (minus_one_operand): New predicate.
2021-05-05 21:11:45 +05:30
Jeff Law
b927ffdd6c Remove cc0 remnants from avr port
gcc/
	* config/avr/avr.md: Remove references to CC_STATUS_INIT.
2021-05-05 09:17:14 -06:00
Stefan Schulze Frielinghaus
bb283170e7 PR rtl-optimization/100263: Ensure register can change mode
For move2add_valid_value_p we also have to ask the target whether a
register can be accessed in a different mode than it was set before.

gcc/ChangeLog:

	PR rtl-optimization/100263
	* postreload.c (move2add_valid_value_p): Ensure register can
	change mode.
2021-05-05 17:00:43 +02:00
Eric Botcazou
dfd2c92f3f Fix PR rtl-optimization/100411
This is the bootstrap failure of GCC 11 on MinGW64 configured with --enable-
tune=nocona.  The bottom line is that SEH does not support CFI for epilogues
but the x86 back-end nevertheless attaches it to instructions, so we have to
filter it out and this is done by detecting the end of the prologue by means
of the NOTE_INSN_PROLOGUE_END note.

But the compiler manages to generate a second epilogue before this note in
the RTL stream and this fools the aforementioned logic.  The root cause is
cross-jumping, which inserts a jump before the end of the prologue, in fact
just before the note; the rest (CFG cleanup, BB reordering, etc) is downhill
from there.

gcc/
	PR rtl-optimization/100411
	* cfgcleanup.c (try_crossjump_to_edge): Also skip end of prologue
	and beginning of function markers.
2021-05-05 16:53:58 +02:00