From patchwork Wed Dec 1 00:36:23 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Lance Taylor X-Patchwork-Id: 73690 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 038D5B70DF for ; Wed, 1 Dec 2010 11:36:47 +1100 (EST) Received: (qmail 25884 invoked by alias); 1 Dec 2010 00:36:45 -0000 Received: (qmail 25591 invoked by uid 22791); 1 Dec 2010 00:36:44 -0000 X-SWARE-Spam-Status: No, hits=-4.7 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI, SPF_HELO_PASS, T_RP_MATCHES_RCVD, T_TVD_MIME_NO_HEADERS X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (74.125.121.35) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 01 Dec 2010 00:36:37 +0000 Received: from wpaz21.hot.corp.google.com (wpaz21.hot.corp.google.com [172.24.198.85]) by smtp-out.google.com with ESMTP id oB10aXwH024290 for ; Tue, 30 Nov 2010 16:36:34 -0800 Received: from iwn39 (iwn39.prod.google.com [10.241.68.103]) by wpaz21.hot.corp.google.com with ESMTP id oB10aVAI004590 for ; Tue, 30 Nov 2010 16:36:32 -0800 Received: by iwn39 with SMTP id 39so7699524iwn.13 for ; Tue, 30 Nov 2010 16:36:31 -0800 (PST) Received: by 10.231.145.209 with SMTP id e17mr1816398ibv.8.1291163789241; Tue, 30 Nov 2010 16:36:29 -0800 (PST) Received: from coign.google.com ([67.218.104.238]) by mx.google.com with ESMTPS id d21sm7421778ibg.3.2010.11.30.16.36.26 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 30 Nov 2010 16:36:28 -0800 (PST) From: Ian Lance Taylor To: gcc-patches@gcc.gnu.org Subject: [Ian Lance Taylor] PATCH RFC: Simplify ASM_SPEC in config/i386 Date: Tue, 30 Nov 2010 16:36:23 -0800 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 X-System-Of-Record: true X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org There were no comments on this patch. I have committed it to mainline. Ian The various instances of ASM_SPEC in config/i386 have evidently been copied from one another, and were originally copied from the ASM_SPEC now in config/sol2.h. That ASM_SPEC has these specs: %{v:-V} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Yd,*} None of these make sense when using the GNU assembler. The GNU assembler handles -V like -v anyhow. The -Qy and -Qn options are no-ops. The -n option means to not emit nop instructions for alignment within code sections; this differs from the Solaris assembler -n option, which means to suppress warnings. The -T and -Y options are errors for the GNU assembler. Also, the spec %{Wa,*:%*} appears in many copies ASM_SPEC in config/i386, but is useless because this is handled by the gcc driver anyhow. This patch attempts to clean this up in config/i386. The immediate motivator for this cleanup is that currently gcc -o x x.c -T x.ld fails, because the -T option is passed to the assembler. It should only be passed to the linker. This is a bug, which I think makes this patch acceptable during stage 3. I've bootstrapped this on x86_64-unknown-linux-gnu and I've run the i386 specific tests. I don't require approval for this change but I would appreciate if the x86 maintainers could take a look to make sure that I didn't make any mistakes. Thanks. Ian 2010-11-22 Ian Lance Taylor * config/i386/linux.h (ASM_SPEC): Pass -v as -v, not -V. Remove all of %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Yd,*} %{Wa,*:%*}. * config/i386/linux64.h (ASM_SPEC): Likewise. * config/i386/mingw-w64.h (ASM_SPEC): Likewise. * config/i386/sol2-10.h (ASM_SPEC) [USE_GAS]: Likewise. * config/i386/vxworks.h (ASM_SPEC): Likewise. * config/i386/x86-64.h (ASM_SPEC): Likewise. * config/i386/sol2.h (ASM_SPEC): Remove %{Wa,*:%*}. * config/i386/sol2-10.h (ASM_SPEC) [!USE_GAS]: Likewise. Index: config/i386/linux.h =================================================================== --- config/i386/linux.h (revision 167038) +++ config/i386/linux.h (working copy) @@ -104,8 +104,7 @@ along with GCC; see the file COPYING3. #undef ASM_SPEC #define ASM_SPEC \ - "%{v:-V} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Yd,*} %{Wa,*:%*} --32 \ - %{!mno-sse2avx:%{mavx:-msse2avx}} %{msse2avx:%{!mavx:-msse2avx}}" + "%{v} --32 %{!mno-sse2avx:%{mavx:-msse2avx}} %{msse2avx:%{!mavx:-msse2avx}}" #undef SUBTARGET_EXTRA_SPECS #define SUBTARGET_EXTRA_SPECS \ Index: config/i386/mingw-w64.h =================================================================== --- config/i386/mingw-w64.h (revision 167038) +++ config/i386/mingw-w64.h (working copy) @@ -36,8 +36,7 @@ along with GCC; see the file COPYING3. /* Enable multilib. */ #undef ASM_SPEC -#define ASM_SPEC "%{v:-v} %{n} %{T} %{Ym,*} %{Yd,*} \ - %{Wa,*:%*} %{m32:--32} %{m64:--64}" +#define ASM_SPEC "%{v} %{m32:--32} %{m64:--64}" #undef SPEC_32 #undef SPEC_64 Index: config/i386/sol2.h =================================================================== --- config/i386/sol2.h (revision 167038) +++ config/i386/sol2.h (working copy) @@ -54,10 +54,7 @@ along with GCC; see the file COPYING3. /* FIXME: Removed -K PIC from generic Solaris 2 ASM_SPEC: the native assembler gives many warnings: R_386_32 relocation is used for symbol ".text". */ #undef ASM_SPEC -#define ASM_SPEC "\ -%{v:-V} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Wa,*:%*} -s \ -%(asm_cpu) \ -" +#define ASM_SPEC "%{v:-V} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} -s %(asm_cpu)" #define ASM_CPU_SPEC "" Index: config/i386/x86-64.h =================================================================== --- config/i386/x86-64.h (revision 167038) +++ config/i386/x86-64.h (working copy) @@ -52,8 +52,7 @@ see the files COPYING3 and COPYING.RUNTI #define CC1_SPEC "%(cc1_cpu) %{profile:-p}" #undef ASM_SPEC -#define ASM_SPEC "%{v:-V} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Yd,*} \ - %{Wa,*:%*} %{m32:--32} %{m64:--64}" +#define ASM_SPEC "%{v} %{m32:--32} %{m64:--64}" #undef ASM_OUTPUT_ALIGNED_BSS #define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \ Index: config/i386/sol2-10.h =================================================================== --- config/i386/sol2-10.h (revision 167038) +++ config/i386/sol2-10.h (working copy) @@ -26,11 +26,10 @@ along with GCC; see the file COPYING3. assembler requires -xarch=generic or -xarch=generic64 instead. */ #undef ASM_SPEC #ifdef USE_GAS -#define ASM_SPEC "%{v:-V} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Yd,*} " \ - "%{Wa,*:%*} %{m32:--32} %{m64:--64} -s %(asm_cpu)" +#define ASM_SPEC "%{v} %{m32:--32} %{m64:--64} -s %(asm_cpu)" #else #define ASM_SPEC "%{v:-V} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Yd,*} " \ - "%{Wa,*:%*} %{m32:-xarch=generic} %{m64:-xarch=generic64} " \ + "%{m32:-xarch=generic} %{m64:-xarch=generic64} " \ "-s %(asm_cpu)" #endif Index: config/i386/linux64.h =================================================================== --- config/i386/linux64.h (revision 167038) +++ config/i386/linux64.h (working copy) @@ -71,8 +71,7 @@ see the files COPYING3 and COPYING.RUNTI #endif #undef ASM_SPEC -#define ASM_SPEC "%{v:-V} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Yd,*} \ - %{Wa,*:%*} %{" SPEC_32 ":--32} %{" SPEC_64 ":--64} \ +#define ASM_SPEC "%{v} %{" SPEC_32 ":--32} %{" SPEC_64 ":--64} \ %{!mno-sse2avx:%{mavx:-msse2avx}} %{msse2avx:%{!mavx:-msse2avx}}" #undef LINK_SPEC Index: config/i386/vxworks.h =================================================================== --- config/i386/vxworks.h (revision 167038) +++ config/i386/vxworks.h (working copy) @@ -22,7 +22,7 @@ along with GCC; see the file COPYING3. #define TARGET_VERSION fprintf (stderr, " (80586, VxWorks syntax)"); #undef ASM_SPEC -#define ASM_SPEC "%{v:-v} %{Qy:} %{n} %{T} %{Ym,*} %{Yd,*} %{Wa,*:%*}" +#define ASM_SPEC "%{v}" #define TARGET_OS_CPP_BUILTINS() \ do \