This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: ada/4848: Internal compiler error in instantiate_virtual_regs _1, at function.c:3904
- To: "Unruh, Erwin" <Erwin dot Unruh at fujitsu-siemens dot com>
- Subject: Re: ada/4848: Internal compiler error in instantiate_virtual_regs _1, at function.c:3904
- From: Jakub Jelinek <jakub at redhat dot com>
- Date: Mon, 12 Nov 2001 12:48:51 +0100
- Cc: gcc at gcc dot gnu dot org
- References: <2BFFCAFAC0A7D4119FE7009027FD762201930529@mchrd21e.mch.fsc.net>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Mon, Nov 12, 2001 at 12:34:12PM +0100, Unruh, Erwin wrote:
> Hello,
>
> I have found a similar problem a few days ago. I got an abort at exactly the
> same place, but in a different, yet unpublished port.
>
> My reasoning was:
>
> I found an inconsistency between recog.c and genrecog.c. It is related to the
> handling of ADDRESSOF.
>
> In recog.c:register_operand a rtx with code ADDRESSOF is allowed. In the
> variable genrecog.c:preds however there is no mentioning of this code.
>
> But instruction recognizing is used when such codes are still alive. One such
> point is instantiate_virtual_regs.
>
> I am working on a new port and got hit by
>
> (insn 12 7 13 (set (reg:CC 100 %icc)
> (compare:CC (addressof:SI (reg/v:SI 108) 107 374bc8)
> (reg/f:SI 102 virtual-stack-vars))) -1 (nil)
> (nil))
>
> when compiling a small program with optimization:
>
> void f() { long a, b[6]; a = ( &a < b ); }
>
> When replacing the virtual-stack-vars register the recognition of the
> instruction failed because the compare required two registers. The stack grows
> upward so a local variable could be at offset 0 from that register.
>
> I made some corrections in genrecog.c and realized that the definition of
> PREDICATE_CODES has to be checked in all ports.
This is similar to http://gcc.gnu.org/ml/gcc-patches/2001-02/msg01615.html,
see followup where Richard sais he doesn't like this solution and prefers a
different fix.
Jakub