aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-cfg.c
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2010-10-20 14:11:06 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2010-10-20 14:11:06 +0000
commit1b0e3802574b1bced2cc7304b2495213e8edc7d5 (patch)
treeeaf5024674c4d0ed963c89ed951911b20901e7c9 /gcc/tree-cfg.c
parent519345901bc8ee08de2ea9c450aa56594724f4e7 (diff)
downloadgcc-1b0e3802574b1bced2cc7304b2495213e8edc7d5.zip
gcc-1b0e3802574b1bced2cc7304b2495213e8edc7d5.tar.gz
gcc-1b0e3802574b1bced2cc7304b2495213e8edc7d5.tar.bz2
re PR lto/45667 (ICE: verify_stmts failed: type mismatch in address expression with -flto)
2010-10-20 Richard Guenther <rguenther@suse.de> PR lto/45667 * lto-streamer-out.c (output_gimple_stmt): Fix typo. * tree-cfg.c (verify_gimple_call): Properly get the call fndecl. (verify_gimple_assign_single): Disable ADDR_EXPR type check when in LTO. * g++.dg/lto/20101020-1_0.h: New testcase. * g++.dg/lto/20101020-1_0.C: Likewise. * g++.dg/lto/20101020-1_1.C: Likewise. From-SVN: r165725
Diffstat (limited to 'gcc/tree-cfg.c')
-rw-r--r--gcc/tree-cfg.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c
index ff0c2ad..bffa679 100644
--- a/gcc/tree-cfg.c
+++ b/gcc/tree-cfg.c
@@ -3107,8 +3107,7 @@ verify_gimple_call (gimple stmt)
call, and the decl should have DECL_STATIC_CHAIN set. */
if (gimple_call_chain (stmt))
{
- if (TREE_CODE (fn) != ADDR_EXPR
- || TREE_CODE (TREE_OPERAND (fn, 0)) != FUNCTION_DECL)
+ if (!gimple_call_fndecl (stmt))
{
error ("static chain in indirect gimple call");
return true;
@@ -3698,7 +3697,13 @@ verify_gimple_assign_single (gimple stmt)
return true;
}
- if (!types_compatible_p (TREE_TYPE (op), TREE_TYPE (TREE_TYPE (rhs1)))
+ /* Technically there is no longer a need for matching types, but
+ gimple hygiene asks for this check. In LTO we can end up
+ combining incompatible units and thus end up with addresses
+ of globals that change their type to a common one. */
+ if (!in_lto_p
+ && !types_compatible_p (TREE_TYPE (op),
+ TREE_TYPE (TREE_TYPE (rhs1)))
&& !one_pointer_to_useless_type_conversion_p (TREE_TYPE (rhs1),
TREE_TYPE (op)))
{