From patchwork Wed Jun 6 18:06:58 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Bosscher X-Patchwork-Id: 163410 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 56A6DB6F86 for ; Thu, 7 Jun 2012 04:07:19 +1000 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1339610840; h=Comment: DomainKey-Signature:Received:Received:Received:Received: MIME-Version:Received:Received:Date:Message-ID:Subject:From:To: Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:Sender:Delivered-To; bh=rSVqWGS TVX/uLqTpl1qCGIaLzmg=; b=mOoX/ArqYYh4AEkMY9qtQSRGggwzbN5gOaU4xSp YxxJ75ouNdaFwcMG1CUT5YnqXUpJSB8Ojmf7s/HA8yYeSzXy4SX2Rjc3zHLgvmro 6q6BPjOf+i3JoZGwBTexjSHecgF+yyXrRD1Yjlf9CuK1mS7yzsSWIlxdxMITih/G e6Eg= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:MIME-Version:Received:Received:Date:Message-ID:Subject:From:To:Content-Type:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=rgRqhcIWr1+PH8Uuu0VUKNhk7J1P4WqQZ5Yg7AD9EleEZ4hc+7noqibmDSfOrw wSpNU8ZaEeFKQkgGXhXiAj20rZLomZNWgdmXh9hSC0aa9cnuQdt0o4veJbw1Mh1U xwwpU/l9bX3+/35TtvqFm3mEUlUZ4m7n+QdG1Tep6T7oE=; Received: (qmail 21819 invoked by alias); 6 Jun 2012 18:07:14 -0000 Received: (qmail 21803 invoked by uid 22791); 6 Jun 2012 18:07:12 -0000 X-SWARE-Spam-Status: No, hits=-2.8 required=5.0 tests=AWL, BAYES_50, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, KHOP_RCVD_TRUST, RCVD_IN_DNSWL_LOW, RCVD_IN_HOSTKARMA_YE, T_FRT_FRIEND X-Spam-Check-By: sourceware.org Received: from mail-lpp01m010-f47.google.com (HELO mail-lpp01m010-f47.google.com) (209.85.215.47) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 06 Jun 2012 18:07:00 +0000 Received: by lags15 with SMTP id s15so5243394lag.20 for ; Wed, 06 Jun 2012 11:06:58 -0700 (PDT) MIME-Version: 1.0 Received: by 10.152.125.236 with SMTP id mt12mr22432989lab.12.1339006018633; Wed, 06 Jun 2012 11:06:58 -0700 (PDT) Received: by 10.112.4.229 with HTTP; Wed, 6 Jun 2012 11:06:58 -0700 (PDT) Date: Wed, 6 Jun 2012 20:06:58 +0200 Message-ID: Subject: [patch] Remove -fconserve-space From: Steven Bosscher To: Jason Merrill , GCC Patches 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 Hello, The attached patch removes the -fconserve-space flag, as discussed last week. Bootstrapped&tested on powerpc64-unknown-linux-gnu. OK for trunk? Ciao! Steven gcc/ * doc/invoke.texi (fconserve-space): Remove documentation. c-family/ * c.opt (fconserve-space): Turn into a no-op. cp/ * decl.c: Do not include output.h. (start_decl): Remove code for flag_conserve_space. testsuite/ * g++.old-deja/g++.brendan/array1.C: Remove -fconserve-space flag. Index: doc/invoke.texi =================================================================== --- doc/invoke.texi (revision 188182) +++ doc/invoke.texi (working copy) @@ -182,7 +182,7 @@ in the following sections. @item C++ Language Options @xref{C++ Dialect Options,,Options Controlling C++ Dialect}. @gccoptlist{-fabi-version=@var{n} -fno-access-control -fcheck-new @gol --fconserve-space -fconstexpr-depth=@var{n} -ffriend-injection @gol +-fconstexpr-depth=@var{n} -ffriend-injection @gol -fno-elide-constructors @gol -fno-enforce-eh-specs @gol -ffor-scope -fno-for-scope -fno-gnu-keywords @gol @@ -1947,18 +1947,6 @@ return value even without this option. In all oth exhaustion is signalled by throwing @code{std::bad_alloc}. See also @samp{new (nothrow)}. -@item -fconserve-space -@opindex fconserve-space -Put uninitialized or run-time-initialized global variables into the -common segment, as C does. This saves space in the executable at the -cost of not diagnosing duplicate definitions. If you compile with this -flag and your program mysteriously crashes after @code{main()} has -completed, you may have an object that is being destroyed twice because -two definitions are merged. - -This option is no longer useful on most targets, now that support has -been added for putting variables into BSS without making them common. - @item -fconstexpr-depth=@var{n} @opindex fconstexpr-depth Set the maximum nested evaluation depth for C++11 constexpr functions Index: c-family/c.opt =================================================================== --- c-family/c.opt (revision 188182) +++ c-family/c.opt (working copy) @@ -762,7 +762,7 @@ Allow the arguments of the '?' operator to have di fconserve-space C++ ObjC++ Var(flag_conserve_space) -Reduce the size of object files +Does nothing. Preserved for backward compatibility. fconstant-string-class= ObjC ObjC++ Joined MissingArgError(no class name specified with %qs) Index: cp/decl.c =================================================================== --- cp/decl.c (revision 188182) +++ cp/decl.c (working copy) @@ -39,7 +39,6 @@ along with GCC; see the file COPYING3. If not see #include "tree-inline.h" #include "decl.h" #include "intl.h" -#include "output.h" /* for have_global_bss_p */ #include "toplev.h" #include "hashtab.h" #include "tm_p.h" @@ -4528,18 +4527,6 @@ start_decl (const cp_declarator *declarator, if (decl == error_mark_node) return error_mark_node; - /* Tell the back end to use or not use .common as appropriate. If we say - -fconserve-space, we want this to save .data space, at the expense of - wrong semantics. If we say -fno-conserve-space, we want this to - produce errors about redefs; to do this we force variables into the - data segment. */ - if (flag_conserve_space - && TREE_CODE (decl) == VAR_DECL - && TREE_PUBLIC (decl) - && !DECL_THREAD_LOCAL_P (decl) - && !have_global_bss_p ()) - DECL_COMMON (decl) = 1; - if (TREE_CODE (decl) == VAR_DECL && DECL_NAMESPACE_SCOPE_P (decl) && !TREE_PUBLIC (decl) && !was_public && !DECL_THIS_STATIC (decl) && !DECL_ARTIFICIAL (decl)) Index: testsuite/g++.old-deja/g++.brendan/array1.C =================================================================== --- testsuite/g++.old-deja/g++.brendan/array1.C (revision 188182) +++ testsuite/g++.old-deja/g++.brendan/array1.C (working copy) @@ -1,5 +1,5 @@ // { dg-do assemble } -// { dg-options "-fconserve-space -fcommon" } +// { dg-options "-fcommon" } // GROUPS passed array-bindings extern "C" int printf (const char *, ...);