re PR c/52862 (ICE convert_to_pointer, at convert.c:50)

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

	PR c/52862
	* convert.c (convert_to_pointer): Remove special-casing of
	zero.

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

From-SVN: r186409
This commit is contained in:
Richard Guenther 2012-04-13 09:26:45 +00:00 committed by Richard Biener
parent dfa6222b38
commit 847aaebda0
4 changed files with 20 additions and 5 deletions

View File

@ -1,3 +1,9 @@
2012-04-13 Richard Guenther <rguenther@suse.de>
PR c/52862
* convert.c (convert_to_pointer): Remove special-casing of
zero.
2012-04-12 Michael Meissner <meissner@linux.vnet.ibm.com>
Backport from mainline

View File

@ -44,11 +44,6 @@ convert_to_pointer (tree type, tree expr)
if (TREE_TYPE (expr) == type)
return expr;
/* Propagate overflow to the NULL pointer. */
if (integer_zerop (expr))
return force_fit_type_double (type, double_int_zero, 0,
TREE_OVERFLOW (expr));
switch (TREE_CODE (TREE_TYPE (expr)))
{
case POINTER_TYPE:

View File

@ -1,3 +1,8 @@
2012-04-13 Richard Guenther <rguenther@suse.de>
PR c/52862
* gcc.dg/pr52862.c: New testcase.
2012-04-12 Michael Meissner <meissner@linux.vnet.ibm.com>
Backport from mainline

View File

@ -0,0 +1,9 @@
/* { dg-do compile } */
/* { dg-options "-O" } */
void ASMAtomicWritePtrVoid(const void *pv);
void rtThreadDestroy(void)
{
void * const pvTypeChecked = ((void *)0);
ASMAtomicWritePtrVoid((void *)(pvTypeChecked));
}