From 4d61856d0a221c695bbb5193ae18403d07cde0d4 Mon Sep 17 00:00:00 2001 From: Richard Guenther Date: Wed, 17 Jun 2009 10:29:22 +0000 Subject: [PATCH] re PR c++/40389 (optimizer bug (possibly)) 2009-06-17 Richard Guenther PR tree-optimization/40389 * tree-ssa-structalias.c (handle_rhs_call): Restrict NRV case to addressable types. * gimple.c (walk_stmt_load_store_addr_ops): Likewise. From-SVN: r148597 --- gcc/ChangeLog | 7 +++++++ gcc/gimple.c | 2 +- gcc/tree-ssa-structalias.c | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6fab0ba68e60..c21b72ef7ba8 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2009-06-17 Richard Guenther + + PR tree-optimization/40389 + * tree-ssa-structalias.c (handle_rhs_call): Restrict NRV case + to addressable types. + * gimple.c (walk_stmt_load_store_addr_ops): Likewise. + 2009-06-17 Richard Guenther PR middle-end/40460 diff --git a/gcc/gimple.c b/gcc/gimple.c index 91057b4db89a..4f18b78aee6c 100644 --- a/gcc/gimple.c +++ b/gcc/gimple.c @@ -3267,7 +3267,7 @@ walk_stmt_load_store_addr_ops (gimple stmt, void *data, if (visit_addr && gimple_call_return_slot_opt_p (stmt) && gimple_call_lhs (stmt) != NULL_TREE - && TREE_ADDRESSABLE (gimple_call_lhs (stmt))) + && TREE_ADDRESSABLE (TREE_TYPE (gimple_call_lhs (stmt)))) ret |= visit_addr (stmt, gimple_call_lhs (stmt), data); } else if (gimple_code (stmt) == GIMPLE_ASM) diff --git a/gcc/tree-ssa-structalias.c b/gcc/tree-ssa-structalias.c index f60b24c9c521..60863d560f52 100644 --- a/gcc/tree-ssa-structalias.c +++ b/gcc/tree-ssa-structalias.c @@ -3362,7 +3362,7 @@ handle_rhs_call (gimple stmt, VEC(ce_s, heap) **results) /* And if we applied NRV the address of the return slot escapes as well. */ if (gimple_call_return_slot_opt_p (stmt) && gimple_call_lhs (stmt) != NULL_TREE - && TREE_ADDRESSABLE (gimple_call_lhs (stmt))) + && TREE_ADDRESSABLE (TREE_TYPE (gimple_call_lhs (stmt)))) { VEC(ce_s, heap) *tmpc = NULL; struct constraint_expr lhsc, *c;