GCC-H8300: possible bug in emit_single_push_insn

Toshi Morita tm2@best.com
Mon Apr 2 15:52:00 GMT 2001


version: CVS 
   host: i686-linux
 target: h8300-coff

H8300-coff fails to build in CVS, and I think I've tracked down why.

In the source file which elicits the bug, there is a function call in this format:

    func(HImode, HImode, DImode)

So, store_one_arg() is called three times, twice for HImode and once for DImode.

This code is executed to generate the function call:

      /* Generate the actual call instruction.  */
      emit_call_1 (funexp, fndecl, funtype, unadjusted_args_size,
                   adjusted_args_size.constant, struct_value_size,
                   next_arg_reg, valreg, old_inhibit_defer_pop, call_fusage,
                   flags);

      /* Verify that we've deallocated all the stack we used.  */
      if (pass
          && old_stack_allocated != stack_pointer_delta - pending_stack_adjust)
        abort ();

The abort() in the last line is triggered because:

old_stack_allocated = 0
stack_pointer_delta = 20
pending_stack_adjust = 12

This occurs because stack_pointer_delta is updated TWICE for the DImode parameter.

This is the call sequence which occurs:

store_one_arg()
    emit_push_insn()
        emit_single_push_insn()          expr.c:3159, stack_pointer_delta updated
            emit_move_insn()
                emit_move_insn_1()
                    anti_adjust_stack()  explow.c:958, stack_pointer_delta updated again


>From looking at other calls to anti_adjust_stack, it appears that it should be updating
stack_pointer_delta.

So, it appears emit_single_push_insn should not be updating stack_pointer_delta.

Can someone verify that this conclusion is indeed correct?


Toshi



More information about the Gcc-bugs mailing list