This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
build_x_binary_op (ARRAY_REF ?!
- From: Alexey Starovoytov <Alexey dot Starovoytov at Sun dot COM>
- To: gcc at gcc dot gnu dot org
- Date: Wed, 19 Apr 2006 16:48:08 -0700 (PDT)
- Subject: build_x_binary_op (ARRAY_REF ?!
Hi,
Is this a bug that we were lucky not to hit?
cp/pt.c:
return build_x_binary_op (ARRAY_REF, op1, RECUR (TREE_OPERAND (t, 1)),
/*overloaded_p=*/NULL);
tree
build_x_binary_op (enum tree_code code, tree arg1, tree arg2,
bool *overloaded_p)
{
...
return build_min_nt (code, arg1, arg2);
...
return build_min_non_dep (code, expr, orig_arg1, orig_arg2);
}
the 'code' for build_min* will still be ARRAY_REF, so both functions
have a chance to init ARRAY_REF with some junk:
for (i = 0; i < length; i++)
{
tree x = va_arg (p, tree);
TREE_OPERAND (t, i) = x;
}
since 'length' of ARRAY_REF is 4 and just two arguments are passed.
I don't think there could be a stable testcase for that.
Alex.