This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH] mudflap: remove usage of builtin_frame_address
- From: Ulrich Weigand <Ulrich dot Weigand at de dot ibm dot com>
- To: Andrew Pinski <pinskia at physics dot uc dot edu>
- Cc: Andreas Krebbel1 <KREBBEL1 at de dot ibm dot com>, gcc-patches at gcc dot gnu dot org, rth at redhat dot com
- Date: Thu, 13 Jan 2005 03:47:38 +0100
- Subject: Re: [PATCH] mudflap: remove usage of builtin_frame_address
Andrew Pinski <email@example.com> wrote on 01/13/2005 03:32:39 AM:
> On Jan 12, 2005, at 9:22 PM, Ulrich Weigand wrote:
> > When -fomit-frame-pointer is true, and the function doesn't otherwise
> > require a frame pointer, the hard register hard_frame_pointer_rtx is
> > not set up as frame pointer, and basically contains a random value ...
> But in reload/greg, it gets replaced with the stack based frame pointer.
> At least it does on rs6000 and most likely every other target.
It may happen to work on rs6000 because that doesn't even define
HARD_FRAME_POINTER_REGNUM in the first place, so hard_frame_pointer_rtx
is actually frame_pointer_rtx, which of course works.
But on all platforms that *do* define a HARD_FRAME_POINTER_REGNUM,
including i386, alpha, sparc, ... it is just the other way around:
reload replaces *frame_pointer_rtx* with either hard_frame_pointer_rtx
or stack_pointer_rtx, depending on whether a hard frame pointer is
needed or not.
void *test (void)
return __builtin_frame_address (0);
on i386 with -fomit-frame-pointer results in
movl %ebp, %eax
which doesn't strike me as exactly correct either; this is the very
same problem I'm seeing on s390.
Mit freundlichen Gruessen / Best Regards
Dr. Ulrich Weigand
Linux for S/390 Design & Development
IBM Deutschland Entwicklung GmbH, Schoenaicher Str. 220, 71032 Boeblingen
Phone: +49-7031/16-3727 --- Email: Ulrich.Weigand@de.ibm.com