diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 939d7f197c9..ad614d31cc0 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,13 @@ +2011-01-14 Richard Guenther + + PR middle-end/47281 + Revert + 2011-01-11 Richard Guenther + + 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 PR tree-optimization/47286 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index ed3a7870c4d..c67c37c4302 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2011-01-14 Richard Guenther + + PR middle-end/47281 + * gcc.dg/torture/pr47281.c: New testcase. + * gcc.dg/tree-ssa/pr46076.c: XFAIL. + 2011-01-14 Richard Guenther 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 index 00000000000..517e8548e3f --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr47281.c @@ -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); +} diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr46076.c b/gcc/testsuite/gcc.dg/tree-ssa/pr46076.c index a2777a604b9..e9dc434ece0 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/pr46076.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/pr46076.c @@ -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); diff --git a/gcc/tree-ssa.c b/gcc/tree-ssa.c index aa797e22bec..7bd01f8d4db 100644 --- a/gcc/tree-ssa.c +++ b/gcc/tree-ssa.c @@ -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))