This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Fix PR56321


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  <rguenther@suse.de>

	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);
+ }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]