This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] mudflap: remove usage of builtin_frame_address





Andrew Pinski <pinskia@physics.uc.edu> 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.

B.t.w. building

void *test (void)
{
  return __builtin_frame_address (0);
}

on i386 with -fomit-frame-pointer results in

test:
        pushl   %ebp
        movl    %ebp, %eax
        popl    %ebp
        ret

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

Ulrich Weigand

--
  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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]