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 c/13366] New: ICE using MMX/SSE builtins with -O


I'm seeing an ICE with GCC 3.2.2 (RH9 build) and GCC 3.4 (20031126 snapshot)
for the following code:

-- CUT
typedef int v4hi __attribute__ ((mode(V4HI)));

int f(unsigned short n)
   {
   v4hi vec = { 0, 0, 1, n };
   v4hi hw = __builtin_ia32_pmulhw(vec, vec);
   return (__builtin_ia32_pextrw(hw,0));
   }
-- CUT

I'm seeing this:

$ gcc-3.4 -v
Reading specs from /usr/local/gcc-3.4-20031126/lib/gcc/i686-pc-linux-gnu/3.4/specs
Configured with: ../gcc-3.4-20031126/configure --prefix=/usr/local/gcc-3.4-20031126
Thread model: posix
gcc version 3.4 20031126 (experimental)

$ gcc-3.4 -O -msse -c bug.c 
bug.c: In function `f':

bug.c:8: error: unable to find a register to spill in class `GENERAL_REGS'
bug.c:8: error: this is the insn:
(insn 13 11 15 0 (parallel [
            (set (subreg:SI (reg/v:V4HI %mm0 [orig:61 vec ] [61]) 0)
                (and:SI (subreg:SI (reg/v:V4HI %mm0 [orig:61 vec ] [61]) 0)
                    (const_int -65536 [0xffff0000])))
            (clobber (reg:CC %eflags))
        ]) 197 {*andsi_1} (insn_list 11 (nil))
    (expr_list:REG_UNUSED (reg:CC %eflags)
        (nil)))
bug.c:8: internal compiler error: in spill_failure, at reload1.c:1854
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.

The ICE with 3.2.2 appears to be basically the same (can't find a register to
spill), but has less detail, and anyway I doubt anyone wants to fix bugs in
3.2.2. This looks an awful lot like bug 9401, but that has been closed
as fixed since last May.

The ICE is only with -O; -O2/-O3 seem to be fine.

BTW, change the '1' in the initializer of 'vec' to produce another ICE (in
emit-rtl.c). This one does not show up with 3.2.2, but my 3.4 doesn't like that 
either.

-- 
           Summary: ICE using MMX/SSE builtins with -O
           Product: gcc
           Version: 3.4
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: lloyd at randombit dot net
                CC: gcc-bugs at gcc dot gnu dot org
  GCC host triplet: i686-pc-linux-gnu


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


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