From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13163 invoked by alias); 8 Feb 2005 18:31:25 -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 13151 invoked by uid 48); 8 Feb 2005 18:31:22 -0000 Date: Wed, 09 Feb 2005 03:09:00 -0000 From: "pinskia at gcc dot gnu dot org" To: gcc-bugs@gcc.gnu.org Message-ID: <20050208183121.19827.pinskia@gcc.gnu.org> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug tree-optimization/19827] New: Missed pure/const optimization X-Bugzilla-Reason: CC X-SW-Source: 2005-02/txt/msg00562.txt.bz2 List-Id: The following two function should produce the same asm because we can skip the second call to f: int f(void) __attribute__((const,pure)); int g(int i, int j) { int k = 0; if(i) k = f(); if (j) k = f(); return k; } int h(int i, int j) { int k = 0; if(i) k = f(); else if (j) k = f(); return k; } -- Summary: Missed pure/const optimization Product: gcc Version: 4.0.0 Status: UNCONFIRMED Keywords: missed-optimization Severity: enhancement Priority: P2 Component: tree-optimization AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: pinskia at gcc dot gnu dot org CC: gcc-bugs at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19827