From patchwork Mon Apr 4 21:05:46 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joseph Myers X-Patchwork-Id: 89711 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 4A441B6FBE for ; Tue, 5 Apr 2011 07:05:55 +1000 (EST) Received: (qmail 24240 invoked by alias); 4 Apr 2011 21:05:53 -0000 Received: (qmail 24231 invoked by uid 22791); 4 Apr 2011 21:05:52 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL, BAYES_00, TW_CF, TW_XG, 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; Mon, 04 Apr 2011 21:05:48 +0000 Received: (qmail 14659 invoked from network); 4 Apr 2011 21:05:47 -0000 Received: from unknown (HELO digraph.polyomino.org.uk) (joseph@127.0.0.2) by mail.codesourcery.com with ESMTPA; 4 Apr 2011 21:05:47 -0000 Received: from jsm28 (helo=localhost) by digraph.polyomino.org.uk with local-esmtp (Exim 4.72) (envelope-from ) id 1Q6qy2-0000z2-9m; Mon, 04 Apr 2011 21:05:46 +0000 Date: Mon, 4 Apr 2011 21:05:46 +0000 (UTC) From: "Joseph S. Myers" To: gcc-patches@gcc.gnu.org cc: law@redhat.com, schwab@linux-m68k.org Subject: Convert legacy ColdFire options to .opt aliases 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 This patch begins simplifying m68k option handling, in preparation for using the .opt Enum facility to process enumerated options, avoiding global state in option handlers and sharing option hanlders with the driver, by converting the legacy -m options for particular ColdFire CPUs into .opt Alias entries for the corresponding -mcpu options. Tested building cc1 and xgcc for cross to m68k-elf. Will commit to trunk in the absence of target maintainer objections - and will then follow up with similar changes for the legacy -m options for particular non-ColdFire CPUs. I think it's reasonable to presume ColdFire users are already using binutils versions with -mcpu= assembler support (required to use any option converted to an alias by this patch) - and since that support went in over five years ago, I think it's reasonable to require a binutils version with that support for non-ColdFire users as well (with a documentation update in the non-ColdFire patch noting that binutils 2.17 or later is required). Note that the MULTILIB_MATCHES setting that I removed as no longer needed with the Alias entries in place had mappings for -m5300 and -m5400, although there were no such options, and it mapped -mcfv4e to -mcpu=5475 although the actual alias, following the code in m68k_handle_option, is to -mcpu=547x. 2011-04-04 Joseph Myers * config/m68k/m68k.c (m68k_handle_option): Don't handle OPT_m5200, OPT_m5206e, OPT_m528x, OPT_m5307, OPT_m5407 and OPT_mcfv4e. * config/m68k/m68k.h (OPTION_DEFAULT_SPECS, ASM_CPU_SPEC): Don't handle -m5200, -m5206e, -m528x, -m5307, -m5407 and -mcfv4e. * config/m68k/m68k.opt (m5200, m5206e, m528x, m5307, m5407, mcfv4e): Use Alias. * config/m68k/t-mlibs (MULTILIB_MATCHES): Don't map legacy ColdFire options to -mcpu= options. Index: gcc/config/m68k/t-mlibs =================================================================== --- gcc/config/m68k/t-mlibs (revision 171942) +++ gcc/config/m68k/t-mlibs (working copy) @@ -1,6 +1,6 @@ # multilibs -*- mode:Makefile -*- # -# Copyright (C) 2007 Free Software Foundation, Inc. +# Copyright (C) 2007, 2011 Free Software Foundation, Inc. # # This file is part of GCC. # @@ -73,11 +73,6 @@ MULTILIB_MATCHES += m68000=mcpu?68000 m6 endif ifneq ($(M68K_ARCH),m68k) -# Map the legacy ColdFire options to the new ones. -MULTILIB_MATCHES += mcpu?5206=m5200 mcpu?5206e=m5206e mcpu?5208=m528x \ - mcpu?5307=m5300 mcpu?5307=m5307 \ - mcpu?5407=m5400 mcpu?5407=m5407 \ - mcpu?5475=mcfv4e # Map -march=* options to the representative -mcpu=* option. MULTILIB_MATCHES += mcpu?5206e=march?isaa mcpu?5208=march?isaaplus \ mcpu?5407=march?isab Index: gcc/config/m68k/m68k.opt =================================================================== --- gcc/config/m68k/m68k.opt (revision 171942) +++ gcc/config/m68k/m68k.opt (working copy) @@ -1,6 +1,7 @@ ; Options for the Motorola 68000 port of the compiler. -; Copyright (C) 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +; Copyright (C) 2005, 2006, 2007, 2008, 2009, 2011 +; Free Software Foundation, Inc. ; ; This file is part of GCC. ; @@ -19,23 +20,23 @@ ; . m5200 -Target RejectNegative +Target RejectNegative Alias(mcpu=, 5206) Generate code for a 520X m5206e -Target RejectNegative +Target RejectNegative Alias(mcpu=, 5206e) Generate code for a 5206e m528x -Target RejectNegative +Target RejectNegative Alias(mcpu=, 528x) Generate code for a 528x m5307 -Target RejectNegative +Target RejectNegative Alias(mcpu=, 5307) Generate code for a 5307 m5407 -Target RejectNegative +Target RejectNegative Alias(mcpu=, 5407) Generate code for a 5407 m68000 @@ -108,7 +109,7 @@ Target RejectNegative Generate code for a 68020 mcfv4e -Target RejectNegative +Target RejectNegative Alias(mcpu=, 547x) Generate code for a ColdFire v4e mcpu= Index: gcc/config/m68k/m68k.c =================================================================== --- gcc/config/m68k/m68k.c (revision 171942) +++ gcc/config/m68k/m68k.c (working copy) @@ -499,24 +499,6 @@ m68k_handle_option (struct gcc_options * case OPT_mtune_: return m68k_find_selection (&m68k_tune_entry, all_microarchs, arg); - case OPT_m5200: - return m68k_find_selection (&m68k_cpu_entry, all_devices, "5206"); - - case OPT_m5206e: - return m68k_find_selection (&m68k_cpu_entry, all_devices, "5206e"); - - case OPT_m528x: - return m68k_find_selection (&m68k_cpu_entry, all_devices, "528x"); - - case OPT_m5307: - return m68k_find_selection (&m68k_cpu_entry, all_devices, "5307"); - - case OPT_m5407: - return m68k_find_selection (&m68k_cpu_entry, all_devices, "5407"); - - case OPT_mcfv4e: - return m68k_find_selection (&m68k_cpu_entry, all_devices, "547x"); - case OPT_m68000: case OPT_mc68000: return m68k_find_selection (&m68k_cpu_entry, all_devices, "68000"); Index: gcc/config/m68k/m68k.h =================================================================== --- gcc/config/m68k/m68k.h (revision 171942) +++ gcc/config/m68k/m68k.h (working copy) @@ -31,9 +31,8 @@ along with GCC; see the file COPYING3. /* Handle --with-cpu default option from configure script. */ #define OPTION_DEFAULT_SPECS \ { "cpu", "%{!mc68000:%{!m68000:%{!m68302:%{!m68010:%{!mc68020:%{!m68020:\ -%{!m68030:%{!m68040:%{!m68020-40:%{!m68020-60:%{!m68060:%{!mcpu32:\ -%{!m68332:%{!m5200:%{!m5206e:%{!m528x:%{!m5307:%{!m5407:%{!mcfv4e:\ -%{!mcpu=*:%{!march=*:-%(VALUE)}}}}}}}}}}}}}}}}}}}}}" }, +%{!m68030:%{!m68040:%{!m68020-40:%{!m68020-60:%{!m68060:%{!mcpu32:%{!m68332:\ +%{!mcpu=*:%{!march=*:-%(VALUE)}}}}}}}}}}}}}}}" }, /* Pass flags to gas indicating which type of processor we have. This can be simplified when we can rely on the assembler supporting .cpu @@ -43,7 +42,7 @@ along with GCC; see the file COPYING3. %{m68851}%{mno-68851} %{m68881}%{mno-68881} %{msoft-float:-mno-float} \ %{m68000}%{m68302}%{mc68000}%{m68010}%{m68020}%{mc68020}%{m68030}\ %{m68040}%{m68020-40:-m68040}%{m68020-60:-m68040}\ -%{m68060}%{mcpu32}%{m68332}%{m5200}%{m5206e}%{m528x}%{m5307}%{m5407}%{mcfv4e}\ +%{m68060}%{mcpu32}%{m68332}\ %{mcpu=*:-mcpu=%*}%{march=*:-march=%*}\ " #define ASM_PCREL_SPEC "%{fPIC|fpic|mpcrel:--pcrel} \