From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13038 invoked by alias); 2 Oct 2013 17:32:55 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 12904 invoked by uid 89); 2 Oct 2013 17:32:54 -0000 Received: from nikam.ms.mff.cuni.cz (HELO nikam.ms.mff.cuni.cz) (195.113.20.16) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Wed, 02 Oct 2013 17:32:54 +0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.6 required=5.0 tests=AWL,BAYES_00,NO_RELAYS,TO_NO_BRKTS_PCNT autolearn=no version=3.3.2 X-HELO: nikam.ms.mff.cuni.cz Received: by nikam.ms.mff.cuni.cz (Postfix, from userid 16202) id 00B0B541C89; Wed, 2 Oct 2013 19:32:49 +0200 (CEST) Date: Wed, 02 Oct 2013 17:32:00 -0000 From: Jan Hubicka To: gcc-patches@gcc.gnu.org, hjl.tools@gmail.com, ubizjak@gmail.com, rth@redhat.com, Ganesh.Gopalasubramanian@amd.com Subject: Honnor ix86_accumulate_outgoing_args again Message-ID: <20131002173249.GB12304@kam.mff.cuni.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) X-SW-Source: 2013-10/txt/msg00185.txt.bz2 Hi, currently ix86_accumulate_outgoing_args is ignored on all targets except for Solaris (that sets USE_IX86_FRAME_POINTER to true). It seems like accidental effect of http://gcc.gnu.org/ml/gcc-patches/2010-08/txt00102.txt that enabled omit-frame-pointer for 32bit (I take the 64bit change was purely accidental) probably based on the fact non-accumulate-outgoing-args was not doing well with assynchronous unwind info. The reason for this seems to be gone by http://gcc.gnu.org/ml/gcc-patches/2013-03/msg00995.html So I thing we ought to honnor accumulate-outgoing-args again and in fact consider disabling it for generic - it is disabled for core (that may need re-benchmarking). For all AMD targets it is currently on. I tested disabling it on buldozer 32bit and it seems mostly SPEC neutral for specint2000 (I am wating for more benchmarks) with very nice code size improvements in all benchmarks with exception of MCF with LTO (not sure at all why), with overall reduction of 5.2% (same gain as we get for -flto aproximately) http://gcc.opensuse.org/SPEC/CINT/sb-megrez-head-64-32o-32bit/size.html There may be close to noise factor drops as seen in http://gcc.opensuse.org/SPEC/CINT/sb-megrez-head-64-32o-32bit/recent.html I will see how other tests shape and wait for multiple runs to show how much of this is actual noise. We may consider disabling it for size optimized functions and -O2 (and not for -O3) at least. This patch however only remove code forcingly enabling MASK_ACCUMULATE_OUTGOING_ARGS. If there will be no complains, I will commit it tomorrow. Honza * i386.c (ix86_option_override_internal): Do not force ACCUMULATE_OUTGOING_ARGS when unwind info is generated. Index: config/i386/i386.c =================================================================== --- config/i386/i386.c (revision 203117) +++ config/i386/i386.c (working copy) @@ -3793,28 +3793,11 @@ ix86_option_override_internal (bool main } ix86_tune_mask = 1u << ix86_tune; - if ((!USE_IX86_FRAME_POINTER - || (x86_accumulate_outgoing_args & ix86_tune_mask)) + if ((x86_accumulate_outgoing_args & ix86_tune_mask) && !(target_flags_explicit & MASK_ACCUMULATE_OUTGOING_ARGS) && !optimize_size) target_flags |= MASK_ACCUMULATE_OUTGOING_ARGS; - /* ??? Unwind info is not correct around the CFG unless either a frame - pointer is present or M_A_O_A is set. Fixing this requires rewriting - unwind info generation to be aware of the CFG and propagating states - around edges. */ - if ((flag_unwind_tables || flag_asynchronous_unwind_tables - || flag_exceptions || flag_non_call_exceptions) - && flag_omit_frame_pointer - && !(target_flags & MASK_ACCUMULATE_OUTGOING_ARGS)) - { - if (target_flags_explicit & MASK_ACCUMULATE_OUTGOING_ARGS) - warning (0, "unwind tables currently require either a frame pointer " - "or %saccumulate-outgoing-args%s for correctness", - prefix, suffix); - target_flags |= MASK_ACCUMULATE_OUTGOING_ARGS; - } - /* If stack probes are required, the space used for large function arguments on the stack must also be probed, so enable -maccumulate-outgoing-args so this happens in the prologue. */