This is the mail archive of the gcc-patches@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]

[Patch] sh64: Fix ICE with -fPIC


The attached file contains a patch to fix an ICE when
compiling PIC code for SHmedia.

The problem occurs several times with the gcc testsuite
if -fPIC is added to the torture options.
Here's a simple example:

$ cat test12.c
static const char *ar[] = { "one", "two", "three", "four" };
const char **foo(void) {   return &ar[3]; }

$ sh64-elf-gcc -O2 -fPIC -S test12.c
test12.c: In function `foo':
test12.c:3: could not split insn
(insn 32 39 49 (set (reg/f:SI 2 r2 [160])
        (const (plus (unspec[ 
                        (symbol_ref/v:SI ("#ar"))
                    ]  8)
                (const_int 12 [0xc])))) 115 {*movsi_media} (nil)
    (expr_list:REG_EQUIV (const (plus (unspec[ 
                        (symbol_ref/v:SI ("#ar"))
                    ]  8)
                (const_int 12 [0xc])))
        (nil)))

Regression tested on sh-elf/sh-hms-sim and sh64-elf/sh64-sim
both with and without -fPIC added to the torture options.

Steve.

Attachment: gotoff-patch.txt
Description: gotoff-patch.txt


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