This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [x86] Fix PR target/48142
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Uros Bizjak <ubizjak at gmail dot com>
- Cc: gcc-patches at gcc dot gnu dot org, Eric Botcazou <ebotcazou at adacore dot com>
- Date: Thu, 31 Mar 2011 12:09:30 +0200
- Subject: Re: [x86] Fix PR target/48142
- References: <AANLkTinW=6+gZfe-Kg_pVSk22bFnpKpYMjiif=MyLdux@mail.gmail.com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
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