Bug 28421

Summary: [4.0 Regression] ICE with SSE code in extract_insn, at recog.c:2020
Product: gcc Reporter: Michael Cieslinski <micis>
Component: targetAssignee: Not yet assigned to anyone <unassigned>
Status: RESOLVED WONTFIX    
Severity: normal CC: gcc-bugs
Priority: P3 Keywords: ice-on-valid-code
Version: 4.0.3   
Target Milestone: 4.0.4   
Host: Target: x86_64-*-linux-gnu
Build: Known to work: 4.2.0 3.4.0
Known to fail: 4.0.3 Last reconfirmed: 2006-09-03 06:28:09

Description Michael Cieslinski 2006-07-18 14:31:17 UTC
I get an ICE when I compile at -O1 (and only at -O1).
With the original source only gcc403 ICEs but not gcc401.
With the reduced source gcc401 ICEs too.

Michael Cieslinski


g++403 -O1 -S mb.ii -v
Using built-in specs.
Target: x86_64-unknown-linux-gnu
Configured with: ../gcc-4.0.3/configure --prefix=/usr/local/gcc403 --program-suffix=403 --with-arch=opteron --enable-languages=c,c++
Thread model: posix
gcc version 4.0.3
 /usr/local/gcc403/libexec/gcc/x86_64-unknown-linux-gnu/4.0.3/cc1plus -fpreprocessed mb.ii -quiet -dumpbase mb.ii -march=opteron -auxbase mb -O1 -version -o mb.s
GNU C++ version 4.0.3 (x86_64-unknown-linux-gnu)
        compiled by GNU C version 4.0.3.
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
mb.ii: In function 'long int __vector__ foo()':
mb.ii:29: error: unrecognizable insn:
(insn 109 30 96 3 (set (reg:V2SI 0 ax)
        (const_vector:V2SI [
                (const_int -1 [0xffffffffffffffff])
                (const_int -1 [0xffffffffffffffff])
            ])) -1 (nil)
    (nil))
mb.ii:29: internal compiler error: in extract_insn, at recog.c:2020


mb.ii:

typedef long V2 __attribute__ ((__vector_size__(16)));
typedef int  V4 __attribute__ ((__vector_size__(16)));

int bar(V2);


__inline V2 baz(int a, int b)
{
    return (V4) {a, b};
}


V2 foo ()
{
    V2*     G;
    int*    H;
    V2      A;

    for (int E; E<10; E++)
    {
        G++;
        for (int F; F<E; F++)
        {
            *G = baz(0x0ffffffff, 0x0ffffffff);
            *H =   bar(__builtin_ia32_psrldqi128(A,  8))
                 | bar(__builtin_ia32_psrldqi128(A, 96));
        }
    }
}
Comment 1 Andrew Pinski 2006-07-18 14:40:45 UTC
(reg:V2SI 0 ax)
HUH, how can that happen.
Comment 2 Andrew Pinski 2006-09-03 06:28:09 UTC
Reload 1: reload_in (V2SI) = (const_vector:V2SI [
                                                        (const_int -1 [0xffffffffffffffff])
                                                        (const_int -1 [0xffffffffffffffff])
                                                    ])
        GENERAL_REGS, RELOAD_FOR_INPUT (opnum = 1), can't combine
        reload_in_reg: (reg:V2SI 88)
        reload_reg_rtx: (reg:V2SI 0 ax)
There is a problem first with overflowed integers that the back-end does not understand in 4.0.x which was fixed in 4.1.0.

This is also a regression from 3.4.0 so confirmed.
Comment 3 Gabriel Dos Reis 2007-02-03 18:04:08 UTC
Won't fix in GCC-4.0.x.