------- Comment #3 from carrot at google dot com  2010-03-26 06:42 -------
There are 2 problems with csa for arm:

1. In function rest_of_handle_stack_adjustments:

  if (!ACCUMULATE_OUTGOING_ARGS)
    {
      ...
    }

   ACCUMULATE_OUTGOING_ARGS is defined to 1 in arm.h, so this pass is not
applied to arm back end.

2. Even if I change the condition to enable it, the stack adjustments are still
not combined. 

   Following are related insns:

        ...

(insn/f 117 116 118 2 src/t9.c:5 (set (reg/f:SI 13 sp)
        (plus:SI (reg/f:SI 13 sp)
            (const_int -12 [0xfffffffffffffff4]))) -1 (nil))

(insn 118 117 119 2 src/t9.c:5 (set (mem:BLK (scratch) [0 A8])
        (unspec:BLK [
                (reg/f:SI 13 sp)
                (reg/f:SI 7 r7)
            ] 5)) -1 (nil))

(insn/f 119 118 120 2 src/t9.c:5 (set (reg/f:SI 7 r7)
        (plus:SI (reg/f:SI 13 sp)
            (const_int 0 [0x0]))) -1 (nil))

       ...

(insn 55 50 57 2 src/t9.c:7 (set (reg/f:SI 13 sp)
        (plus:SI (reg/f:SI 13 sp)
            (const_int -48 [0xffffffffffffffd0]))) 4 {*arm_addsi3} (nil))

       ...

    Among them insn 118 trigger the following code in function
combine_stack_adjustments_for_block, and prevent the combine of stack
adjustment codes. It is emitted along with insn 117.

      /* Otherwise, we were not able to process the instruction.
         Do not continue collecting data across such a one.  */
      if (last_sp_set
          && (CALL_P (insn)
              || reg_mentioned_p (stack_pointer_rtx, PATTERN (insn))))
        {
           /* Clear the collected stack references. */
            ...
        } 


-- 


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

Reply via email to