lkml.org 
[lkml]   [2000]   [Mar]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Serious bug in save_flags


On Sun, 19 Mar 2000, Alan Modra wrote:
>
> Unless I'm very much mistaken, I've hit a bad problem with save_flags and
> restore_flags on x86 with --fomit-frame-pointer.

You're mistaken.

The magic to know about is that the x86 will, for a "pop" instruction, use
the %esp _after_ the pop for any modrm calculations, so

pushfl
popl 0x18(%esp)

the "0x18(%esp)" address will be calculated using %esp after the popl,
which is obviously the same as the %esp before the pushfl, which in turn
is exactly what gcc thinks it should be.

Of course, this didn't used to be true - one of the changes between the
286 and the 386 was exactly this "which %esp will be used" issue (or maybe
it was between the 186 and the 286 - quite a long time ago, in any case).
However, it had been an undocumented issue until then, and it IS
documented now.

Linus


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:57    [W:0.045 / U:0.296 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site