OSDN Git Service

PR c/20187
[pf3gnuchains/gcc-fork.git] / gcc / tree-loop-linear.c
index 0835a45..0b13e2b 100644 (file)
@@ -16,15 +16,14 @@ for more details.
 
 You should have received a copy of the GNU General Public License
 along with GCC; see the file COPYING.  If not, write to the Free
-Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA.  */
+Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301, USA.  */
 
 
 #include "config.h"
 #include "system.h"
 #include "coretypes.h"
 #include "tm.h"
-#include "errors.h"
 #include "ggc.h"
 #include "tree.h"
 #include "target.h"
@@ -243,6 +242,8 @@ void
 linear_transform_loops (struct loops *loops)
 {
   unsigned int i;
+  VEC(tree,heap) *oldivs = NULL;
+  VEC(tree,heap) *invariants = NULL;
   
   for (i = 1; i < loops->num; i++)
     {
@@ -251,8 +252,6 @@ linear_transform_loops (struct loops *loops)
       varray_type dependence_relations;
       struct loop *loop_nest = loops->parray[i];
       struct loop *temp;
-      VEC (tree) *oldivs = NULL;
-      VEC (tree) *invariants = NULL;
       lambda_loopnest before, after;
       lambda_trans_matrix trans;
       bool problem = false;
@@ -273,6 +272,8 @@ linear_transform_loops (struct loops *loops)
            } */
       if (!loop_nest || !loop_nest->inner)
        continue;
+      VEC_truncate (tree, oldivs, 0);
+      VEC_truncate (tree, invariants, 0);
       depth = 1;
       for (temp = loop_nest->inner; temp; temp = temp->inner)
        {
@@ -294,7 +295,7 @@ linear_transform_loops (struct loops *loops)
                               "dependence_relations");
       
   
-      compute_data_dependences_for_loop (depth, loop_nest,
+      compute_data_dependences_for_loop (loop_nest, true,
                                         &datarefs, &dependence_relations);
       if (dump_file && (dump_flags & TDF_DETAILS))
        {
@@ -365,15 +366,11 @@ linear_transform_loops (struct loops *loops)
                                       after, trans);
       if (dump_file)
        fprintf (dump_file, "Successfully transformed loop.\n");
-      oldivs = NULL;
-      invariants = NULL;
       free_dependence_relations (dependence_relations);
       free_data_refs (datarefs);
     }
+  VEC_free (tree, heap, oldivs);
+  VEC_free (tree, heap, invariants);
   scev_reset ();
-  rewrite_into_ssa (false);
-  rewrite_into_loop_closed_ssa (NULL);
-#ifdef ENABLE_CHECKING
-  verify_loop_closed_ssa ();
-#endif
+  rewrite_into_loop_closed_ssa (NULL, TODO_update_ssa_full_phi);
 }