]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Revert:
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 16 Oct 2015 11:06:14 +0000 (11:06 +0000)
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 16 Oct 2015 11:06:14 +0000 (11:06 +0000)
* ipa-icf-gimple.c (func_checker::compare_operand): Compare only
empty constructors.
* gcc.c-torture/compile/icfmatch.c: Add testcase

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@228875 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/ipa-icf-gimple.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/compile/icfmatch.c [new file with mode: 0644]

index aff6fe5fe87da043ac6729d860e0267f811e7578..9c9cc65cb9874be92a45eba7ff89512f5b40ef91 100644 (file)
@@ -1,3 +1,9 @@
+2015-10-11  Jan Hubicka  <hubicka@ucw.cz>
+
+       Revert:
+       * ipa-icf-gimple.c (func_checker::compare_operand): Compare only
+       empty constructors.
+
 2015-10-16  Eric Botcazou  <ebotcazou@adacore.com>
 
        * tree.c (recompute_tree_invariant_for_addr_expr): Assert that the
index 934ba9057649e3d4cf454bccb71e18e0c2b3708f..4696c803617b4ea81c6f26352553fae2b3bd2bbd 100644 (file)
@@ -415,9 +415,20 @@ func_checker::compare_operand (tree t1, tree t2)
   switch (TREE_CODE (t1))
     {
     case CONSTRUCTOR:
-      gcc_assert (!vec_safe_length (CONSTRUCTOR_ELTS (t1))
-                 && !vec_safe_length (CONSTRUCTOR_ELTS (t2)));
-      return true;
+      {
+       unsigned length1 = vec_safe_length (CONSTRUCTOR_ELTS (t1));
+       unsigned length2 = vec_safe_length (CONSTRUCTOR_ELTS (t2));
+
+       if (length1 != length2)
+         return return_false ();
+
+       for (unsigned i = 0; i < length1; i++)
+         if (!compare_operand (CONSTRUCTOR_ELT (t1, i)->value,
+                               CONSTRUCTOR_ELT (t2, i)->value))
+           return return_false();
+
+       return true;
+      }
     case ARRAY_REF:
     case ARRAY_RANGE_REF:
       /* First argument is the array, second is the index.  */
index 7d8b89fb19cb4bc863db1046d156f4b9fca464d7..3d5ad170ac93660f6745788cb6f5b98dc0b2038c 100644 (file)
@@ -1,3 +1,7 @@
+2015-10-11  Jan Hubicka  <hubicka@ucw.cz>
+
+       * gcc.c-torture/compile/icfmatch.c: Add testcase
+
 2015-10-16  Paolo Carlini  <paolo.carlini@oracle.com>
 
        PR c++/67926
diff --git a/gcc/testsuite/gcc.c-torture/compile/icfmatch.c b/gcc/testsuite/gcc.c-torture/compile/icfmatch.c
new file mode 100644 (file)
index 0000000..13aad2e
--- /dev/null
@@ -0,0 +1,11 @@
+typedef char __attribute__ ((vector_size (4))) v4qi;
+void retv (int a,int b,int c,int d, v4qi *ret)
+{
+  v4qi v = { a, b , c, d };
+  *ret = v;
+}
+void retv2 (int a,int b,int c,int d, v4qi *ret)
+{
+  v4qi v = { a, b , c, d };
+  *ret = v;
+}