diff options
author | Richard Guenther <rguenther@suse.de> | 2011-01-11 17:01:37 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2011-01-11 17:01:37 +0000 |
commit | 1b248907583f1cf4e02ce4168ad35cf3fe7637ba (patch) | |
tree | ad4d13dcea7597523744fdf9b6ed3615f537edce /gcc/tree-ssa.c | |
parent | 403c753b6f6c7b3eba00b73686bf990e3dfedf1e (diff) | |
download | gcc-1b248907583f1cf4e02ce4168ad35cf3fe7637ba.tar.gz |
re PR tree-optimization/46076 (constant propagation and compile-time math no longer happening versus 4.4 and 4.5)
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.
From-SVN: r168665
Diffstat (limited to 'gcc/tree-ssa.c')
-rw-r--r-- | gcc/tree-ssa.c | 5 |
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)) |