summaryrefslogtreecommitdiff
path: root/gcc/tree-ssa.c
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2011-01-11 17:01:37 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2011-01-11 17:01:37 +0000
commit25fe7e3d8b1d614dc09ee33436ada6dcd4047282 (patch)
treead4d13dcea7597523744fdf9b6ed3615f537edce /gcc/tree-ssa.c
parent71b657c99fb40c6c0aedb26fe97f9e322154006b (diff)
downloadgcc-25fe7e3d8b1d614dc09ee33436ada6dcd4047282.tar.gz
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/tree-ssa/pr46076.c: New testcase. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@168665 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa.c')
-rw-r--r--gcc/tree-ssa.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/tree-ssa.c b/gcc/tree-ssa.c
index 7bd01f8d4db..aa797e22bec 100644
--- a/gcc/tree-ssa.c
+++ b/gcc/tree-ssa.c
@@ -1410,6 +1410,11 @@ 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))