aboutsummaryrefslogtreecommitdiff
path: root/gcc/fold-const.c
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2004-09-01 23:47:01 -0700
committerRichard Henderson <rth@gcc.gnu.org>2004-09-01 23:47:01 -0700
commit9969aaf67e4c806bc58a5b110f6a0849365eee05 (patch)
tree92274b998af0cc6f86fd45d1b53bb9d1eef8bed0 /gcc/fold-const.c
parent57579172585eae4fd6f57c0dbd55ea998ddfb63f (diff)
downloadgcc-9969aaf67e4c806bc58a5b110f6a0849365eee05.zip
gcc-9969aaf67e4c806bc58a5b110f6a0849365eee05.tar.gz
gcc-9969aaf67e4c806bc58a5b110f6a0849365eee05.tar.bz2
re PR middle-end/17258 (gcc.c-torture/compile/20030224-1.c:16: internal compiler error: in expand_expr_addr_expr, at expr.c:6157)
PR middle-end/17258 * calls.c (initialize_argument_information): Tighten pass-through conditions for pass-by-reference. Remove dead TARGET_EXPR code. Use build_fold_addr_expr. (emit_library_call_value_1): Use build_fold_addr_expr. Remove code that assumes ADDR_EXPR allocates stack space. * fold-const.c (build_fold_addr_expr_with_type): Look through WITH_SIZE_EXPR. From-SVN: r86957
Diffstat (limited to 'gcc/fold-const.c')
-rw-r--r--gcc/fold-const.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index 1ccea7e..d8c511a 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -10446,6 +10446,10 @@ fold_relational_const (enum tree_code code, tree type, tree op0, tree op1)
tree
build_fold_addr_expr_with_type (tree t, tree ptrtype)
{
+ /* The size of the object is not relevant when talking about its address. */
+ if (TREE_CODE (t) == WITH_SIZE_EXPR)
+ t = TREE_OPERAND (t, 0);
+
if (TREE_CODE (t) == INDIRECT_REF)
{
t = TREE_OPERAND (t, 0);