On Thu, Mar 31, 2011 at 12:09 PM, Jakub Jelinek <ja...@redhat.com> wrote:
> On Thu, Mar 31, 2011 at 11:58:29AM +0200, Uros Bizjak wrote:
>> +  /* Even if the stack pointer isn't the CFA register, we need to correctly
>> +     describe the adjustments made to it, in particular differentiate the
>> +     frame-related ones from the frame-unrelated ones.  */
>> +  if (size > 0)
>> +    {
>> +      rtx expr = gen_rtx_SEQUENCE (VOIDmode, rtvec_alloc (2));
>> +      XVECEXP (expr, 0, 0)
>> +     = gen_rtx_SET (VOIDmode, stack_pointer_rtx,
>> +                    plus_constant (stack_pointer_rtx, -size));
>> +      XVECEXP (expr, 0, 1)
>> +     = gen_rtx_SET (VOIDmode, stack_pointer_rtx,
>> +                    plus_constant (stack_pointer_rtx,
>> +                                   PROBE_INTERVAL + dope + size));
>> +      add_reg_note (last, REG_FRAME_RELATED_EXPR, expr);
>> +      RTX_FRAME_RELATED_P (last) = 1;
>> +
>> +      cfun->machine->fs.sp_offset += size;
>> +    }
>>
>> Is there a reason why we can't just cancel (+ size and -size) in these
>> two expressions to:
>>
>>  XVECEXP (expr, 0, 0)
>>       = gen_rtx_SET (VOIDmode, stack_pointer_rtx,
>>                      plus_constant (stack_pointer_rtx,
>>                                     PROBE_INTERVAL + dope));
>
> Yes, in RTX_FRAME_RELATED_P parallels dwarf2out only looks at
> RTX_FRAME_RELATED_P sets or the first set.  See dwarf2out_frame_debug_expr
> for more details.

Jakub, thanks for explanation, I was not aware of this fact.

2011-03-30  Eric Botcazou  <ebotca...@adacore.com>

        PR target/48142
        * config/i386/i386.c (ix86_adjust_stack_and_probe): Differentiate
        frame-related from frame-unrelated adjustments to the stack pointer.

I guess that patch is OK then.

Thanks,
Uros.

Reply via email to