This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Reload and addsi
- From: Ian Lance Taylor <iant at google dot com>
- To: Hendrik Greving <hendrik dot greving dot intel at gmail dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Wed, 5 Jun 2013 17:19:08 -0700
- Subject: Re: Reload and addsi
- References: <CANc4vhrRMndJUsNOmB4tdmxXTHoHqHhOjejfjYyycUT4jfxj0A at mail dot gmail dot com>
On Wed, Jun 5, 2013 at 9:14 AM, Hendrik Greving
<hendrik.greving.intel@gmail.com> wrote:
> I am looking at a case (old GCC 3.2.3 is used), which I like to
> outline as follow:
Are you really asking about GCC 3.2.3, released over 10 years ago?
> (insn 2219 2218 2220 (nil) (set (reg:SI 1296)
> (plus:SI (subreg:SI (reg/v:HI 1277) 0)
> (const_int 1 [0x1]))) -1 (nil)
> (nil))
This is a paradoxical subreg. It means that the bits in reg 1277
outside of HImode are irrelevant.
> (insn 2219 2227 2221 60 0x2aaaad83aa80 (set (reg:SI 1296)
> (plus:SI (subreg:SI (reg/v:HI 879) 0)
> (const_int 1 [0x1]))) 9 {addsi3} (nil)
> (expr_list:REG_DEAD (reg/v:HI 879)
> (nil)))
>
> As you can see is, what happens is that the addsi insn 2219 in 22.lreg
> (we only have addsi, not addhi), is getting a reload, but what happens
> to be a HI, is now fully SI resulting into a 32 bit load later in the
> assembly.
>
> Question: is it possible to say, is this a bug or a feature?
Based on what you have shown, it is not a bug.
Ian