re PR middle-end/47281 (error: non-trivial conversion at assignment)
authorRichard Guenther <rguenther@suse.de>
Fri, 14 Jan 2011 12:39:09 +0000 (12:39 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Fri, 14 Jan 2011 12:39:09 +0000 (12:39 +0000)
2011-01-14  Richard Guenther  <rguenther@suse.de>

PR middle-end/47281
Revert
2011-01-11  Richard Guenther  <rguenther@suse.de>

        PR tree-optimization/46076
        * tree-ssa.c (useless_type_conversion_p): Conversions from
        unprototyped to empty argument list function types are useless.

* gcc.dg/torture/pr47281.c: New testcase.
* gcc.dg/tree-ssa/pr46076.c: XFAIL.

From-SVN: r168781

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/torture/pr47281.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/tree-ssa/pr46076.c
gcc/tree-ssa.c

index 939d7f197c9e8e822cf358a334d76f8cb65df15d..ad614d31cc0de6af8991b012d014a14dcb811647 100644 (file)
@@ -1,3 +1,13 @@
+2011-01-14  Richard Guenther  <rguenther@suse.de>
+
+       PR middle-end/47281
+       Revert
+       2011-01-11  Richard Guenther  <rguenther@suse.de>
+
+        PR tree-optimization/46076
+        * tree-ssa.c (useless_type_conversion_p): Conversions from
+        unprototyped to empty argument list function types are useless.
+
 2011-01-14  Richard Guenther  <rguenther@suse.de>
 
        PR tree-optimization/47286
index ed3a7870c4d91e97616d721560609bcf094e4d48..c67c37c43022c89086ba07bf5d3e25dd5cd930de 100644 (file)
@@ -1,3 +1,9 @@
+2011-01-14  Richard Guenther  <rguenther@suse.de>
+
+       PR middle-end/47281
+       * gcc.dg/torture/pr47281.c: New testcase.
+       * gcc.dg/tree-ssa/pr46076.c: XFAIL.
+
 2011-01-14  Richard Guenther  <rguenther@suse.de>
 
        PR tree-optimization/47286
diff --git a/gcc/testsuite/gcc.dg/torture/pr47281.c b/gcc/testsuite/gcc.dg/torture/pr47281.c
new file mode 100644 (file)
index 0000000..517e854
--- /dev/null
@@ -0,0 +1,23 @@
+/* { dg-do compile } */
+
+struct T;
+typedef void F(void);
+
+F* aux(void (*x)())
+{
+  return x;
+}
+
+void make_mess (int);
+
+F*
+get_funloc (void (*x)(int), F* (*y)())
+{
+  return y(x);
+}
+
+F*
+foo ()
+{
+  return get_funloc (make_mess, aux);
+}
index a2777a604b9b8627f274d8124660f7c68ec78d32..e9dc434ece028dc869e646167be59b17338982b0 100644 (file)
@@ -1,7 +1,7 @@
 /* { dg-do link } */
 /* { dg-options "-O2" } */
 
-extern void link_error (void);
+extern void link_error (void) { /* XFAIL */ }
 
 typedef unsigned char(*Calculable)(void);
 
index aa797e22bec7bece2f89f8b2defe2fdb7e53b2b2..7bd01f8d4dbac7f023d8ce50fedaacd6d56f4d0e 100644 (file)
@@ -1410,11 +1410,6 @@ useless_type_conversion_p (tree outer_type, tree inner_type)
       if (!prototype_p (outer_type))
        return true;
 
-      /* A conversion between unprototyped and empty argument list is ok.  */
-      if (TYPE_ARG_TYPES (outer_type) == void_list_node
-         && !prototype_p (inner_type))
-       return true;
-
       /* If the unqualified argument types are compatible the conversion
         is useless.  */
       if (TYPE_ARG_TYPES (outer_type) == TYPE_ARG_TYPES (inner_type))