From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30800 invoked by alias); 20 Jun 2005 14:55:12 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 30582 invoked by uid 22791); 20 Jun 2005 14:54:48 -0000 Received: from topconrd.ru (HELO TopconRD.RU) (62.105.138.7) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Mon, 20 Jun 2005 14:54:48 +0000 Received: from osv.topcon.com (ttc.topconrd.ru [62.105.138.5]) by TopconRD.RU (8.12.3/8.12.3/Debian-6.6) with ESMTP id j5KEsiL0024166; Mon, 20 Jun 2005 18:54:45 +0400 To: Andrew Pinski Cc: gcc@gcc.gnu.org Subject: Re: How to replace -O1 with corresponding -f's? References: <878y159mhr.fsf@osv.topcon.com> <17078.52477.408454.106678@zapata.pink> <44a7432710d6ca83042f60c9fbab58d9@physics.uc.edu> X-attribution: osv From: Sergei Organov Date: Mon, 20 Jun 2005 14:55:00 -0000 In-Reply-To: <44a7432710d6ca83042f60c9fbab58d9@physics.uc.edu> Message-ID: <87zmtl84eo.fsf@osv.topcon.com> User-Agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Common Lisp) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2005-06/txt/msg00904.txt.bz2 Andrew Pinski writes: > On Jun 20, 2005, at 10:04 AM, Andrew Haley wrote: > >> How one finds out what optimization pass misbehaves? > > > > Look at the dumps. If you use the gcc option -da you'll get a full > > set of RTL dump files. > > And -fdump-tree-all for the tree dumps. The last const.c.t69.final_cleanup is exactly the same in both cases and doesn't have any useful information anyway: ;; Function osvf (osvf) osvf () { : return 3.14314314e+8; } In fact, at the RTL level the difference is that non-optimized code (insn 8 6 9 1 (set (reg:DF 118 [ D.1144 ]) (mem/u/i:DF (symbol_ref:SI ("osv") [flags 0x6] (nil)) (insn 9 8 10 1 (set (reg:DF 119 [ ]) (reg:DF 118 [ D.1144 ])) -1 (nil) (nil)) gets replaced with "optimized" one: (insn 10 9 11 1 (set (reg:SI 121) (high:SI (symbol_ref/u:SI ("*.LC0") [flags 0x2]))) -1 (nil) (nil)) (insn 11 10 12 1 (set (reg/f:SI 120) (lo_sum:SI (reg:SI 121) (symbol_ref/u:SI ("*.LC0") [flags 0x2]))) -1 (nil) (expr_list:REG_EQUAL (symbol_ref/u:SI ("*.LC0") [flags 0x2]) (nil))) (insn 12 11 13 1 (set (reg:DF 118 [ ]) (mem/u/i:DF (reg/f:SI 120) [0 S8 A64])) -1 (nil) (expr_list:REG_EQUAL (const_double:DF 3.14314314e+8 [0x0.95e0725p+29]) (nil))) so SYMBOL_FLAG_SMALL (flags 0x6 vs 0x2) is somehow being missed when -O1 is turned on. Seems to be something at tree-to-RTX conversion time. Constant folding? -- Sergei.