Bug 80429 - -fcompare-debug failure on ppc64le with LRA
Summary: -fcompare-debug failure on ppc64le with LRA
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: rtl-optimization (show other bugs)
Version: 7.0.1
: P3 normal
Target Milestone: ---
Assignee: Segher Boessenkool
URL:
Keywords: compare-debug-failure
Depends on:
Blocks:
 
Reported: 2017-04-14 14:59 UTC by Markus Trippelsdorf
Modified: 2022-01-18 23:30 UTC (History)
4 users (show)

See Also:
Host: ppc64le
Target: ppc64le
Build:
Known to work: 7.0.1
Known to fail: 5.4.0, 6.3.0
Last reconfirmed: 2017-04-14 00:00:00


Attachments
reduced testcase (1.22 KB, text/plain)
2017-04-14 14:59 UTC, Markus Trippelsdorf
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Trippelsdorf 2017-04-14 14:59:38 UTC
Created attachment 41201 [details]
reduced testcase

This is an old issue. All supported compilers are affected when using -mlra.

 % g++ --save-temps -w -fcompare-debug -c -O3 SemaTemplateVariadic.ii
g++: error: SemaTemplateVariadic.ii: -fcompare-debug failure

 % diff -u SemaTemplateVariadic.gkd SemaTemplateVariadic.gk.gkd
--- SemaTemplateVariadic.gkd    2017-04-14 14:58:01.192414182 +0000
+++ SemaTemplateVariadic.gk.gkd 2017-04-14 14:58:01.262415848 +0000
@@ -472,9 +472,9 @@
                 (compare:CC (and:DI (reg/f:DI 9 9 [orig:156 _2 ] [156])
                         (const_int 1 [0x1]))
                     (const_int 0 [0])))
-            (clobber (reg:DI 10 10 [189]))
+            (clobber (reg:DI 10 10 [190]))
         ]) "SemaTemplateVariadic.ii":29# {*anddi3_imm_mask_dot}
-     (expr_list:REG_UNUSED (reg:DI 10 10 [189])
+     (expr_list:REG_UNUSED (reg:DI 10 10 [190])
         (nil)))
 (jump_insn # 0 0 (set (pc)
         (if_then_else (ne (reg:CC 68 0 [174])
@@ -500,9 +500,9 @@
                 (compare:CC (and:DI (reg:DI 9 9 [orig:161 _19 ] [161])
                         (const_int 1 [0x1]))
                     (const_int 0 [0])))
-            (clobber (reg:DI 8 8 [190]))
+            (clobber (reg:DI 8 8 [191]))
         ]) "SemaTemplateVariadic.ii":29# {*anddi3_imm_mask_dot}
-     (expr_list:REG_UNUSED (reg:DI 8 8 [190])
+     (expr_list:REG_UNUSED (reg:DI 8 8 [191])
         (nil)))
 (jump_insn # 0 0 (set (pc)
         (if_then_else (ne (reg:CC 68 0 [178])
Comment 1 Segher Boessenkool 2017-04-14 21:11:09 UTC
It's a problem in IRA.  I am testing a patch.
Comment 2 Segher Boessenkool 2017-04-19 10:04:06 UTC
Author: segher
Date: Wed Apr 19 10:03:35 2017
New Revision: 246991

URL: https://gcc.gnu.org/viewcvs?rev=246991&root=gcc&view=rev
Log:
IRA: Don't create new regs for debug insns (PR80429)

In split_live_ranges_for_shrink_wrap IRA also splits regs that are
only used in debug insns, leading to -fcompare-debug failures.


	PR rtl-optimization/80429
	* ira.c (split_live_ranges_for_shrink_wrap): Don't split regs that
	are only used in debug insns.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/ira.c
Comment 3 Richard Biener 2017-04-20 10:16:24 UTC
Fixed on trunk (sofar)?
Comment 4 Markus Trippelsdorf 2017-04-20 10:19:31 UTC
(In reply to Richard Biener from comment #3)
> Fixed on trunk (sofar)?

Yes.
Comment 5 Segher Boessenkool 2017-04-20 10:20:07 UTC
Yes sorry, fixed on trunk.  Backports pending.
Comment 6 Segher Boessenkool 2017-06-27 17:11:34 UTC
Author: segher
Date: Tue Jun 27 17:11:01 2017
New Revision: 249700

URL: https://gcc.gnu.org/viewcvs?rev=249700&root=gcc&view=rev
Log:
	Backports from trunk:

	2016-08-15  Segher Boessenkool  <segher@kernel.crashing.org>
	PR rtl-optimization/73650
	* lra-constraints.c (simple_move_p): If the insn is multiple_sets
	it is not a simple move.

	2017-01-20  Segher Boessenkool  <segher@kernel.crashing.org>
	PR target/61729
	PR target/77850
	* config/rs6000/rs6000.c (rs6000_gimplify_va_arg): Adjust address to
	read from, for big endian.

	2017-04-04  Segher Boessenkool  <segher@kernel.crashing.org>
	PR rtl-optimization/60818
	* simplify-rtx.c (simplify_binary_operation_1): Do not replace
	a compare of comparisons with the thing compared if this results
	in a different machine mode.

	2017-04-12  Segher Boessenkool  <segher@kernel.crashing.org>
	PR target/80382
	* config/rs6000/sync.md (atomic_load<mode>, atomic_store<mode): Test
	for quad_address_p for TImode, instead of just not indexed_address.

	2017-04-19  Segher Boessenkool  <segher@kernel.crashing.org>
	PR rtl-optimization/80429
	* ira.c (split_live_ranges_for_shrink_wrap): Don't split regs that
	are only used in debug insns.

	2017-05-17  Segher Boessenkool  <segher@kernel.crashing.org>
	PR middle-end/80692
	* real.c (do_compare): Give decimal_do_compare preference over
	comparing just the signs.

	2017-05-31  Segher Boessenkool  <segher@kernel.crashing.org>
	PR target/80618
	* config/rs6000/vector.md (*vector_uneq<mode>): Write the nor in the
	splitter result in the canonical way.

	2017-06-09  Segher Boessenkool  <segher@kernel.crashing.org>
	PR target/80966
	* config/rs6000/rs6000.c (rs6000_emit_allocate_stack): Assert that
	gen_add3_insn did not fail.
	* config/rs6000/rs6000.md (add<mode>3): If asked to add a constant to
	r0, construct that number in a temporary reg and add that reg to r0.
	If asked to put the result in r0 as well, fail.

	2017-06-23  Segher Boessenkool  <segher@kernel.crashing.org>
	PR middle-end/80902
	* builtins.c (expand_builtin_atomic_fetch_op): If emitting code after
	a call, force the call to not be a tail call.

gcc/testsuite/
	Backports from trunk:

	2017-04-04  Segher Boessenkool  <segher@kernel.crashing.org>
	PR rtl-optimization/60818
	* gcc.c-torture/compile/pr60818.c: New testcase.

	2017-05-17  Segher Boessenkool  <segher@kernel.crashing.org>
	PR middle-end/80692
	* gcc.c-torture/execute/pr80692.c: New testcase.

	2017-06-09  Segher Boessenkool  <segher@kernel.crashing.org>
	PR target/80966
	* gcc.target/powerpc/stack-limit.c: New testcase.

Added:
    branches/gcc-6-branch/gcc/testsuite/gcc.c-torture/compile/pr60818.c
    branches/gcc-6-branch/gcc/testsuite/gcc.c-torture/execute/pr80692.c
    branches/gcc-6-branch/gcc/testsuite/gcc.target/powerpc/stack-limit.c
Modified:
    branches/gcc-6-branch/gcc/ChangeLog
    branches/gcc-6-branch/gcc/builtins.c
    branches/gcc-6-branch/gcc/config/rs6000/rs6000.c
    branches/gcc-6-branch/gcc/config/rs6000/rs6000.md
    branches/gcc-6-branch/gcc/config/rs6000/sync.md
    branches/gcc-6-branch/gcc/config/rs6000/vector.md
    branches/gcc-6-branch/gcc/ira.c
    branches/gcc-6-branch/gcc/lra-constraints.c
    branches/gcc-6-branch/gcc/real.c
    branches/gcc-6-branch/gcc/simplify-rtx.c
    branches/gcc-6-branch/gcc/testsuite/ChangeLog
Comment 7 Segher Boessenkool 2017-06-29 09:35:09 UTC
Fixed on 6 and later.