]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c/13382 (Type information for const pointer disappears during optimisation.)
authorEric Botcazou <ebotcazou@libertysurf.fr>
Tue, 23 Dec 2003 06:23:37 +0000 (07:23 +0100)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Tue, 23 Dec 2003 06:23:37 +0000 (06:23 +0000)
PR c/13382
* c-typeck.c (convert_for_assignment): When converting from
integral type to pointer type, always call convert.

From-SVN: r74963

gcc/ChangeLog
gcc/c-typeck.c
gcc/testsuite/ChangeLog

index 508ebf5eaa1ff815e4a2937dde1839e0279b32ee..56d1d0868348768dea602153c65075d1b0379700 100644 (file)
@@ -1,3 +1,9 @@
+2003-12-23  Eric Botcazou  <ebotcazou@libertysurf.fr>
+
+       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 <gdr@integrable-solutions.net>
 
         PR target/11271
index 40dc44de5107f336e1c00601f4c589dcb569946b..aaac6f353f6bd650d0724dbdc03f82ecc1b1bf8c 100644 (file)
@@ -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)
     {
index d43d64f96c606a81b7f42cba7e216daba5309c4a..182b40b05f48185e8e613c7e0d9d16832480350b 100644 (file)
@@ -1,3 +1,7 @@
+2003-12-23  Eric Botcazou  <ebotcazou@libertysurf.fr>
+
+       * gcc.dg/null-pointer-1.c: New test.
+
 2003-12-22  Andrew Pinski  <pinskia@physics.uc.edu>
 
        PR c++/5050