This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Reason for Java failure in set_mem_alias_set
- To: gcc at gcc dot gnu dot org, kenner at vlsi1 dot ultra dot nyu dot edu, java at gcc dot gnu dot org
- Subject: Re: Reason for Java failure in set_mem_alias_set
- From: Alexandre Petit-Bianco <apbianco at cygnus dot com>
- Date: 03 Oct 2001 13:09:49 -0700
- References: <10110022122.AA17642@vlsi1.ultra.nyu.edu>
kenner@vlsi1.ultra.nyu.edu (Richard Kenner) writes:
> It seems that lhs_type can be changed without doing a conversion of
> lvaue into it. Then if a bounds check is being done, it makes a
> COMPOUND_EXPR where the type of that expression is not the same as
> the type of it's second argument (operand 1), which is an invalid
> node, but nothing ever noticed it before.
Thank you for the diagnostic. I was catching up with some backlog
accumulated during a power failure I went through on Monday and to a
lesser extend, Tuesday; I'm only getting a chance to look into this
problem today.
I haven't fully tested the patch below, but it seems to help the build
move forward. As soon as this proves to work properly, I'll check it
in.
./A
2001-10-03 Alexandre Petit-Bianco <apbianco@redhat.com>
* parse.y (patch_assignment): Use lvalue's original TYPE when
building the final COMPOUND_EXPR.
(try_reference_assignconv): Fixed leading comment.
Index: parse.y
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/parse.y,v
retrieving revision 1.315
diff -u -p -r1.315 parse.y
--- parse.y 2001/09/27 19:20:12 1.315
+++ parse.y 2001/10/03 19:11:03
@@ -13002,10 +13020,11 @@ patch_assignment (node, wfl_op1, wfl_op2
build (COMPOUND_EXPR, void_type_node, bound_check, check);
/* Re-assemble the augmented array access. */
- lvalue = build (COMPOUND_EXPR, lhs_type, new_compound, lvalue);
+ lvalue = build (COMPOUND_EXPR, TREE_TYPE (lvalue),
+ new_compound, lvalue);
}
else
- lvalue = build (COMPOUND_EXPR, lhs_type, check, lvalue);
+ lvalue = build (COMPOUND_EXPR, TREE_TYPE (lvalue), check, lvalue);
}
/* Final locals can be used as case values in switch
@@ -13028,9 +13047,8 @@ patch_assignment (node, wfl_op1, wfl_op2
}
/* Check that type SOURCE can be cast into type DEST. If the cast
- can't occur at all, return 0 otherwise 1. This function is used to
- produce accurate error messages on the reasons why an assignment
- failed. */
+ can't occur at all, return NULL; otherwise, return a possibly
+ modified rhs. */
static tree
try_reference_assignconv (lhs_type, rhs)