This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [3.4/3.5 PATCH/RFA] Fix SH ICE with -O2 -fPIC (PR 15396)
Joern Rennecke <joern.rennecke@superh.com> wrote:
>> * config/sh/sh-protos.h (consttable_operand): Declare.
>> * config/sh/sh.c (consttable_operand): New.
>> * config/sh/sh.md (consttable_4): Use consttable_operand.
>> (consttable_8): Likewise.
>
> This is the wrong approach. putting the value of label into a a constant
> in the text section is not PIC. Does the label address a switch table?
Yep, it seems so.
> I've found a similar problem recently in our local sources. I've fixed it
> by doing the mova fixup differently for PIC.
>
> 2004-05-27 J"orn Rennecke <joern.rennecke@superh.com>
>
> * sh.c (dump_table): New argument start. Changed caller.
> (fixup_mova): New function.
> (find_barrier): Use it.
> (sh_reorg): Likewise. Check for CODE_FOR_casesi_worker_2.
> * sh.md (*casesi_worker): Rename to:
> (casesi_worker_1).
> (casesi_worker_2): New insn.
>
> This is just one of several dozen patches whose merge has been held up
> by PR 15521.
> I had hoped we can avoid this, but it seems I have to create a branch
> for SH support in gcc 3.5 .
I'll try it. Thanks for your explanation.
Regards,
kaz