From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1608 invoked by alias); 4 Jun 2007 23:34:11 -0000 Received: (qmail 1581 invoked by uid 48); 4 Jun 2007 23:34:03 -0000 Date: Mon, 04 Jun 2007 23:34:00 -0000 Message-ID: <20070604233403.1580.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug tree-optimization/32183] [4.3 Regression] reassoc2 can more extra calculations into a loop In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "rakdver 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/msg00235.txt.bz2 ------- Comment #25 from rakdver at gcc dot gnu dot org 2007-06-04 23:34 ------- > > Reassoc should be fixed, we should not consider workarounds like this. > > Either fix or remove reassoc2 works for me :) One possible fix is attached; it prevents us from reassociating across loop boundaries. This might be too conservative, though, preventing us from optimizing e.g. x = ... y = ... while(...) { a = ... b = a + x; while (...) c = b + y; } So probably this restriction should be applied only in reassoc2 (or reassoc2 should be removed, if Daniel believes it is not useful). -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32183