This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug target/46254] New: ICE: in find_reloads, at reload.c:3806 (unable to generate reloads) with -fPIC -mcmodel={medium|large} and __sync_val_compare_and_swap


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46254

           Summary: ICE: in find_reloads, at reload.c:3806 (unable to
                    generate reloads) with -fPIC -mcmodel={medium|large}
                    and __sync_val_compare_and_swap
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: zsojka@seznam.cz


----- testcase.c -----
typedef int int128_t __attribute__ ((mode (TI)));
int128_t i;
void foo ()
{
  __sync_val_compare_and_swap (&i, i, i);
}
----------------------

Compiler output - 4.6:
$ gcc -mcx16 -fPIC -mcmodel=large testcase.c
testcase.c: In function 'foo':
testcase.c:6:1: error: unable to generate reloads for:
(insn 17 16 20 2 (parallel [
            (set (reg:TI 0 ax [69])
                (mem/v:TI (reg/f:DI 37 r8 [68]) [-1 S16 A128]))
            (set (mem/v:TI (reg/f:DI 37 r8 [68]) [-1 S16 A128])
                (unspec_volatile:TI [
                        (mem/v:TI (reg/f:DI 37 r8 [68]) [-1 S16 A128])
                        (reg:TI 0 ax [orig:62 i.3 ] [62])
                        (reg:DI 70)
                        (reg:DI 2 cx [71])
                    ] UNSPECV_CMPXCHG))
            (set (reg:CCZ 17 flags)
                (compare:CCZ (unspec_volatile:TI [
                            (mem/v:TI (reg/f:DI 37 r8 [68]) [-1 S16 A128])
                            (reg:TI 0 ax [orig:62 i.3 ] [62])
                            (reg:DI 70)
                            (reg:DI 2 cx [71])
                        ] UNSPECV_CMPXCHG)
                    (reg:TI 0 ax [orig:62 i.3 ] [62])))
        ]) testcase.c:5 2083 {sync_double_compare_and_swapti}
     (expr_list:REG_DEAD (reg:DI 2 cx [71])
        (expr_list:REG_DEAD (reg:DI 70)
            (expr_list:REG_DEAD (reg/f:DI 37 r8 [68])
                (expr_list:REG_DEAD (reg:TI 0 ax [orig:62 i.3 ] [62])
                    (expr_list:REG_UNUSED (reg:TI 0 ax [69])
                        (expr_list:REG_UNUSED (reg:CCZ 17 flags)
                            (nil))))))))
testcase.c:6:1: internal compiler error: in find_reloads, at reload.c:3806
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

Compiler output - 4.5:
$ gcc -mcx16 -fPIC -mcmodel=large testcase.c
testcase.c: In function 'foo':
testcase.c:6:1: error: unable to find a register to spill in class 'BREG'
testcase.c:6:1: error: this is the insn:
(insn 17 16 20 2 testcase.c:5 (parallel [
            (set (reg:TI 0 ax [68])
                (mem/v:TI (reg/f:DI 37 r8 [67]) [-1 S16 A0]))
            (set (mem/v:TI (reg/f:DI 37 r8 [67]) [-1 S16 A0])
                (unspec_volatile:TI [
                        (mem/v:TI (reg/f:DI 37 r8 [67]) [-1 S16 A0])
                        (reg:TI 0 ax [orig:61 i.3 ] [61])
                        (reg:DI 69)
                        (reg:DI 2 cx [70])
                    ] 10))
            (set (reg:CCZ 17 flags)
                (compare:CCZ (unspec_volatile:TI [
                            (mem/v:TI (reg/f:DI 37 r8 [67]) [-1 S16 A0])
                            (reg:TI 0 ax [orig:61 i.3 ] [61])
                            (reg:DI 69)
                            (reg:DI 2 cx [70])
                        ] 10)
                    (reg:TI 0 ax [orig:61 i.3 ] [61])))
        ]) 2050 {sync_double_compare_and_swapti} (expr_list:REG_DEAD (reg:DI 2
cx [70])
        (expr_list:REG_DEAD (reg:DI 69)
            (expr_list:REG_DEAD (reg/f:DI 37 r8 [67])
                (expr_list:REG_DEAD (reg:TI 0 ax [orig:61 i.3 ] [61])
                    (expr_list:REG_UNUSED (reg:TI 0 ax [68])
                        (expr_list:REG_UNUSED (reg:CCZ 17 flags)
                            (nil))))))))
testcase.c:6:1: internal compiler error: in spill_failure, at reload1.c:2157
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

Compiler output - 4.4:
$ gcc -mcx16 -fPIC -mcmodel=large testcase.c
testcase.c: In function 'foo':
testcase.c:6: error: unable to find a register to spill in class 'BREG'
testcase.c:6: error: this is the insn:
(insn 17 16 25 2 testcase.c:5 (parallel [
            (set (reg:TI 0 ax [68])
                (mem/v:TI (reg/f:DI 37 r8 [67]) [-1 S16 A0]))
            (set (mem/v:TI (reg/f:DI 37 r8 [67]) [-1 S16 A0])
                (unspec_volatile:TI [
                        (mem/v:TI (reg/f:DI 37 r8 [67]) [-1 S16 A0])
                        (reg:TI 0 ax [orig:58 i.3 ] [58])
                        (reg:DI 69)
                        (reg:DI 2 cx [70])
                    ] 10))
            (clobber (reg:CC 17 flags))
        ]) 1993 {sync_double_compare_and_swapti} (expr_list:REG_DEAD (reg:DI 2
cx [70])
        (expr_list:REG_DEAD (reg:DI 69)
            (expr_list:REG_DEAD (reg/f:DI 37 r8 [67])
                (expr_list:REG_DEAD (reg:TI 0 ax [orig:58 i.3 ] [58])
                    (expr_list:REG_UNUSED (reg:TI 0 ax [68])
                        (expr_list:REG_UNUSED (reg:CC 17 flags)
                            (nil))))))))
testcase.c:6: internal compiler error: in spill_failure, at reload1.c:2092
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

Tested revisions:
r166105 - crash
4.5 r165781 - crash
4.4 r165754 - crash
4.3.5 - crash
4.2.4 - unimplemented


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]