This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: GCC fails with -O2 for own Target
- From: Ian Lance Taylor <iant at google dot com>
- To: Jens Mehler <jens dot mehler at mni dot thm dot de>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Wed, 31 Jul 2013 11:49:02 -0700
- Subject: Re: GCC fails with -O2 for own Target
- References: <51F08182 dot 3070406 at mni dot thm dot de> <CAKOQZ8z1XQgyyciAt1SNgPK8cR=GkVgOQQa2pcdGVerpKTiS3Q at mail dot gmail dot com> <51F90496 dot 2030102 at mni dot thm dot de>
On Wed, Jul 31, 2013 at 5:35 AM, Jens Mehler <jens.mehler@mni.thm.de> wrote:
> After testing around I came up with a much easier example to reproduce my
> error:
>
> static unsigned char sbox[256];
>
> void
> test(void)
> {
> int n;
> for (n = 0; n < 256; n++)
> sbox[n] = (unsigned char) n;
> }
>
> This results in the same error massage:
> test3.c: In function 'test':
> test3.c:4:1: internal compiler error: in gen_lowpart_general, at
> rtlhooks.c:59
>
> Via GDB I was able to print the RTX in question:
> As you can see the code is SYMBOL_REF and therefore the error.
> I am not really sure how to track that any futher.
You need to find out what is asking for the low part of a SYMBOL_REF.
Some targets can not load a symbol into a register. Those target
break up the SYMBOL_REF in some form, typically into a PLUS of a HIGH
and a LO_SUM. For example, the MIPS backend works this way. You may
need to do something similar.
Ian