aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa.c
diff options
context:
space:
mode:
authorRichard Biener <rguenth@gcc.gnu.org>2008-10-16 08:19:49 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2008-10-16 08:19:49 +0000
commitbd4a51ab34c0033d7359f3cb138d2efeb5efb5e9 (patch)
treee8d65b04c2d8f9c3a71d5eab0ef74c5a07810ace /gcc/tree-ssa.c
parent5b429886c5e390a0d7ae27311f859d2ae1d4b2c1 (diff)
downloadgcc-bd4a51ab34c0033d7359f3cb138d2efeb5efb5e9.zip
gcc-bd4a51ab34c0033d7359f3cb138d2efeb5efb5e9.tar.gz
gcc-bd4a51ab34c0033d7359f3cb138d2efeb5efb5e9.tar.bz2
re PR middle-end/37418 (error: type mismatch in address expression, verify_gimple failed)
2008-10-16 Joseph Myers <joseph@codesourcery.com> Richard Guenther <rguenther@suse.de> PR middle-end/37418 * tree-ssa.c (useless_type_conversion_p_1): Do not treat volatile qualified functions or methods as relevant. * gcc.c-torture/compile/pr37418-1.c, gcc.c-torture/compile/pr37418-2.c, gcc.c-torture/compile/pr37418-3.c, gcc.c-torture/compile/pr37418-4.c: New tests. From-SVN: r141165
Diffstat (limited to 'gcc/tree-ssa.c')
-rw-r--r--gcc/tree-ssa.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/gcc/tree-ssa.c b/gcc/tree-ssa.c
index c53c528..8f238a3 100644
--- a/gcc/tree-ssa.c
+++ b/gcc/tree-ssa.c
@@ -1125,9 +1125,14 @@ useless_type_conversion_p_1 (tree outer_type, tree inner_type)
{
/* Don't lose casts between pointers to volatile and non-volatile
qualified types. Doing so would result in changing the semantics
- of later accesses. */
- if ((TYPE_VOLATILE (TREE_TYPE (outer_type))
- != TYPE_VOLATILE (TREE_TYPE (inner_type)))
+ of later accesses. For function types the volatile qualifier
+ is used to indicate noreturn functions. */
+ if (TREE_CODE (TREE_TYPE (outer_type)) != FUNCTION_TYPE
+ && TREE_CODE (TREE_TYPE (outer_type)) != METHOD_TYPE
+ && TREE_CODE (TREE_TYPE (inner_type)) != FUNCTION_TYPE
+ && TREE_CODE (TREE_TYPE (inner_type)) != METHOD_TYPE
+ && (TYPE_VOLATILE (TREE_TYPE (outer_type))
+ != TYPE_VOLATILE (TREE_TYPE (inner_type)))
&& TYPE_VOLATILE (TREE_TYPE (outer_type)))
return false;