From patchwork Tue Nov 5 09:00:40 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mingjie Xing X-Patchwork-Id: 288446 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]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 10B322C0077 for ; Tue, 5 Nov 2013 20:01:02 +1100 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:date:message-id:subject:from:to:content-type; q= dns; s=default; b=PvkNHd5dXjVLeWwv/bas1NS9yQBOPe5nU8CSehuahq3+P5 IPEo6SrrDYZVZAiGrHehn2ymp9X84pXwERl6ueTgiRDpJ5P8XdvdUqvEY8v/QZRK N91AiwBnbk0vbhzPTchFOm7yX9dojTlsx/RknazTsT129J5Mbto3ts0ZvBsnU= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:date:message-id:subject:from:to:content-type; s= default; bh=ShN9sfgwkEUY1pHTjJiGqYuEhKc=; b=h9MHMRr72V0DHPYHHzHa HYy4PQncY0YCkfxVGq4CGaH9JSyM9ZLbqbEgTUIzEFVQAUZUXyPE4TFSklO0gjII rUpb2mpdpf1Ma2skBvDcbU6+ld1FWaPNDFYtP24alCVMQClYedfyKZcBU1n2Lx6L cEpq+01/RvXXdOtbgK2b/jo= Received: (qmail 22558 invoked by alias); 5 Nov 2013 09:00:50 -0000 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 Received: (qmail 22542 invoked by uid 89); 5 Nov 2013 09:00:49 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.1 required=5.0 tests=AWL, BAYES_50, FREEMAIL_FROM, RDNS_NONE, SPF_PASS, URIBL_BLOCKED autolearn=no version=3.3.2 X-HELO: mail-ie0-f174.google.com Received: from Unknown (HELO mail-ie0-f174.google.com) (209.85.223.174) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Tue, 05 Nov 2013 09:00:48 +0000 Received: by mail-ie0-f174.google.com with SMTP id qd12so14475439ieb.33 for ; Tue, 05 Nov 2013 01:00:40 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.51.16.35 with SMTP id ft3mr14797025igd.46.1383642040608; Tue, 05 Nov 2013 01:00:40 -0800 (PST) Received: by 10.50.51.101 with HTTP; Tue, 5 Nov 2013 01:00:40 -0800 (PST) Date: Tue, 5 Nov 2013 17:00:40 +0800 Message-ID: Subject: [driver] try to fix "driver specifies output file twice" bug From: Mingjie Xing To: gcc-patches X-IsSubscribed: yes Hello, This patch is trying to fix the bug (driver specifies output file twice when compiling header with -S) http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31316. Changes: * gcc.c (default_compilers): Update c-header specs. By applying the patch, run command $ gcc -S foo.h will just output an assembly file foo.s. $ gcc -fsyntax-only foo.h no output file. $ gcc foo.h -o foo.s will output PCH file named foo.s. $ gcc foo.h -save-temps will output foo.i, foo.s, foo.h.gch. But, $ gcc foo.h -save-temps -o foo.s will output foo.s, a mix of assembly and PCH. This should be fixed. Any suggestions? Thanks, Mingjie Index: gcc/gcc.c =================================================================== --- gcc/gcc.c (revision 204285) +++ gcc/gcc.c (working copy) @@ -1048,14 +1048,15 @@ static const struct compiler default_com %{!E:%{!M:%{!MM:\ %{save-temps*|traditional-cpp|no-integrated-cpp:%(trad_capable_cpp) \ %(cpp_options) -o %{save-temps*:%b.i} %{!save-temps*:%g.i} \n\ - cc1 -fpreprocessed %{save-temps*:%b.i} %{!save-temps*:%g.i} \ - %(cc1_options)\ - %{!fdump-ada-spec*:-o %g.s %{!o*:--output-pch=%i.gch}\ - %W{o*:--output-pch=%*}}%V}\ + cc1 -fpreprocessed %{save-temps*:%b.i} %{!save-temps*:%g.i} \ + %(cc1_options)\ + %{!fsyntax-only:%{!S:%{!fdump-ada-spec*:-o %g.s \ + %{!o*:--output-pch=%i.gch} %W{o*:--output-pch=%*}}}}%V}\ %{!save-temps*:%{!traditional-cpp:%{!no-integrated-cpp:\ cc1 %(cpp_unique_options) %(cc1_options)\ - %{!fdump-ada-spec*:-o %g.s %{!o*:--output-pch=%i.gch}\ - %W{o*:--output-pch=%*}}%V}}}}}}", 0, 0, 0}, + %{!fsyntax-only:%{!S:%{!fdump-ada-spec*:-o %g.s \ + %{!o*:--output-pch=%i.gch} %W{o*:--output-pch=%*}}}}%V}}}\ + }}}", 0, 0, 0}, {".i", "@cpp-output", 0, 0, 0}, {"@cpp-output", "%{!M:%{!MM:%{!E:cc1 -fpreprocessed %i %(cc1_options) %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0},