OSDN Git Service

2012-09-20 Richard Guenther <rguenther@suse.de>
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 20 Sep 2012 14:51:59 +0000 (14:51 +0000)
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 20 Sep 2012 14:51:59 +0000 (14:51 +0000)
Backport from mainline
2012-09-11  Jan Hubicka  <jh@suse.cz>

PR lto/54312
* lto.c (uniquify_nodes): Remove quadratic loop checking if the
type is variant leader.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_7-branch@191568 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/lto/ChangeLog
gcc/lto/lto.c

index e3cece5..878f110 100644 (file)
@@ -1,3 +1,12 @@
+2012-09-20  Richard Guenther  <rguenther@suse.de>
+
+       Backport from mainline
+       2012-09-11  Jan Hubicka  <jh@suse.cz>
+
+       PR lto/54312
+       * lto.c (uniquify_nodes): Remove quadratic loop checking if the
+       type is variant leader.
+
 2012-09-20  Release Manager
 
        * GCC 4.7.2 released.
index 3e7503b..2f100d9 100644 (file)
@@ -761,6 +761,7 @@ uniquify_nodes (struct data_in *data_in, unsigned from)
             variant list state before fixup is broken.  */
          tree tem, mv;
 
+#ifdef ENABLE_CHECKING
          /* Remove us from our main variant list if we are not the
             variant leader.  */
          if (TYPE_MAIN_VARIANT (t) != t)
@@ -768,10 +769,9 @@ uniquify_nodes (struct data_in *data_in, unsigned from)
              tem = TYPE_MAIN_VARIANT (t);
              while (tem && TYPE_NEXT_VARIANT (tem) != t)
                tem = TYPE_NEXT_VARIANT (tem);
-             if (tem)
-               TYPE_NEXT_VARIANT (tem) = TYPE_NEXT_VARIANT (t);
-             TYPE_NEXT_VARIANT (t) = NULL_TREE;
+             gcc_assert (!tem && !TYPE_NEXT_VARIANT (t));
            }
+#endif
 
          /* Query our new main variant.  */
          mv = GIMPLE_REGISTER_TYPE (TYPE_MAIN_VARIANT (t));