This is the mail archive of the gcc@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]

Re: Reloading index register


  In message <199710180228.PAA27273@ongaonga.chch.cri.nz>you write:
  > 
  > Can anybody who understands the reload pass enlighten me why it
  > generates,
  > 
  > (set (reg index2) (reg dud))
  > (set (reg index2) (mem (plus (reg base2) (reg index2))))
  > (set (reg r0) (minus (mem (plus (reg base1) (reg index1)))
  >                      (reg index2)))
  > 
  > instead of the better code,
  > 
  > (set (reg index2) (reg dud))
  > (set (reg r0) (minus (mem (plus (reg base1) (reg index1)))
  >                      (mem (plus (reg base2) (reg index2)))))
  > 
  > for the code fragment,
  > 
  > (set (reg r0) (minus (mem (plus (reg base1) (reg index1)))
  >                      (mem (plus (reg base2) (reg dud)))))
  > 
  > where the global register allocator couldn't assign reg dud to an
  > index register and so reload spills index register index2 to obtain a
  > reload register.
Nope.  But there's ways to figure out why.

Break in find_reloads for the insn in question, then look at calls
to push_reload and push_secondary_reload to see what pieces of
RTL the compiler thinks it needs to reload.  It may be the case that
it thinks the whole (mem (...)) needs to be reloaded.

jeff


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