From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29595 invoked by alias); 11 Nov 2012 19:54:40 -0000 Received: (qmail 29587 invoked by uid 22791); 11 Nov 2012 19:54:40 -0000 X-SWARE-Spam-Status: No, hits=-7.2 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 11 Nov 2012 19:54:35 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id qABJsYei011173 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sun, 11 Nov 2012 14:54:34 -0500 Received: from zebedee.pink (ovpn-113-82.phx2.redhat.com [10.3.113.82]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id qABJsUha009408; Sun, 11 Nov 2012 14:54:31 -0500 Message-ID: <50A00276.2090002@redhat.com> Date: Sun, 11 Nov 2012 19:54:00 -0000 From: Andrew Haley User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20120911 Thunderbird/15.0.1 MIME-Version: 1.0 To: Xin Tong CC: gcc-help@gcc.gnu.org Subject: Re: gcc compile for code size References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org X-SW-Source: 2012-11/txt/msg00054.txt.bz2 On 11/11/2012 07:47 PM, Xin Tong wrote: > when gcc is set to compile for minimal code size, what kind of > optimizations does gcc apply in comparison to compile for performance > ? or it is just gcc spends more time doing the compilation, selecting > instruction sequences that are optimal for code size. No. GCC does all optimizations *except* those known to increase program size. This usually works pretty well, but isn't perfect. Andrew.