From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10538 invoked by alias); 29 Jun 2007 03:05:26 -0000 Received: (qmail 10356 invoked by uid 48); 29 Jun 2007 03:05:15 -0000 Date: Fri, 29 Jun 2007 03:05:00 -0000 Message-ID: <20070629030515.10355.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug tree-optimization/32120] missed PRE/FRE of a*2+4 and (a+2)*2 In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "pinskia 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: 2007-06/txt/msg02685.txt.bz2 ------- Comment #4 from pinskia at gcc dot gnu dot org 2007-06-29 03:05 ------- Note we should also optimize: int f(int a, int b) { int c = a+4; int d = c*2; int e = a*2; int f = e+4; return f+d; } into "a*2 + 12;" (or "(a+6)*2" ) so that only one mutliplication is there. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32120