Commit 6d892147 by Richard Guenther Committed by Richard Biener

re PR tree-optimization/42998 (ICE: error: verify_stmts failed)

2010-02-11  Richard Guenther  <rguenther@suse.de>

	PR tree-optimization/42998
	* tree-ssa-pre.c (create_expression_by_pieces): Treat
	POINTER_PLUS_EXPR properly.

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

From-SVN: r156704
parent 04eadb13
2010-02-11 Richard Guenther <rguenther@suse.de>
PR tree-optimization/42998
* tree-ssa-pre.c (create_expression_by_pieces): Treat
POINTER_PLUS_EXPR properly.
2010-02-11 Sebastian Pop <sebastian.pop@amd.com>
Changpeng Fang <changpeng.fang@amd.com>
......
2010-02-11 Richard Guenther <rguenther@suse.de>
PR tree-optimization/42998
* gcc.c-torture/compile/pr42998.c: New testcase.
2010-02-10 Jason Merrill <jason@redhat.com>
PR c++/41896
......
void foo(void *);
void bar(void *);
void ndisc_fill_addr_option(unsigned char *opt, int data_len,
unsigned short addr_type)
{
int pad;
if (addr_type == 32)
pad = 2;
else
pad = 0;
__builtin_memset(opt + 2, 0, pad);
opt += pad;
__builtin_constant_p(data_len) ? foo (opt+2) : bar (opt+2);
}
......@@ -3013,14 +3013,18 @@ create_expression_by_pieces (basic_block block, pre_expr expr,
stmts, domstmt);
if (!genop1 || !genop2)
return NULL_TREE;
genop1 = fold_convert (TREE_TYPE (nary->op[0]),
genop1);
/* Ensure op2 is a sizetype for POINTER_PLUS_EXPR. It
may be a constant with the wrong type. */
if (nary->opcode == POINTER_PLUS_EXPR)
genop2 = fold_convert (sizetype, genop2);
{
genop1 = fold_convert (nary->type, genop1);
genop2 = fold_convert (sizetype, genop2);
}
else
genop2 = fold_convert (TREE_TYPE (nary->op[1]), genop2);
{
genop1 = fold_convert (TREE_TYPE (nary->op[0]), genop1);
genop2 = fold_convert (TREE_TYPE (nary->op[1]), genop2);
}
folded = fold_build2 (nary->opcode, nary->type,
genop1, genop2);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment