This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: GCC4 x86_64 pushfl / pop %eax inline asm ?
- From: Ian Lance Taylor <iant at google dot com>
- To: Darryl Miles <darryl-mailinglists at netbauds dot net>
- Cc: gcc-help at gcc dot gnu dot org
- Date: 14 Jun 2006 10:08:11 -0700
- Subject: Re: GCC4 x86_64 pushfl / pop %eax inline asm ?
- References: <44904061.30601@netbauds.net>
Darryl Miles <darryl-mailinglists@netbauds.net> writes:
> How do I do this with GCC 4 ? This works with GCC3 on i386, but not
> on GCC4 on x86_64. Any advise on what #ifdef to put in place or if
> there is one way that works with both GCC versions ?
>
> From the output of GCC test.c => test.s
>
> #APP
>
> pushfl
> popl %eax
>
> #NO_APP
>
> Yeilds errors on GCC4 x86_64:
>
> test.s:2287: Error: suffix or operands invalid for `pushf'
> test.s:2288: Error: suffix or operands invalid for `pop'
Those errors are coming from the assembler. This is an assembler
issue, not a gcc issue.
This one happens to be simple: the x86_64 does not have a pushfl
instruction. Read the fine manual. The x86_64 does have a pushfq
instruction.
Ian