This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PR49888, VTA] don't keep VALUEs bound to modified MEMs
- From: Alexandre Oliva <aoliva at redhat dot com>
- To: John David Anglin <dave dot anglin at bell dot net>
- Cc: "H.J. Lu" <hjl dot tools at gmail dot com>, Richard Henderson <rth at redhat dot com>, Jakub Jelinek <jakub at redhat dot com>, gcc-patches at gcc dot gnu dot org
- Date: Fri, 06 Jul 2012 08:24:03 -0300
- Subject: Re: [PR49888, VTA] don't keep VALUEs bound to modified MEMs
- References: <orhav7nt6u.fsf@livre.localdomain> <20120523101349.GN16117@tyan-ft48-01.lab.bos.redhat.com> <ory5o1d04j.fsf@livre.localdomain> <4FD7A9BE.4080405@redhat.com> <CAMe9rOpkfzxZir5mFAcb1bPGS=2NROQvwnAJ-eCoif-_-isFnA@mail.gmail.com> <oraa04z05s.fsf@livre.localdomain> <CAMe9rOpYRP-NwH_TwFFcGWS4CEk=O2qENW5+3abgRWNsZTZgXg@mail.gmail.com> <orboke1vyr.fsf@livre.localdomain> <ory5ngxg42.fsf@livre.localdomain>
On Jun 21, 2012, Alexandre Oliva <aoliva@redhat.com> wrote:
> Here's one more patch that addresses a problem I found out while
> investigating the PR53671 regressions: rather than recording incoming
> stack args as MEMs with non-VALUE expressions, it's more consistent (and
> less surprising) if we emit them as VALUE expressions, like other MEMs.
> Regstrapped on x86_64-linux-gnu and i686-linux-gnu. Ok?
> for gcc/ChangeLog
> from Alexandre Oliva <aoliva@redhat.com>
> * var-tracking.c (vt_add_function_parameter): Use a preserved
> VALUE for the MEM address of an incoming parameter.
This caused the bug described in PR debug/53820.
PA64 uses a pseudo for the internal arg pointer. This pseudo isn't
recorded as a preserved VALUE, and it doesn't really make sense to
record a use of this pseudo at the entry point, before it is even set.
There's also code that prevents us from using pseudos in var-tracking.
This patch arranges for the internal arg pointer to be substituted for
the actual arg pointer. John David Angling verified that the patch
fixes the problem on the affected platform. I regstrapped it on x86_64-
and i686-linux-gnu. I'm checking it in momentarily, as obvious.
for gcc/ChangeLog
from Alexandre Oliva <aoliva@redhat.com>
PR debug/53820
* var-tracking.c (vt_add_function_parameter): Convert
internal_arg_pointer into arg_pointer-based address even
without DRAP.
Index: gcc/var-tracking.c
===================================================================
--- gcc/var-tracking.c.orig 2012-07-02 10:51:19.036061050 -0300
+++ gcc/var-tracking.c 2012-07-02 12:14:04.000000000 -0300
@@ -9327,14 +9327,11 @@ vt_add_function_parameter (tree parm)
if (GET_MODE (decl_rtl) == BLKmode || GET_MODE (incoming) == BLKmode)
return;
- /* If there is a DRAP register, rewrite the incoming location of parameters
- passed on the stack into MEMs based on the argument pointer, as the DRAP
- register can be reused for other purposes and we do not track locations
- based on generic registers. But the prerequisite is that this argument
- pointer be also the virtual CFA pointer, see vt_initialize. */
+ /* If there is a DRAP register or a pseudo in internal_arg_pointer,
+ rewrite the incoming location of parameters passed on the stack
+ into MEMs based on the argument pointer, so that incoming doesn't
+ depend on a pseudo. */
if (MEM_P (incoming)
- && stack_realign_drap
- && arg_pointer_rtx == cfa_base_rtx
&& (XEXP (incoming, 0) == crtl->args.internal_arg_pointer
|| (GET_CODE (XEXP (incoming, 0)) == PLUS
&& XEXP (XEXP (incoming, 0), 0)
--
Alexandre Oliva, freedom fighter http://FSFLA.org/~lxoliva/
You must be the change you wish to see in the world. -- Gandhi
Be Free! -- http://FSFLA.org/ FSF Latin America board member
Free Software Evangelist Red Hat Brazil Compiler Engineer