From: Eric Botcazou Date: Tue, 23 Dec 2003 06:23:37 +0000 (+0100) Subject: re PR c/13382 (Type information for const pointer disappears during optimisation.) X-Git-Tag: releases/gcc-3.3.3~161 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=01b0352ab31f8243992289a94ca2a96c3b68408e;p=thirdparty%2Fgcc.git re PR c/13382 (Type information for const pointer disappears during optimisation.) PR c/13382 * c-typeck.c (convert_for_assignment): When converting from integral type to pointer type, always call convert. From-SVN: r74963 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 508ebf5eaa1f..56d1d0868348 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2003-12-23 Eric Botcazou + + PR c/13382 + * c-typeck.c (convert_for_assignment): When converting from + integral type to pointer type, always call convert. + 2003-12-22 Gabriel Dos Reis PR target/11271 diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c index 40dc44de5107..aaac6f353f6b 100644 --- a/gcc/c-typeck.c +++ b/gcc/c-typeck.c @@ -4263,12 +4263,10 @@ convert_for_assignment (type, rhs, errtype, fundecl, funname, parmnum) && TREE_CODE (TREE_TYPE (rhs)) == INTEGER_TYPE && TREE_CODE (TREE_OPERAND (rhs, 0)) == INTEGER_CST && integer_zerop (TREE_OPERAND (rhs, 0)))) - { warn_for_assignment ("%s makes pointer from integer without a cast", errtype, funname, parmnum); - return convert (type, rhs); - } - return null_pointer_node; + + return convert (type, rhs); } else if (codel == INTEGER_TYPE && coder == POINTER_TYPE) { diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index d43d64f96c60..182b40b05f48 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2003-12-23 Eric Botcazou + + * gcc.dg/null-pointer-1.c: New test. + 2003-12-22 Andrew Pinski PR c++/5050