From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13796 invoked by alias); 18 Feb 2013 12:10:28 -0000 Received: (qmail 13761 invoked by uid 22791); 18 Feb 2013 12:10:23 -0000 X-SWARE-Spam-Status: No, hits=-5.4 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,TW_TM X-Spam-Check-By: sourceware.org Received: from cantor2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 18 Feb 2013 12:10:19 +0000 Received: from relay1.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id A4ACDA5245 for ; Mon, 18 Feb 2013 13:10:18 +0100 (CET) Date: Mon, 18 Feb 2013 12:10:00 -0000 From: Richard Biener To: gcc-patches@gcc.gnu.org Subject: [PATCH] Fix PR56321 Message-ID: User-Agent: Alpine 2.00 (LNX 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2013-02/txt/msg00847.txt.bz2 This fixes PR56321 - the unlink_stmt_vdef was a no-op as it was called after release_defs. Oops. Committed as obvoious. Richard. 2013-02-18 Richard Biener PR tree-optimization/56321 * tree-ssa-reassoc.c (propagate_op_to_single_use): Properly order SSA name release and virtual operand unlinking. * gcc.dg/torture/pr56321.c: New testcase. Index: gcc/tree-ssa-reassoc.c =================================================================== *** gcc/tree-ssa-reassoc.c (revision 196115) --- gcc/tree-ssa-reassoc.c (working copy) *************** propagate_op_to_single_use (tree op, gim *** 1062,1072 **** if (TREE_CODE (op) != SSA_NAME) update_stmt (use_stmt); gsi = gsi_for_stmt (stmt); gsi_remove (&gsi, true); release_defs (stmt); - - if (is_gimple_call (stmt)) - unlink_stmt_vdef (stmt); } /* Walks the linear chain with result *DEF searching for an operation --- 1062,1070 ---- if (TREE_CODE (op) != SSA_NAME) update_stmt (use_stmt); gsi = gsi_for_stmt (stmt); + unlink_stmt_vdef (stmt); gsi_remove (&gsi, true); release_defs (stmt); } /* Walks the linear chain with result *DEF searching for an operation Index: gcc/testsuite/gcc.dg/torture/pr56321.c =================================================================== *** gcc/testsuite/gcc.dg/torture/pr56321.c (revision 0) --- gcc/testsuite/gcc.dg/torture/pr56321.c (working copy) *************** *** 0 **** --- 1,11 ---- + /* { dg-do compile } */ + /* { dg-options "-ffast-math" } */ + + void foo(int n, int nreps, float tdgefa, float tdgesl) + { + float kflops,ops; + ops=((2.0*n*n*n)/3.0+2.0*n*n); + kflops=2.*nreps*ops/(1000.*(tdgefa+tdgesl)); + + __builtin_printf ("%f\n", kflops); + }