From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26210 invoked by alias); 14 Jul 2004 13:57:03 -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 26202 invoked by uid 48); 14 Jul 2004 13:57:02 -0000 Date: Wed, 14 Jul 2004 13:57:00 -0000 From: "steven at gcc dot gnu dot org" To: gcc-bugs@gcc.gnu.org Message-ID: <20040714135701.16538.steven@gcc.gnu.org> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug tree-optimization/16538] New: Missed jump threading opportunity with struct fields (but RTL thread_jumps does catch it) X-Bugzilla-Reason: CC X-SW-Source: 2004-07/txt/msg01702.txt.bz2 List-Id: We are missing a few jump threading opportunities of the following form in SPEC and in GCC itself: ------------------------------------------------ struct foo { int field1; int field2; }; struct foo glob; void bar (void) { struct foo *g1, *g2; g1 = g2 = &glob; int i; if (!g1->field1) g1->field2 = g1->field1; if (!g2->field1) g2->field2 = g2->field1; } ------------------------------------------------ The .optimized dump looks like this: ;; Function bar (bar) bar () { int i; struct foo * g2; struct foo * g1; int T.1; int T.0; : if (glob.field1 == 0) goto ; else goto ; :; glob.field2 = 0; :; if (glob.field1 == 0) goto ; else goto ; :; glob.field2 = 0; :; return; } We eventually end up threading this jump on RTL. -- Summary: Missed jump threading opportunity with struct fields (but RTL thread_jumps does catch it) Product: gcc Version: 3.5.0 Status: UNCONFIRMED Keywords: missed-optimization Severity: normal Priority: P2 Component: tree-optimization AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: steven at gcc dot gnu dot org CC: dnovillo at redhat dot com,gcc-bugs at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16538