Bug 26562

Summary: [4.0 Regression] unrecognizable insn with huge symbol offset with -fPIC
Product: gcc Reporter: Debian GCC Maintainers <debian-gcc>
Component: targetAssignee: Not yet assigned to anyone <unassigned>
Status: RESOLVED FIXED    
Severity: normal CC: gcc-bugs, meissner, pinskia
Priority: P3 Keywords: ice-on-valid-code
Version: 4.0.3   
Target Milestone: 4.1.0   
Host: Target: x86_64-linux-gnu
Build: Known to work: 4.1.0 4.2.0 3.3.6
Known to fail: 4.0.2 4.0.3 3.4.3 Last reconfirmed: 2006-03-04 19:37:36
Bug Depends on: 24683    
Bug Blocks:    

Description Debian GCC Maintainers 2006-03-04 19:07:24 UTC
[forwarded from http://bugs.debian.org/349268]

gcc version 4.0.2 (Debian 4.0.2-2)

falk@pergolesi:~% cat test.c
extern int x[];
static int **STACK;

static void get_block() {
    while (1)
        STACK[0] = x + (1L << 48);
}

falk@pergolesi:~% gcc -c test.c
falk@pergolesi:~% gcc -c test.c -O
falk@pergolesi:~% gcc -c test.c -O -fPIC
test.c: In function 'get_block':
test.c:7: error: unrecognizable insn:
(insn 34 33 30 0 (set (reg/f:DI 59)
        (plus:DI (reg:DI 61)
            (const_int 1125899906842624 [0x4000000000000]))) -1 (insn_list:REG_DEP_TRUE 33 (nil))
    (expr_list:REG_DEAD (reg:DI 61)
        (expr_list:REG_EQUAL (const:DI (plus:DI (symbol_ref:DI ("x") [flags 0x40] <var_decl 0x2a959a7ea0 x>)
                    (const_int 1125899906842624 [0x4000000000000])))
            (nil))))
test.c:7: internal compiler error: in extract_insn, at recog.c:2020
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
Comment 1 Andrew Pinski 2006-03-04 19:23:53 UTC
I thought I saw a related bug to this before.
Comment 2 Andrew Pinski 2006-03-04 19:31:30 UTC
And that was PR 24683.
Isn't this fixed in 4.0.3?
Comment 3 Andrew Pinski 2006-03-04 19:36:08 UTC
It still fails as of 20051209.
Comment 4 Andrew Pinski 2006-03-04 19:37:36 UTC
Confirmed, still fails as of 20060225.
Comment 5 Andrew Pinski 2006-03-04 19:44:16 UTC
Still fails as of today.
Comment 6 Gabriel Dos Reis 2007-02-03 16:20:45 UTC
Fixed in GCC-4.1.0