From patchwork Fri Jun 25 00:00:50 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joseph Myers X-Patchwork-Id: 56872 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 3E778B707C for ; Fri, 25 Jun 2010 10:01:03 +1000 (EST) Received: (qmail 21803 invoked by alias); 25 Jun 2010 00:01:01 -0000 Received: (qmail 21494 invoked by uid 22791); 25 Jun 2010 00:01:00 -0000 X-SWARE-Spam-Status: No, hits=-1.2 required=5.0 tests=AWL, BAYES_05, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 25 Jun 2010 00:00:53 +0000 Received: (qmail 31466 invoked from network); 25 Jun 2010 00:00:52 -0000 Received: from unknown (HELO digraph.polyomino.org.uk) (joseph@127.0.0.2) by mail.codesourcery.com with ESMTPA; 25 Jun 2010 00:00:52 -0000 Received: from jsm28 (helo=localhost) by digraph.polyomino.org.uk with local-esmtp (Exim 4.69) (envelope-from ) id 1ORwLi-0002xi-Nd; Fri, 25 Jun 2010 00:00:50 +0000 Date: Fri, 25 Jun 2010 00:00:50 +0000 (UTC) From: "Joseph S. Myers" To: gcc-patches@gcc.gnu.org cc: kenner@vlsi1.ultra.nyu.edu, law@redhat.com, dave.anglin@nrc-cnrc.gc.ca Subject: Remove MODIFY_TARGET_NAME Message-ID: MIME-Version: 1.0 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 A target macro MODIFY_TARGET_NAME was added by . This provided a way for targets to have options that were effectively special cases of -b: PA options -32 and -64 were added whose effect was to remove or add "64" in the first part of the target triplet. The implementation in terms of modifying spec_machine may have worked at the time; it was how -b was implemented then, and modifying spec_machine would have caused the compiler to read specs from the location where the other-target compiler had installed them. But the old style of implementing -b and -V proved problematic and -b was reimplemented to exec an alternative driver in . The installation of specs files was then stopped by , removing the last chance of such a spec_machine change working in a normal installation. Finally, -b and -V were removed (patch posting: ), leaving MODIFY_TARGET_NAME as the only relic of one GCC installation trying to run pieces of another installation. This patch removes MODIFY_TARGET_NAME in order to facilitate sharing option processing machinery between the driver and the compilers proper. I think the development direction is clear that one installation should not be running pieces of another and any replacement should involve multiple targets built into GCC at once. (In the PA case, it would surely be simpler to implement conventional -m32/-m64 options as on many other targets rather than linking in multiple variant copies of the back end - even if you want to do it for HP-UX where 32-bit and 64-bit use different object formats.) Bootstrapped with no regressions on x86_64-unknown-linux-gnu. OK to commit? 2010-06-24 Joseph Myers * config/pa/pa.h (MODIFY_TARGET_NAME): Remove. * doc/tm.texi (MODIFY_TARGET_NAME): Don't document. * gcc.c (enum add_del, struct modify_target, modify_target): Remove. (process_command): Remove code conditional on MODIFY_TARGET_NAME. * system.h (MODIFY_TARGET_NAME): Poison. diff -rupN --exclude=.svn gcc-mainline-opt5/gcc/config/pa/pa.h gcc-mainline/gcc/config/pa/pa.h --- gcc-mainline-opt5/gcc/config/pa/pa.h 2009-10-07 09:35:30.000000000 -0700 +++ gcc-mainline/gcc/config/pa/pa.h 2010-06-24 15:21:30.000000000 -0700 @@ -1,6 +1,6 @@ /* Definitions of target machine for GNU compiler, for the HP Spectrum. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, - 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 + 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. Contributed by Michael Tiemann (tiemann@cygnus.com) of Cygnus Support and Tim Moore (moore@defmacro.cs.utah.edu) of the Center for @@ -222,15 +222,6 @@ do { \ #define LIB_SPEC "%{!p:%{!pg:-lc}}%{p:-lc_p}%{pg:-lc_p}" #endif -/* This macro defines command-line switches that modify the default - target name. - - The definition is be an initializer for an array of structures. Each - array element has have three elements: the switch name, one of the - enumeration codes ADD or DELETE to indicate whether the string should be - inserted or deleted, and the string to be inserted or deleted. */ -#define MODIFY_TARGET_NAME {{"-32", DELETE, "64"}, {"-64", ADD, "64"}} - /* Make gcc agree with */ #define SIZE_TYPE "unsigned int" diff -rupN --exclude=.svn gcc-mainline-opt5/gcc/doc/tm.texi gcc-mainline/gcc/doc/tm.texi --- gcc-mainline-opt5/gcc/doc/tm.texi 2010-06-17 03:29:51.000000000 -0700 +++ gcc-mainline/gcc/doc/tm.texi 2010-06-24 15:21:49.000000000 -0700 @@ -523,31 +523,6 @@ Cross compilers do not search either @fi replacement. @end defmac -@defmac MODIFY_TARGET_NAME -Define this macro if you wish to define command-line switches that -modify the default target name. - -For each switch, you can include a string to be appended to the first -part of the configuration name or a string to be deleted from the -configuration name, if present. The definition should be an initializer -for an array of structures. Each array element should have three -elements: the switch name (a string constant, including the initial -dash), one of the enumeration codes @code{ADD} or @code{DELETE} to -indicate whether the string should be inserted or deleted, and the string -to be inserted or deleted (a string constant). - -For example, on a machine where @samp{64} at the end of the -configuration name denotes a 64-bit target and you want the @option{-32} -and @option{-64} switches to select between 32- and 64-bit targets, you would -code - -@smallexample -#define MODIFY_TARGET_NAME \ - @{ @{ "-32", DELETE, "64"@}, \ - @{"-64", ADD, "64"@}@} -@end smallexample -@end defmac - @defmac SYSTEM_INCLUDE_DIR Define this macro as a C string constant if you wish to specify a system-specific directory to search for header files before the standard diff -rupN --exclude=.svn gcc-mainline-opt5/gcc/gcc.c gcc-mainline/gcc/gcc.c --- gcc-mainline-opt5/gcc/gcc.c 2010-06-23 13:36:36.000000000 -0700 +++ gcc-mainline/gcc/gcc.c 2010-06-24 15:23:53.000000000 -0700 @@ -280,23 +280,6 @@ static const char *cross_compile = "1"; static const char *cross_compile = "0"; #endif -#ifdef MODIFY_TARGET_NAME - -/* Information on how to alter the target name based on a command-line - switch. The only case we support now is simply appending or deleting a - string to or from the end of the first part of the configuration name. */ - -enum add_del {ADD, DELETE}; - -static const struct modify_target -{ - const char *const sw; - const enum add_del add_del; - const char *const str; -} -modify_target[] = MODIFY_TARGET_NAME; -#endif - /* Greatest exit code of sub-processes that has been encountered up to now. */ static int greatest_status = 1; @@ -3502,10 +3485,6 @@ process_command (int argc, const char ** const char *spec_lang = 0; int last_language_n_infiles; int lang_n_infiles = 0; -#ifdef MODIFY_TARGET_NAME - int is_modify_target_name; - unsigned int j; -#endif const char *tooldir_prefix; char *(*get_relative_prefix) (const char *, const char *, const char *) = NULL; @@ -4127,43 +4106,6 @@ process_command (int argc, const char ** default: normal_switch: -#ifdef MODIFY_TARGET_NAME - is_modify_target_name = 0; - - for (j = 0; j < ARRAY_SIZE (modify_target); j++) - if (! strcmp (argv[i], modify_target[j].sw)) - { - char *new_name = XNEWVEC (char, strlen (modify_target[j].str) - + strlen (spec_machine)); - const char *p, *r; - char *q; - int made_addition = 0; - - is_modify_target_name = 1; - for (p = spec_machine, q = new_name; *p != 0; ) - { - if (modify_target[j].add_del == DELETE - && (! strncmp (q, modify_target[j].str, - strlen (modify_target[j].str)))) - p += strlen (modify_target[j].str); - else if (modify_target[j].add_del == ADD - && ! made_addition && *p == '-') - { - for (r = modify_target[j].str; *r != 0; ) - *q++ = *r++; - made_addition = 1; - } - - *q++ = *p++; - } - - spec_machine = new_name; - } - - if (is_modify_target_name) - break; -#endif - n_switches++; if (SWITCH_TAKES_ARG (c) > (p[1] != 0)) @@ -4304,17 +4246,6 @@ process_command (int argc, const char ** for (i = 1; i < argc; i++) { /* Just skip the switches that were handled by the preceding loop. */ -#ifdef MODIFY_TARGET_NAME - is_modify_target_name = 0; - - for (j = 0; j < ARRAY_SIZE (modify_target); j++) - if (! strcmp (argv[i], modify_target[j].sw)) - is_modify_target_name = 1; - - if (is_modify_target_name) - ; - else -#endif if (! strncmp (argv[i], "-Wa,", 4)) ; else if (! strncmp (argv[i], "-Wp,", 4)) diff -rupN --exclude=.svn gcc-mainline-opt5/gcc/system.h gcc-mainline/gcc/system.h --- gcc-mainline-opt5/gcc/system.h 2010-06-21 15:27:06.000000000 -0700 +++ gcc-mainline/gcc/system.h 2010-06-24 15:22:11.000000000 -0700 @@ -769,7 +769,7 @@ extern void fancy_abort (const char *, i ASM_OUTPUT_SHARED_LOCAL ASM_MAKE_LABEL_LINKONCE \ STACK_CHECK_PROBE_INTERVAL STACK_CHECK_PROBE_LOAD \ ORDER_REGS_FOR_LOCAL_ALLOC FUNCTION_OUTGOING_VALUE \ - ASM_DECLARE_CONSTANT_NAME + ASM_DECLARE_CONSTANT_NAME MODIFY_TARGET_NAME /* Hooks that are no longer used. */ #pragma GCC poison LANG_HOOKS_FUNCTION_MARK LANG_HOOKS_FUNCTION_FREE \