This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: problem with subregs.
- From: "Tal Agmon" <Tal dot Agmon at nsc dot com>
- To: "Jim Wilson" <wilson at specifixinc dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Mon, 10 Nov 2003 12:56:17 +0200
- Subject: Re: problem with subregs.
Tal Agmon wrote:
>>Thank you, I used the macro CANNOT_CHANGE_MODE_CLASS and it worked on
most cases
>>(I'm using gcc-3.4-20031029). Here is an example where it fails:
>>In our architecture pointer size is 32 bits and int size is 16 bits. I
tried to compile a program that
>>contains the line a = &b - &c; (a is int) and the compiler issued the
error:
>>internal compiler error: in ?, at gcc-3.3.2\gcc\function.c:3776
>>The insn that cause this is:
>>(insn 350 1020 351 61 007A63F0 (set (reg:HI 79)
>> (minus:HI (subreg:HI (reg/v/f:SI 24) 0)
>> (subreg:HI (reg/f:SI 17 virtual-stack-vars) 0))) -1 (nil)
>> (nil))
>>The problem here is in the rtl (subreg:HI (reg/f:SI 17
virtual-stack-vars) 0).
>>The frame pointer in our architecture is a 32 bits reg and changing the
mode here is not allowed
>>according to the macro.
Jim Wilson wrote:
>Reload should do this for you already.
>Note that what reload does is emit move instructions in order to make
>the result valid, and thus reload_in/reload_out work in all cases,
>because they are for the move instruction that reload emits.
>Look at the reloads generated for the problematic instruction, and make
>sure that they are right. debug_reload() will print them. Also, they
>are in the greg dump, but this assumes reload gets far enough to emit
>the data to the dump file.
This is not a reload problem, The problem is in much earlier stage,
in instantiate_virtual_regs(). From this function (from
instantiate_virtual_regs_1() actually) instantiate_new_reg() is called.
In this function virtual-stack-var is replaced with the frame pointer
(r13) which is long (SImode) and then run into the abort() in
instantiate_virtual_regs_lossage() since it fails to recognize the
insn with the subreg of the long reg r13.
Regards,
Tal.