From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17452 invoked by alias); 2 Jun 2005 18:55:28 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 17299 invoked by uid 48); 2 Jun 2005 18:55:13 -0000 Date: Thu, 02 Jun 2005 18:55:00 -0000 From: "jakub at gcc dot gnu dot org" To: gcc-bugs@gcc.gnu.org Message-ID: <20050602185512.21883.jakub@gcc.gnu.org> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug tree-optimization/21883] New: tree-ssa-dom.c causing excessive code duplication X-Bugzilla-Reason: CC X-SW-Source: 2005-06/txt/msg00272.txt.bz2 List-Id: extern int foo1 (void), foo2 (int); int bar (int x) { int varvar1, varvar2; int z; if (x > 913) varvar1 = foo1 (); else varvar2 = foo2 (6); #define A foo1 (); foo1 (); foo1 (); foo1 (); foo1 (); #define B A A A A A A A A A A #define C B B B B B B B B B B C C C C C C C C C C C if (x > 913) z = varvar1 + foo1 (); else z = varvar2 + foo2 (6); return z; } Current HEAD will duplicate all the 2500 foo1 () calls to save a if (x > 913) comparison. With -Os almost no duplication should be allowed (only if the duplicated instructions are expected to be shorter than the compare and branch), and even with -O2 there should be some sensible limit. -- Summary: tree-ssa-dom.c causing excessive code duplication Product: gcc Version: 4.1.0 Status: UNCONFIRMED Severity: normal Priority: P2 Component: tree-optimization AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: jakub at gcc dot gnu dot org CC: gcc-bugs at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21883