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
This commit is contained in:
Richard Guenther 2012-04-13 09:24:28 +00:00 committed by Richard Biener
parent 09c2b6d028
commit 1e867b228f
4 changed files with 16 additions and 2 deletions

View File

@ -1,3 +1,8 @@
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

View File

@ -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);

View File

@ -1,3 +1,8 @@
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

View File

@ -0,0 +1,6 @@
/* { dg-do compile } */
_mark (long obj, int i, char *a)
{
(char *)&(((long *)(obj)) [i]) - a;
}