re PR rtl-optimization/55489 (insane PRE memory usage with PIE (translate.i))
authorPaolo Bonzini <pbonzini@redhat.com>
Tue, 27 Nov 2012 20:29:15 +0000 (20:29 +0000)
committerPaolo Bonzini <bonzini@gcc.gnu.org>
Tue, 27 Nov 2012 20:29:15 +0000 (20:29 +0000)
2012-11-27  Paolo Bonzini  <pbonzini@redhat.com>

PR rtl-optimization/55489
* gcse.c (compute_transp): Precompute a canonical version
of XEXP (x, 0), and pass it to canon_true_dependence.

* alias.c (init_alias_analysis): Fix allocation of reg_known_value.

From-SVN: r193868

gcc/ChangeLog
gcc/alias.c
gcc/gcse.c

index 03ed43a789d3c1e0b2fb86ccbce3bc8a0e359610..3efad5a1700dc7c17ddf79114455a32a3ae440a3 100644 (file)
@@ -1,3 +1,11 @@
+2012-11-27  Paolo Bonzini  <pbonzini@redhat.com>
+
+       PR rtl-optimization/55489
+       * gcse.c (compute_transp): Precompute a canonical version
+       of XEXP (x, 0), and pass it to canon_true_dependence.
+
+       * alias.c (init_alias_analysis): Fix allocation of reg_known_value.
+
 2012-11-27  Diego Novillo  <dnovillo@google.com>
 
        * vec.h: Replace 'class vec' with 'struct vec' everywhere.
index 15fd7f3180426560cbaf1340a031537f08f4bc8d..130c1a4950badc1372f71991640372286f6d6c5e 100644 (file)
@@ -2808,7 +2808,7 @@ init_alias_analysis (void)
 
   timevar_push (TV_ALIAS_ANALYSIS);
 
-  vec_alloc (reg_known_value, maxreg - FIRST_PSEUDO_REGISTER);
+  vec_safe_grow_cleared (reg_known_value, maxreg - FIRST_PSEUDO_REGISTER);
   reg_known_equiv_p = sbitmap_alloc (maxreg - FIRST_PSEUDO_REGISTER);
 
   /* If we have memory allocated from the previous run, use it.  */
index ad09afd0d6deba71b17ded7a7b015bbde50ac87a..ee45b6544f96733065c43fa8014b972f952c99ff 100644 (file)
@@ -1677,6 +1677,10 @@ compute_transp (const_rtx x, int indx, sbitmap *bmap)
        {
          bitmap_iterator bi;
          unsigned bb_index;
+         rtx x_addr;
+
+         x_addr = get_addr (XEXP (x, 0));
+         x_addr = canon_rtx (x_addr);
 
          /* First handle all the blocks with calls.  We don't need to
             do any list walking for them.  */
@@ -1685,27 +1689,27 @@ compute_transp (const_rtx x, int indx, sbitmap *bmap)
              bitmap_clear_bit (bmap[bb_index], indx);
            }
 
-           /* Now iterate over the blocks which have memory modifications
-              but which do not have any calls.  */
-           EXECUTE_IF_AND_COMPL_IN_BITMAP (modify_mem_list_set,
-                                           blocks_with_calls,
-                                           0, bb_index, bi)
-             {
-               vec<modify_pair> list
-                 = canon_modify_mem_list[bb_index];
-               modify_pair *pair;
-               unsigned ix;
+         /* Now iterate over the blocks which have memory modifications
+            but which do not have any calls.  */
+         EXECUTE_IF_AND_COMPL_IN_BITMAP (modify_mem_list_set,
+                                         blocks_with_calls,
+                                         0, bb_index, bi)
+           {
+             vec<modify_pair> list
+               = canon_modify_mem_list[bb_index];
+             modify_pair *pair;
+             unsigned ix;
 
-               FOR_EACH_VEC_ELT_REVERSE (list, ix, pair)
-                 {
-                   rtx dest = pair->dest;
-                   rtx dest_addr = pair->dest_addr;
+             FOR_EACH_VEC_ELT_REVERSE (list, ix, pair)
+               {
+                 rtx dest = pair->dest;
+                 rtx dest_addr = pair->dest_addr;
 
-                   if (canon_true_dependence (dest, GET_MODE (dest),
-                                              dest_addr, x, NULL_RTX))
-                     bitmap_clear_bit (bmap[bb_index], indx);
-                 }
-             }
+                 if (canon_true_dependence (dest, GET_MODE (dest),
+                                            dest_addr, x, x_addr))
+                   bitmap_clear_bit (bmap[bb_index], indx);
+               }
+           }
        }
 
       x = XEXP (x, 0);