re PR c/39648 (internal compiler error: in fold_convert, at fold-const.c:2506)

2009-04-05  Richard Guenther  <rguenther@suse.de>

	PR tree-optimization/39648
	* tree-ssa-sccvn.c (vn_reference_fold_indirect): Work around
	our &A vs. &A[0] IL deficiencies.

	* gcc.c-torture/compile/pr39648.c: New testcase.

From-SVN: r145569
This commit is contained in:
Richard Biener 2009-04-05 19:50:28 +00:00
parent 435970ad3e
commit 941c3614de
4 changed files with 42 additions and 2 deletions

View File

@ -1,7 +1,13 @@
2009-04-05 Richard Guenther <rguenther@suse.de>
PR tree-optimization/39648
* tree-ssa-sccvn.c (vn_reference_fold_indirect): Work around
our &A vs. &A[0] IL deficiencies.
2009-04-04 Jan Hubicka <jh@suse.cz>
* except.c (sjlj_find_directly_reachable_regions): Be ready for removed toplevel
regions.
* except.c (sjlj_find_directly_reachable_regions): Be ready for
removed toplevel regions.
(sjlj_mark_call_sites): Likewise.
2009-04-04 Dave Korn <dave.korn.cygwin@gmail.com>

View File

@ -1,3 +1,8 @@
2009-04-05 Richard Guenther <rguenther@suse.de>
PR tree-optimization/39648
* gcc.c-torture/compile/pr39648.c: New testcase.
2009-04-05 Jason Merrill <jason@redhat.com>
PR c++/14912

View File

@ -0,0 +1,12 @@
void
yysyntax_error (char *yyp)
{
char const *yyf;
char yyformat[5];
yyf = yyformat;
while ((*yyp = *yyf) != '\0') {
if (yyf[1] == 's')
yyf += 2;
}
}

View File

@ -757,6 +757,23 @@ vn_reference_fold_indirect (VEC (vn_reference_op_s, heap) **ops,
/* Get ops for the addressed object. */
op = VEC_index (vn_reference_op_s, *ops, i);
/* ??? If this is our usual typeof &ARRAY vs. &ARRAY[0] problem, work
around it to avoid later ICEs. */
if (TREE_CODE (TREE_TYPE (TREE_OPERAND (op->op0, 0))) == ARRAY_TYPE
&& TREE_CODE (TREE_TYPE (TREE_TYPE (op->op0))) != ARRAY_TYPE)
{
vn_reference_op_s aref;
tree dom;
aref.type = TYPE_MAIN_VARIANT (TREE_TYPE (TREE_TYPE (op->op0)));
aref.opcode = ARRAY_REF;
aref.op0 = integer_zero_node;
if ((dom = TYPE_DOMAIN (TREE_TYPE (TREE_OPERAND (op->op0, 0))))
&& TYPE_MIN_VALUE (dom))
aref.op0 = TYPE_MIN_VALUE (dom);
aref.op1 = NULL_TREE;
aref.op2 = NULL_TREE;
VEC_safe_push (vn_reference_op_s, heap, mem, &aref);
}
copy_reference_ops_from_ref (TREE_OPERAND (op->op0, 0), &mem);
/* Do the replacement - we should have at least one op in mem now. */