From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24780 invoked by alias); 21 Nov 2008 16:57:07 -0000 Received: (qmail 18992 invoked by uid 48); 21 Nov 2008 16:55:38 -0000 Date: Fri, 21 Nov 2008 16:57:00 -0000 Message-ID: <20081121165538.18991.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug middle-end/38204] PRE for post dominating expressions In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "dberlin at gcc dot gnu dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2008-11/txt/msg01808.txt.bz2 ------- Comment #2 from dberlin at gcc dot gnu dot org 2008-11-21 16:55 ------- (In reply to comment #0) > For this function: > int test (int a, int b, int c, int g) > { > int d, e; > if (a) > d = b * c; > else > d = b - c; > e = b * c + g; > return d + e; > } > > the multiply expression is moved to both branches of the "if", it would be > better to move it before the "if". Intel's compiler does that. > Moving it before the if is a code size optimization that also happens to extend the lifetime of the multiply. So "better" is a relative term. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38204