This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug middle-end/15927] THUMB -O2: strength-reduced iteration variable ends up off by 1


------- Additional Comments From rearnsha at gcc dot gnu dot org  2004-06-22 14:41 -------
Confrimed.  Also occurs on the trunk with similar compilation options.

I dont' think this is related to the two reports you cite.  In fact, I suspect
it's a problem with validating that a register hasn't already been allocated for
use in reloads in the current insn.  Looking earlier in the greg dump (m2.c) we see:

Reloads for insn # 44
Reload 0: LO_REGS, RELOAD_FOR_OPERAND_ADDRESS (opnum = 1), can't combine,
secondary_reload_p
	reload_reg_rtx: (reg:SI 2 r2)
Reload 1: reload_in (SI) = (reg/v/f:SI 102 [ xb ])
	reload_out (SI) = (reg/v/f:SI 102 [ xb ])
	BASE_REGS, RELOAD_OTHER (opnum = 1)
	reload_in_reg: (reg/v/f:SI 102 [ xb ])
	reload_out_reg: (reg/v/f:SI 102 [ xb ])
	reload_reg_rtx: (reg:SI 1 r1)
	secondary_out_reload = 0

Reload 2: reload_out (SI) = (reg/v:SI 106 [ y ])
	LO_REGS, RELOAD_FOR_OUTPUT (opnum = 0)
	reload_out_reg: (reg/v:SI 106 [ y ])
	reload_reg_rtx: (reg:SI 2 r2)

and from this we can see that r2 is allocated (reload_reg_rtx) for use by both
reload 0 and reload 2.  

As an aside, it's not entirely obvious to me why reload thinks that the first
reload is needed at all in this case: it could be in some circumstances, but in
this instance we can directly load/store the base address from the stack, and
directly store the result to the stack.  A third reload seems to be redundant.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rearnsha at gcc dot gnu dot
                   |                            |org
             Status|UNCONFIRMED                 |NEW
          Component|rtl-optimization            |middle-end
     Ever Confirmed|                            |1
      Known to fail|                            |3.4.0 3.5.0
   Last reconfirmed|0000-00-00 00:00:00         |2004-06-22 14:41:39
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15927


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]