Patchwork Fix PR48270

login
register
mail settings
Submitter Richard Guenther
Date March 24, 2011, 2:38 p.m.
Message ID <alpine.LNX.2.00.1103241537580.810@zhemvz.fhfr.qr>
Download mbox | patch
Permalink /patch/88205/
State New
Headers show

Comments

Richard Guenther - March 24, 2011, 2:38 p.m.
Bootstrapped and tested on x86_64-unknonw-linux-gnu, applied.

Richard.

2011-03-24  Richard Guenther  <rguenther@suse.de>

	PR tree-optimization/48270
	* tree-ssa-phiopt.c (cond_if_else_store_replacement): Do
	not free datarefs before ddrs.

Patch

Index: gcc/tree-ssa-phiopt.c
===================================================================
--- gcc/tree-ssa-phiopt.c	(revision 171388)
+++ gcc/tree-ssa-phiopt.c	(working copy)
@@ -1494,8 +1494,6 @@  cond_if_else_store_replacement (basic_bl
   else_ddrs = VEC_alloc (ddr_p, heap, 1);
   compute_all_dependences (then_datarefs, &then_ddrs, NULL, false);
   compute_all_dependences (else_datarefs, &else_ddrs, NULL, false);
-  free_data_refs (then_datarefs);
-  free_data_refs (else_datarefs);
   blocks[0] = then_bb;
   blocks[1] = else_bb;
   blocks[2] = join_bb;
@@ -1517,6 +1515,8 @@  cond_if_else_store_replacement (basic_bl
         {
           free_dependence_relations (then_ddrs);
           free_dependence_relations (else_ddrs);
+	  free_data_refs (then_datarefs);
+	  free_data_refs (else_datarefs);
           VEC_free (gimple, heap, then_stores);
           VEC_free (gimple, heap, else_stores);
           return false;
@@ -1539,6 +1539,8 @@  cond_if_else_store_replacement (basic_bl
         {
           free_dependence_relations (then_ddrs);
           free_dependence_relations (else_ddrs);
+	  free_data_refs (then_datarefs);
+	  free_data_refs (else_datarefs);
           VEC_free (gimple, heap, then_stores);
           VEC_free (gimple, heap, else_stores);
           return false;
@@ -1556,6 +1558,8 @@  cond_if_else_store_replacement (basic_bl
 
   free_dependence_relations (then_ddrs);
   free_dependence_relations (else_ddrs);
+  free_data_refs (then_datarefs);
+  free_data_refs (else_datarefs);
   VEC_free (gimple, heap, then_stores);
   VEC_free (gimple, heap, else_stores);