From 09c2b6d0286978cf0a2ac82f859bae2c9885d42c Mon Sep 17 00:00:00 2001 From: Richard Guenther Date: Fri, 13 Apr 2012 09:22:33 +0000 Subject: [PATCH] re PR c/52862 (ICE convert_to_pointer, at convert.c:50) 2012-04-13 Richard Guenther PR c/52862 * convert.c (convert_to_pointer): Remove special-casing of zero. * gcc.dg/pr52862.c: New testcase. From-SVN: r186407 --- gcc/ChangeLog | 6 ++++++ gcc/convert.c | 5 ----- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.dg/pr52862.c | 9 +++++++++ 4 files changed, 20 insertions(+), 5 deletions(-) create mode 100644 gcc/testsuite/gcc.dg/pr52862.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 4b688ea43ae..d161985b518 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2012-04-13 Richard Guenther + + PR c/52862 + * convert.c (convert_to_pointer): Remove special-casing of + zero. + 2012-04-13 Joey Ye * config/arm/constraints.md (Pe): New constraint. diff --git a/gcc/convert.c b/gcc/convert.c index dc9b7f29ea4..8ff2e9a825a 100644 --- a/gcc/convert.c +++ b/gcc/convert.c @@ -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: diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 2884b939555..23608c58065 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2012-04-13 Richard Guenther + + PR c/52862 + * gcc.dg/pr52862.c: New testcase. + 2012-04-13 Joey Ye * gcc.target/arm/thumb1-imm.c: New testcase. diff --git a/gcc/testsuite/gcc.dg/pr52862.c b/gcc/testsuite/gcc.dg/pr52862.c new file mode 100644 index 00000000000..febe7a8289b --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr52862.c @@ -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)); +}