From patchwork Thu Aug 12 00:52:17 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joseph Myers X-Patchwork-Id: 61525 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 8B8D5B70B4 for ; Thu, 12 Aug 2010 10:52:49 +1000 (EST) Received: (qmail 27641 invoked by alias); 12 Aug 2010 00:52:35 -0000 Received: (qmail 27605 invoked by uid 22791); 12 Aug 2010 00:52:25 -0000 X-SWARE-Spam-Status: No, hits=0.8 required=5.0 tests=AWL, BAYES_00, MEDICAL_SUBJECT, 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; Thu, 12 Aug 2010 00:52:20 +0000 Received: (qmail 7020 invoked from network); 12 Aug 2010 00:52:18 -0000 Received: from unknown (HELO digraph.polyomino.org.uk) (joseph@127.0.0.2) by mail.codesourcery.com with ESMTPA; 12 Aug 2010 00:52:18 -0000 Received: from jsm28 (helo=localhost) by digraph.polyomino.org.uk with local-esmtp (Exim 4.69) (envelope-from ) id 1OjM1p-0004v3-AC; Thu, 12 Aug 2010 00:52:17 +0000 Date: Thu, 12 Aug 2010 00:52:17 +0000 (UTC) From: "Joseph S. Myers" To: gcc-patches@gcc.gnu.org, fortran@gcc.gnu.org Subject: Fix -MD/-MMD interface difference between driver and cc1/f951 etc. 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 When fixing incompatibilities between whether particular options take arguments in the driver and in the compilers proper , I missed that this issue also applied to the -MD and -MMD options and found that in the course of testing the patch to make the driver use shared option processing machinery. This patch fixes this issue by changing the internal options (taking arguments) used by cc1 etc. to -MDX and -MMDX, leaving the external options (to the driver, not taking arguments) unchanged. (The alternative of using -MD= and -MMD= runs into issues with specs generating separate arguments in some cases when not desired.) Bootstrapped with no regressions on x86_64-unknown-linux-gnu. OK to commit (the driver and Fortran pieces)? 2010-08-12 Joseph Myers * gcc.c (cpp_unique_options): Generate -MDX and -MMDX from -MD and -MMD. c-family: 2010-08-12 Joseph Myers * c.opt (MD, MMD): Change to MDX and MMDX. * c-opts.c (c_common_handle_option): Use OPT_MMD and OPT_MMDX. fortran: 2010-08-12 Joseph Myers * lang.opt (MD, MMD): Change to MDX and MMDX. * cpp.c (gfc_cpp_handle_option): Use OPT_MMD and OPT_MMDX. Index: c-family/c.opt =================================================================== --- c-family/c.opt (revision 163095) +++ c-family/c.opt (working copy) @@ -72,9 +72,9 @@ M C ObjC C++ ObjC++ Generate make dependencies -MD +MDX C ObjC C++ ObjC++ Separate MissingArgError(missing filename after %qs) -Generate make dependencies and compile +-MD Generate make dependencies and compile MF C ObjC C++ ObjC++ Joined Separate MissingArgError(missing filename after %qs) @@ -88,9 +88,9 @@ MM C ObjC C++ ObjC++ Like -M but ignore system header files -MMD +MMDX C ObjC C++ ObjC++ Separate MissingArgError(missing filename after %qs) -Like -MD but ignore system header files +-MMD Like -MD but ignore system header files MP C ObjC C++ ObjC++ Index: c-family/c-opts.c =================================================================== --- c-family/c-opts.c (revision 163095) +++ c-family/c-opts.c (working copy) @@ -398,9 +398,9 @@ c_common_handle_option (size_t scode, co flag_no_output = 1; break; - case OPT_MD: - case OPT_MMD: - cpp_opts->deps.style = (code == OPT_MD ? DEPS_SYSTEM: DEPS_USER); + case OPT_MDX: + case OPT_MMDX: + cpp_opts->deps.style = (code == OPT_MDX ? DEPS_SYSTEM: DEPS_USER); cpp_opts->deps.need_preprocessor_output = true; deps_file = arg; break; Index: gcc.c =================================================================== --- gcc.c (revision 163095) +++ gcc.c (working copy) @@ -829,8 +829,8 @@ static const char *trad_capable_cpp = file that happens to exist is up-to-date. */ static const char *cpp_unique_options = "%{!Q:-quiet} %{nostdinc*} %{C} %{CC} %{v} %{I*&F*} %{P} %I\ - %{MD:-MD %{!o:%b.d}%{o*:%.d%*}}\ - %{MMD:-MMD %{!o:%b.d}%{o*:%.d%*}}\ + %{MD:-MDX %{!o:%b.d}%{o*:%.d%*}}\ + %{MMD:-MMDX %{!o:%b.d}%{o*:%.d%*}}\ %{M} %{MM} %{MF*} %{MG} %{MP} %{MQ*} %{MT*}\ %{!E:%{!M:%{!MM:%{!MT:%{!MQ:%{MD|MMD:%{o*:-MQ %*}}}}}}}\ %{remap} %{g3|ggdb3|gstabs3|gcoff3|gxcoff3|gvms3:-dD}\ Index: fortran/cpp.c =================================================================== --- fortran/cpp.c (revision 163095) +++ fortran/cpp.c (working copy) @@ -456,11 +456,11 @@ gfc_cpp_handle_option (size_t scode, con gfc_cpp_option.deps = 1; break; - case OPT_MMD: + case OPT_MMDX: gfc_cpp_option.deps_skip_system = 1; /* fall through */ - case OPT_MD: + case OPT_MDX: gfc_cpp_option.deps = 1; gfc_cpp_option.deps_filename = arg; break; Index: fortran/lang.opt =================================================================== --- fortran/lang.opt (revision 163095) +++ fortran/lang.opt (working copy) @@ -60,7 +60,7 @@ M Fortran ; Documented in C -MD +MDX Fortran Separate ; Documented in C @@ -76,7 +76,7 @@ MM Fortran ; Documented in C -MMD +MMDX Fortran Separate ; Documented in C