+Thu Aug 13 15:24:48 1998 Jason Merrill <jason@yorick.cygnus.com>
+
+ * c-typeck.c (initializer_constant_valid_p): Allow conversion of 0
+ of any size to a pointer.
+
Thu Aug 13 12:53:13 1998 Jim Wilson <wilson@cygnus.com>
* i386/winnt.c (i386_pe_asm_file_end): Check TREE_SYMBOL_REFERENCED.
SUBREG, MEM.
* rtlanal.c (replace_rtx): Prohibit replaces in CONST_DOUBLE.
-Tue Jul 28 11:33:09 1998 Mark Mitchell <mark@markmitchell.com>
+
* cplus-dem.c (type_kind_t): New type.
(demangle_template_value_parm): Add type_kind_t parameter. Rely
return initializer_constant_valid_p (TREE_OPERAND (value, 0),
endtype);
- /* Likewise conversions from int to pointers. */
+ /* Likewise conversions from int to pointers, but also allow
+ conversions from 0. */
if (TREE_CODE (TREE_TYPE (value)) == POINTER_TYPE
- && TREE_CODE (TREE_TYPE (TREE_OPERAND (value, 0))) == INTEGER_TYPE
- && (TYPE_PRECISION (TREE_TYPE (value))
- <= TYPE_PRECISION (TREE_TYPE (TREE_OPERAND (value, 0)))))
- return initializer_constant_valid_p (TREE_OPERAND (value, 0),
- endtype);
+ && TREE_CODE (TREE_TYPE (TREE_OPERAND (value, 0))) == INTEGER_TYPE)
+ {
+ if (integer_zerop (TREE_OPERAND (value, 0)))
+ return null_pointer_node;
+ else if (TYPE_PRECISION (TREE_TYPE (value))
+ <= TYPE_PRECISION (TREE_TYPE (TREE_OPERAND (value, 0))))
+ return initializer_constant_valid_p (TREE_OPERAND (value, 0),
+ endtype);
+ }
/* Allow conversions to union types if the value inside is okay. */
if (TREE_CODE (TREE_TYPE (value)) == UNION_TYPE)