Commit 1e867b22 by Richard Guenther Committed by Richard Biener

re PR c/52549 (ice in pointer_diff)

2012-04-13  Richard Guenther  <rguenther@suse.de>

	PR c/52549
	* c-typeck.c (pointer_diff): Remove bogus assert.

	* gcc.dg/pr52549.c: New testcase.

From-SVN: r186408
parent 09c2b6d0
2012-04-13 Richard Guenther <rguenther@suse.de>
PR c/52549
* c-typeck.c (pointer_diff): Remove bogus assert.
2012-04-13 Richard Guenther <rguenther@suse.de>
PR c/52862
* convert.c (convert_to_pointer): Remove special-casing of
zero.
......
......@@ -3446,8 +3446,6 @@ pointer_diff (location_t loc, tree op0, tree op1)
else
con1 = op1;
gcc_assert (TREE_CODE (con0) != PLUS_EXPR
&& TREE_CODE (con1) != PLUS_EXPR);
if (TREE_CODE (con0) == POINTER_PLUS_EXPR)
{
lit0 = TREE_OPERAND (con0, 1);
......
2012-04-13 Richard Guenther <rguenther@suse.de>
PR c/52549
* gcc.dg/pr52549.c: New testcase.
2012-04-13 Richard Guenther <rguenther@suse.de>
PR c/52862
* gcc.dg/pr52862.c: New testcase.
......
/* { dg-do compile } */
_mark (long obj, int i, char *a)
{
(char *)&(((long *)(obj)) [i]) - a;
}
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