* tree-predcom.c (determine_roots_comp): Skip trivial components.
authorBin Cheng <bin.cheng@arm.com>
Fri, 28 Jul 2017 14:54:20 +0000 (14:54 +0000)
committerBin Cheng <amker@gcc.gnu.org>
Fri, 28 Jul 2017 14:54:20 +0000 (14:54 +0000)
From-SVN: r250665

gcc/ChangeLog
gcc/tree-predcom.c

index d153c13..0419984 100644 (file)
@@ -1,3 +1,7 @@
+2017-07-28  Bin Cheng  <bin.cheng@arm.com>
+
+       * tree-predcom.c (determine_roots_comp): Skip trivial components.
+
 2017-07-28  Richard Biener  <rguenther@suse.de>
 
        * match.pd: Remove superfluous :c.
index 6baa606..536fe34 100644 (file)
@@ -1227,8 +1227,11 @@ determine_roots_comp (struct loop *loop,
       return;
     }
 
-  comp->refs.qsort (order_drefs);
+  /* Trivial component.  */
+  if (comp->refs.length () <= 1)
+    return;
 
+  comp->refs.qsort (order_drefs);
   FOR_EACH_VEC_ELT (comp->refs, i, a)
     {
       if (!chain || DR_IS_WRITE (a->ref)