diff options
author | Eric Botcazou <ebotcazou@libertysurf.fr> | 2004-10-23 11:16:46 +0200 |
---|---|---|
committer | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2004-10-23 09:16:46 +0000 |
commit | 918047526ddf6f2ff5235d232d5bfbb653bd78cd (patch) | |
tree | dd933f1854a322fbaad326608964432f168dfff2 | |
parent | 757f86d6a41775d627b758e4e53ab36d705098b2 (diff) | |
download | gcc-918047526ddf6f2ff5235d232d5bfbb653bd78cd.zip gcc-918047526ddf6f2ff5235d232d5bfbb653bd78cd.tar.gz gcc-918047526ddf6f2ff5235d232d5bfbb653bd78cd.tar.bz2 |
re PR middle-end/17793 (Ada bootstrap failure)
PR middle-end/17793
* gimplify.c (gimplify_addr_expr) <VIEW_CONVERT_EXPR>: Look
through the operand if it is a useless type conversion.
From-SVN: r89488
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/gimplify.c | 7 |
2 files changed, 13 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ac3c875..fa86a45 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2004-10-23 Eric Botcazou <ebotcazou@libertysurf.fr> + + PR middle-end/17793 + * gimplify.c (gimplify_addr_expr) <VIEW_CONVERT_EXPR>: Look + through the operand if it is a useless type conversion. + 2004-10-23 Ben Elliston <bje@au.ibm.com> * cfg.c (remove_edge): Use VEC_unordered_remove. diff --git a/gcc/gimplify.c b/gcc/gimplify.c index 51a123f..3d8ecdf 100644 --- a/gcc/gimplify.c +++ b/gcc/gimplify.c @@ -3093,6 +3093,13 @@ gimplify_addr_expr (tree *expr_p, tree *pre_p, tree *post_p) ??? The interactions of VIEW_CONVERT_EXPR and aliasing is not at all clear. The impact of this transformation is even less clear. */ + + /* If the operand is a useless conversion, look through it. Doing so + guarantees that the ADDR_EXPR and its operand will remain of the + same type. */ + if (tree_ssa_useless_type_conversion (TREE_OPERAND (op0, 0))) + op0 = TREE_OPERAND (op0, 0); + *expr_p = fold_convert (TREE_TYPE (expr), build_fold_addr_expr (TREE_OPERAND (op0, 0))); ret = GS_OK; |