bug in internal PUSH expanding (splitting)

Jeffrey A Law law@cygnus.com
Wed Dec 15 01:32:00 GMT 1999


  In message <199911012050.XAA27262@tigris.overta.ru>you write:
  > Hello.
  > 
  > I have founded a bug in gcc-2.95.2 in emit_move_insn_1
  > 
  > emit_move_insn_1 produce wrong code for any port which
  > don't have a `movdi' pattern and have STACK_POINTER_OFFSET != 0.
  > 
  > Handle `push' for any multi-word mode that lacks a move_insn are buggy
  > only if STACK_POINTER_OFFSET != 0
  > 
  > Small example (My port have a `#define STACK_POINTER_OFFSET 1'):
  > 
  > void boo (int, ...);
  > foo ()
  > {
  >   boo (1,0x1234567890LL);
  > }
  > 
  > __SPL__  = stack pointer register
  > file.c.rtl:
  > 
  > (insn 8 6 10 (set (reg:HI 32 __SPL__)
  >         (plus:HI (reg:HI 32 __SPL__)
  >             (const_int -8 [0xfffffff8]))) -1 (nil)
  >     (nil))
  > 
  > (insn 10 8 11 (set (reg:HI 41)
  >         (reg:HI 32 __SPL__)) -1 (nil)
  >     (nil))
I think something else is wrong.

I would think you should be referencing the virtual outgoing argument pointer,
not the stack pointer here.  That will be turned into SP + 
STACK_POINTER_OFFSET.

If you look at the c4x port, which has similar characteristics to your port
you'll see something like this in the .rtl dump:


(insn 11 9 13 (set (reg:QI 37)
        (reg:QI 35 virtual-outgoing-args)) -1 (nil)
    (nil))

Then we do stores using r37 as a base register to load up stack parameters.

jeff



More information about the Gcc mailing list