From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5342 invoked by alias); 14 Jun 2006 17:08:31 -0000 Received: (qmail 5331 invoked by uid 22791); 14 Jun 2006 17:08:31 -0000 X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (216.239.45.12) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 14 Jun 2006 17:08:29 +0000 Received: from death.corp.google.com (death.corp.google.com [172.24.0.123]) by smtp-out.google.com with ESMTP id k5EH8PhM009638; Wed, 14 Jun 2006 10:08:25 -0700 Received: from dhcp-172-24-103-66.corp.google.com.google.com (dhcp-172-24-103-66.corp.google.com [172.24.103.66]) (authenticated bits=0) by death.corp.google.com with ESMTP id k5EH8BFJ008739 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 14 Jun 2006 10:08:12 -0700 To: Darryl Miles Cc: gcc-help@gcc.gnu.org Subject: Re: GCC4 x86_64 pushfl / pop %eax inline asm ? References: <44904061.30601@netbauds.net> From: Ian Lance Taylor Date: Wed, 14 Jun 2006 17:08:00 -0000 In-Reply-To: <44904061.30601@netbauds.net> Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.4 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-IsSubscribed: yes Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org X-SW-Source: 2006-06/txt/msg00121.txt.bz2 Darryl Miles 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