aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-inline.c
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2010-02-22 15:53:27 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2010-02-22 15:53:27 +0000
commitea2edf88eec93dd0ec532d2e837a7ac1bf62a1c2 (patch)
treec4319a78825fefbbe169d78d1f2716fb5d69d8e1 /gcc/tree-inline.c
parent669887fc19f995611f6dd7ed923aa6bd2726bbc1 (diff)
downloadgcc-ea2edf88eec93dd0ec532d2e837a7ac1bf62a1c2.zip
gcc-ea2edf88eec93dd0ec532d2e837a7ac1bf62a1c2.tar.gz
gcc-ea2edf88eec93dd0ec532d2e837a7ac1bf62a1c2.tar.bz2
re PR middle-end/43045 ([lto] ICE non-trivial conversion at assignment)
2010-02-22 Richard Guenther <rguenther@suse.de> PR lto/43045 * tree-inline.c (declare_return_variable): Use the type of the call stmt lhs if available. * gfortran.dg/lto/20100222-1_0.f03: New testcase. * gfortran.dg/lto/20100222-1_1.c: Likewise. From-SVN: r156966
Diffstat (limited to 'gcc/tree-inline.c')
-rw-r--r--gcc/tree-inline.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c
index 9c560b1..de8ca70 100644
--- a/gcc/tree-inline.c
+++ b/gcc/tree-inline.c
@@ -2542,9 +2542,16 @@ declare_return_variable (copy_body_data *id, tree return_slot, tree modify_dest)
tree caller = id->dst_fn;
tree result = DECL_RESULT (callee);
tree callee_type = TREE_TYPE (result);
- tree caller_type = TREE_TYPE (TREE_TYPE (callee));
+ tree caller_type;
tree var, use;
+ /* Handle type-mismatches in the function declaration return type
+ vs. the call expression. */
+ if (modify_dest)
+ caller_type = TREE_TYPE (modify_dest);
+ else
+ caller_type = TREE_TYPE (TREE_TYPE (callee));
+
/* We don't need to do anything for functions that don't return
anything. */
if (!result || VOID_TYPE_P (callee_type))