diff options
author | Richard Guenther <rguenther@suse.de> | 2008-01-09 15:46:49 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2008-01-09 15:46:49 +0000 |
commit | c3e203cf80e81a73402d0ae6ba9b3961394c0434 (patch) | |
tree | 87b56af963095d9e1a946e5466753f49b22bb989 /gcc/gimplify.c | |
parent | def49dd7ca01bdeea7cf61c90da4206609e65ce5 (diff) | |
download | gcc-c3e203cf80e81a73402d0ae6ba9b3961394c0434.zip gcc-c3e203cf80e81a73402d0ae6ba9b3961394c0434.tar.gz gcc-c3e203cf80e81a73402d0ae6ba9b3961394c0434.tar.bz2 |
re PR tree-optimization/30132 (ICE in find_lattice_value, at tree-complex.c:133)
2008-01-09 Richard Guenther <rguenther@suse.de>
Andrew Pinski <andrew_pinski@playstation.sony.com>
PR middle-end/30132
* gimplify.c (gimplify_cond_expr): Do not create an addressable
temporary if an rvalue is ok or an lvalue is not required.
* gcc.c-torture/compile/pr30132.c: New testcase.
Co-Authored-By: Andrew Pinski <andrew_pinski@playstation.sony.com>
From-SVN: r131430
Diffstat (limited to 'gcc/gimplify.c')
-rw-r--r-- | gcc/gimplify.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/gcc/gimplify.c b/gcc/gimplify.c index dd83222..5254741 100644 --- a/gcc/gimplify.c +++ b/gcc/gimplify.c @@ -2633,7 +2633,11 @@ gimplify_cond_expr (tree *expr_p, tree *pre_p, fallback_t fallback) { tree result; - if ((fallback & fb_lvalue) == 0) + /* If an rvalue is ok or we do not require an lvalue, avoid creating + an addressable temporary. */ + if (((fallback & fb_rvalue) + || !(fallback & fb_lvalue)) + && !TREE_ADDRESSABLE (type)) { if (gimplify_ctxp->allow_rhs_cond_expr /* If either branch has side effects or could trap, it can't be |