From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20969 invoked by alias); 27 Sep 2011 05:05:24 -0000 Received: (qmail 20959 invoked by uid 22791); 27 Sep 2011 05:05:21 -0000 X-SWARE-Spam-Status: No, hits=-1.1 required=5.0 tests=AWL,BAYES_00,SPF_NEUTRAL X-Spam-Check-By: sourceware.org Received: from relmlor2.renesas.com (HELO relmlor2.renesas.com) (210.160.252.172) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 27 Sep 2011 05:05:04 +0000 Received: from relmlir3.idc.renesas.com ([10.200.68.153]) by relmlor2.idc.renesas.com ( SJSMS) with ESMTP id <0LS600A9X0SEYF00@relmlor2.idc.renesas.com> for gcc-help@gcc.gnu.org; Tue, 27 Sep 2011 14:05:02 +0900 (JST) Received: from relmlac4.idc.renesas.com ([10.200.69.24]) by relmlir3.idc.renesas.com ( SJSMS) with ESMTP id <0LS600DDN0SEQFB0@relmlir3.idc.renesas.com> for gcc-help@gcc.gnu.org; Tue, 27 Sep 2011 14:05:02 +0900 (JST) Received: by relmlac4.idc.renesas.com (Postfix, from userid 0) id 7D68D4808A; Tue, 27 Sep 2011 14:05:02 +0900 (JST) Received: from relmlac4.idc.renesas.com (localhost [127.0.0.1]) by relmlac4.idc.renesas.com (Postfix) with ESMTP id 387BC48070; Tue, 27 Sep 2011 14:05:02 +0900 (JST) Received: from relmlii2.idc.renesas.com [10.200.68.66] by relmlac4.idc.renesas.com with ESMTP id QAB19639; Tue, 27 Sep 2011 14:05:02 +0900 Received: from unknown (HELO relay51.aps.necel.com) ([10.29.19.60]) by relmlii2.idc.renesas.com with ESMTP; Tue, 27 Sep 2011 14:05:01 +0900 Received: from dhlpc061 (dhlpc061.dev.necel.com [10.114.96.161]) by relay51.aps.necel.com (8.14.4+Sun/8.14.4) with ESMTP id p8R54x4Y027269; Tue, 27 Sep 2011 14:04:59 +0900 (JST) Received: by dhlpc061 (Postfix, from userid 31295) id C222552E221; Tue, 27 Sep 2011 14:04:59 +0900 (JST) From: Miles Bader To: Jeff Law Cc: Jeff Kenton , Ian Lance Taylor , David Brown , Georg-Johann Lay , gcc-help@gcc.gnu.org, charfiasma@yahoo.fr Subject: Re: Tr : [redundency elimination, code motion, commun expression elimination] GCC optimizations References: <1316712613.83211.YahooMailNeo@web28503.mail.ukl.yahoo.com> <1316721552.42227.YahooMailNeo@web28508.mail.ukl.yahoo.com> <4E7C4771.40803@gjlay.de> <4E7C4CCA.2010001@westcontrol.com> <4E7CAB71.10901@tilera.com> <4E7CAE48.4090005@redhat.com> System-Type: x86_64-unknown-linux-gnu Blat: Foop Date: Tue, 27 Sep 2011 07:18:00 -0000 In-reply-to: <4E7CAE48.4090005@redhat.com> Message-id: MIME-version: 1.0 Content-type: text/plain 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: 2011-09/txt/msg00217.txt.bz2 Jeff Law writes: > The tail merging code in the RTL optimizers might pick this stuff up > and Tom's work on block merging might as well. It'd be worth > looking into why they aren't triggering. Hmm, actually testing with a recent gcc snapshot, it _is_ merging the two if-blocks: int a, b, c, d, e, f; extern void foo (); void t (int x) { if (x==1) { a=b; c=d; e=f; foo(); } if (x==2) { a=b; c=d; e=f; foo(); } } => t: cmpl $1, %edi je .L4 cmpl $2, %edi je .L4 rep ret .L4: movl b(%rip), %eax movl %eax, a(%rip) movl d(%rip), %eax movl %eax, c(%rip) movl f(%rip), %eax movl %eax, e(%rip) xorl %eax, %eax jmp foo ... .ident "GCC: (Debian 20110924-1) 4.7.0 20110924 (experimental) [trunk revision 179143]" -Miles -- Quotation, n. The act of repeating erroneously the words of another. The words erroneously repeated.