Bug 68959 - Test case ICEs with -mlra -mvsx-timode
Summary: Test case ICEs with -mlra -mvsx-timode
Status: RESOLVED DUPLICATE of bug 69461
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 6.0
: P3 normal
Target Milestone: 6.0
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-12-17 14:39 UTC by Peter Bergner
Modified: 2016-02-17 03:36 UTC (History)
6 users (show)

See Also:
Host:
Target: powerpc64*
Build:
Known to work:
Known to fail:
Last reconfirmed: 2016-01-19 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Bergner 2015-12-17 14:39:46 UTC
bergner@genoa:~/gcc/BUGS/LRA/new$ cat t001_x.i 
typedef union { _Decimal128 a; } u_t;
extern u_t fn2 (u_t);
u_t
fn1 (void)
{
  return fn2 (fn1 ());
}

bergner@genoa:~/gcc/BUGS/LRA/new$ /home/bergner/gcc/build/gcc-fsf-mainline-bootstrap-lra-default-7/gcc/xgcc -B/home/bergner/gcc/build/gcc-fsf-mainline-bootstrap-lra-default-7/gcc/ -mvsx -S t001_x.i
t001_x.i: In function ‘fn1’:
t001_x.i:7:1: internal compiler error: Max. number of generated reload insns per insn is achieved (90)
 }
 ^

0x10689feb lra_constraints(bool)
	/home/bergner/gcc/gcc-fsf-mainline-bootstrap-lra-default/gcc/lra-constraints.c:4336
0x1066f79f lra(_IO_FILE*)
	/home/bergner/gcc/gcc-fsf-mainline-bootstrap-lra-default/gcc/lra.c:2277
0x106100cb do_reload
	/home/bergner/gcc/gcc-fsf-mainline-bootstrap-lra-default/gcc/ira.c:5383
0x106100cb execute
	/home/bergner/gcc/gcc-fsf-mainline-bootstrap-lra-default/gcc/ira.c:5554
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.

Mike, without looking too closely, I wonder if we need to add TDmode support to your fix in PR68805 ?  I'll see if that helps.
Comment 1 Peter Bergner 2015-12-17 15:07:07 UTC
Simpler test case???  Anyway, it fails too.

typedef union { _Decimal128 a; } u_t;
extern u_t fn1 (void);
extern void fn2 (u_t);
void
foo (void)
{
  fn2 (fn1 ());
}

Before LRA, we have:

(call_insn 5 2 6 2 (parallel [
            (set (parallel:TI [
                        (expr_list:REG_DEP_TRUE (reg:TD 34 2)
                            (const_int 0 [0]))
                    ])
                (call (mem:SI (symbol_ref:DI ("fn1") [flags 0x41] <function_decl 0x3fffb568d580 fn1>) [0 fn1 S4 A8])
                    (const_int 0 [0])))
            (clobber (reg:DI 65 lr))
        ]) foo.i:7 636 {*call_value_nonlocal_aixdi}
     (nil)
    (expr_list (use (reg:DI 2 2))
        (nil)))

(insn 6 5 7 2 (set (reg:TD 156)
        (reg:TD 34 2)) foo.i:7 450 {*movtd_64bit_nodm}
     (expr_list:REG_DEAD (reg:TD 34 2)
        (nil)))

(insn 7 6 8 2 (set (reg:TI 155 [ D.2361 ])
        (subreg:TI (reg:TD 156) 0)) foo.i:7 937 {*vsx_movti_64bit}
     (expr_list:REG_DEAD (reg:TD 156)
        (nil)))

(insn 8 7 9 2 (set (reg:TI 157)
        (reg:TI 155 [ D.2361 ])) foo.i:7 937 {*vsx_movti_64bit}
     (expr_list:REG_DEAD (reg:TI 155 [ D.2361 ])
        (nil)))

(insn 9 8 10 2 (set (reg:TD 158)
        (subreg:TD (reg:TI 157) 0)) foo.i:7 450 {*movtd_64bit_nodm}
     (expr_list:REG_DEAD (reg:TI 157)
        (nil)))

(insn 10 9 11 2 (set (reg:TD 34 2)
        (reg:TD 158)) foo.i:7 450 {*movtd_64bit_nodm}
     (expr_list:REG_DEAD (reg:TD 158)
        (nil)))

(call_insn 11 10 14 2 (parallel [
            (call (mem:SI (symbol_ref:DI ("fn2") [flags 0x41] <function_decl 0x3fffb568d660 fn2>) [0 fn2 S4 A8])
                (const_int 0 [0]))
            (clobber (reg:DI 65 lr))
        ]) foo.i:7 635 {*call_nonlocal_aixdi}
     (expr_list:REG_DEAD (reg:DI 2 2)
        (expr_list:REG_DEAD (reg:TD 34 2)
            (nil)))
    (expr_list (use (reg:DI 2 2))
        (expr_list (use (reg:TD 34 2))
            (nil))))

(insn 14 11 0 2 (unspec [
            (const_int 0 [0])
        ] UNSPEC_NOP) foo.i:8 697 {nop}
     (nil))

After the ICE in LRA, we have:

(call_insn 5 2 6 2 (parallel [
            (set (parallel:TI [
                        (expr_list:REG_DEP_TRUE (reg:TD 34 2)
                            (const_int 0 [0]))
                    ])
                (call (mem:SI (symbol_ref:DI ("fn1") [flags 0x41] <function_decl 0x3fffb568d580 fn1>) [0 fn1 S4 A8])
                    (const_int 0 [0])))
            (clobber (reg:DI 65 lr))
        ]) foo.i:7 636 {*call_value_nonlocal_aixdi}
     (expr_list:REG_UNUSED (reg:DI 65 lr)
        (nil))
    (expr_list (use (reg:DI 2 2))
        (nil)))

(insn 6 5 18 2 (set (mem/c:TD (plus:DI (reg/f:DI 113 sfp)
                (const_int 32 [0x20])) [1 %sfp+32 S16 A128])
        (reg:TD 34 2)) foo.i:7 450 {*movtd_64bit_nodm}
     (expr_list:REG_DEAD (reg:TI 35 3)
        (expr_list:REG_DEAD (reg:TD 34 2)
            (nil))))

(insn 18 6 20 2 (set (reg:DI 162)
        (plus:DI (reg/f:DI 113 sfp)
            (const_int 32 [0x20]))) foo.i:7 81 {*adddi3}
     (nil))

(insn 20 18 19 2 (set (reg:DI 163 [162])
        (reg:DI 162)) foo.i:7 540 {*movdi_internal64}
     (nil))

(insn 19 20 21 2 (set (reg:TD 164 [161])
        (mem/c:TD (reg:DI 163 [162]) [1 %sfp+32 S16 A128])) foo.i:7 450 {*movtd_64bit_nodm}
     (nil))

(insn 21 19 22 2 (set (reg:TD 165 [161])
        (reg:TD 164 [161])) foo.i:7 450 {*movtd_64bit_nodm}
     (nil))

(insn 22 21 23 2 (set (reg:TD 166 [161])
        (reg:TD 165 [161])) foo.i:7 450 {*movtd_64bit_nodm}
     (nil))

(insn 23 22 24 2 (set (reg:TD 167 [161])
        (reg:TD 166 [161])) foo.i:7 450 {*movtd_64bit_nodm}
     (nil))

(insn 24 23 25 2 (set (reg:TD 168 [161])
        (reg:TD 167 [161])) foo.i:7 450 {*movtd_64bit_nodm}
     (nil))
....
Comment 2 Michael Meissner 2015-12-17 17:46:31 UTC
Just to be clear, does it still fail with the fix for PR 68805 installed?
Comment 3 Peter Bergner 2015-12-17 18:02:26 UTC
(In reply to Michael Meissner from comment #2)
> Just to be clear, does it still fail with the fix for PR 68805 installed?

Yes, my compiler has that fix.
Comment 4 Martin Sebor 2016-01-19 19:21:11 UTC
I don't see the error on trunk with either test case on either BE or LE.  Can this be closed?
Comment 5 Bill Schmidt 2016-01-19 19:27:51 UTC
Martin, did you specify -mlra and -mvsx-timode?  Peter's compiler is a test one that turns these on by default.  Just want to be sure we're comparing the same things.
Comment 6 Martin Sebor 2016-01-19 21:19:24 UTC
I don't see it on a big-endian powerpc64 even with -mlra -mvsx -mvsx-timode but I can reproduce/confirm it with those options on powerpc64le (I did miss those on my first attempt).

$ cat u.c && /build/gcc-trunk/gcc/xgcc -B /build/gcc-trunk/gcc -S -Wall -Wextra  -S  -mlra -mvsx-timode u.c
typedef union { _Decimal128 a; } u_t;
extern u_t fn2 (u_t);
u_t
fn1 (void)
{
  return fn2 (fn1 ());
}
u.c: In function ‘fn1’:
u.c:7:1: internal compiler error: Max. number of generated reload insns per insn is achieved (90)

 }
 ^

0x10a72f87 lra_constraints(bool)
	/src/gcc/trunk/gcc/lra-constraints.c:4336
0x10a53127 lra(_IO_FILE*)
	/src/gcc/trunk/gcc/lra.c:2277
0x109d0cc7 do_reload
	/src/gcc/trunk/gcc/ira.c:5393
0x109d1383 execute
	/src/gcc/trunk/gcc/ira.c:5564
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.
Comment 7 Alan Modra 2016-02-17 03:14:35 UTC
This appears to be fixed by git 401bd0c81, svn rev 233107, the fix for pr69461.
At least, I can't reproduce the problem using the testcase here, past that point on trunk.
Comment 8 Alan Modra 2016-02-17 03:36:52 UTC
My analysis of the pr69461 patch, specifically the simplify_operand_subreg change, says it can indeed be expected to fix this problem.  ie. this bug is fixed.

*** This bug has been marked as a duplicate of bug 69461 ***