summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2012-04-13 09:22:33 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2012-04-13 09:22:33 +0000
commit799c82e479f907242f9fb3652b9fc4d6416c37be (patch)
tree0a1f0333f72836b96fc30978fb3689b7b2fdbddd
parentc5b752835d24a5bc1efff427346ad3dcfb21b472 (diff)
downloadgcc-799c82e479f907242f9fb3652b9fc4d6416c37be.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@186407 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/convert.c5
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.dg/pr52862.c9
4 files changed, 20 insertions, 5 deletions
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 <rguenther@suse.de>
+
+ PR c/52862
+ * convert.c (convert_to_pointer): Remove special-casing of
+ zero.
+
2012-04-13 Joey Ye <joey.ye@arm.com>
* 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 <rguenther@suse.de>
+
+ PR c/52862
+ * gcc.dg/pr52862.c: New testcase.
+
2012-04-13 Joey Ye <joey.ye@arm.com>
* 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));
+}