diff options
author | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-10-20 14:11:06 +0000 |
---|---|---|
committer | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-10-20 14:11:06 +0000 |
commit | 491dbbe11005a847a51cb1db587b7507000999dc (patch) | |
tree | eaf5024674c4d0ed963c89ed951911b20901e7c9 /gcc/tree-cfg.c | |
parent | 588c67333a8732cf1bd560c880e6146b3fb1ddf0 (diff) | |
download | gcc-491dbbe11005a847a51cb1db587b7507000999dc.tar.gz |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@165725 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-cfg.c')
-rw-r--r-- | gcc/tree-cfg.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c index ff0c2ad2bf8..bffa67922ce 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))) { |