Commit c62c040f by Richard Guenther Committed by Richard Biener

c-decl.c (check_bitfield_type_and_width): Do not pass NULL to build_int_cst.

2011-05-04  Richard Guenther  <rguenther@suse.de>

	* c-decl.c (check_bitfield_type_and_width): Do not pass NULL
	to build_int_cst.
	* c-typeck.c (really_start_incremental_init): Use bitsize_int
	for constructor indices.
	(push_init_level): Likewise.

	c-family/
	* c-common.c (fix_string_type): Use size_int for index type bounds.
	(start_fname_decls): Do not pass NULL to build_int_cst.
	(c_init_attributes): Likewise.
	* c-lex.c (c_lex_with_flags): Likewise.

From-SVN: r173378
parent 1e3287d0
2011-05-04 Richard Guenther <rguenther@suse.de> 2011-05-04 Richard Guenther <rguenther@suse.de>
* c-decl.c (check_bitfield_type_and_width): Do not pass NULL
to build_int_cst.
* c-typeck.c (really_start_incremental_init): Use bitsize_int
for constructor indices.
(push_init_level): Likewise.
2011-05-04 Richard Guenther <rguenther@suse.de>
* explow.c (promote_mode): Move variable declarations before code. * explow.c (promote_mode): Move variable declarations before code.
2011-05-04 Nathan Froyd <froydnj@codesourcery.com> 2011-05-04 Nathan Froyd <froydnj@codesourcery.com>
......
...@@ -4717,7 +4717,7 @@ check_bitfield_type_and_width (tree *type, tree *width, tree orig_name) ...@@ -4717,7 +4717,7 @@ check_bitfield_type_and_width (tree *type, tree *width, tree orig_name)
{ {
error ("width of %qs exceeds its type", name); error ("width of %qs exceeds its type", name);
w = max_width; w = max_width;
*width = build_int_cst (NULL_TREE, w); *width = build_int_cst (integer_type_node, w);
} }
else else
w = tree_low_cst (*width, 1); w = tree_low_cst (*width, 1);
......
2011-05-04 Richard Guenther <rguenther@suse.de>
* c-common.c (fix_string_type): Use size_int for index type bounds.
(start_fname_decls): Do not pass NULL to build_int_cst.
(c_init_attributes): Likewise.
* c-lex.c (c_lex_with_flags): Likewise.
2011-04-27 Jason Merrill <jason@redhat.com> 2011-04-27 Jason Merrill <jason@redhat.com>
* c-common.c (make_tree_vector_from_list): New. * c-common.c (make_tree_vector_from_list): New.
......
...@@ -743,7 +743,8 @@ start_fname_decls (void) ...@@ -743,7 +743,8 @@ start_fname_decls (void)
if (decl) if (decl)
{ {
saved = tree_cons (decl, build_int_cst (NULL_TREE, ix), saved); saved = tree_cons (decl, build_int_cst (integer_type_node, ix),
saved);
*fname_vars[ix].decl = NULL_TREE; *fname_vars[ix].decl = NULL_TREE;
} }
} }
...@@ -946,7 +947,7 @@ fix_string_type (tree value) ...@@ -946,7 +947,7 @@ fix_string_type (tree value)
construct the matching unqualified array type first. The C front construct the matching unqualified array type first. The C front
end does not require this, but it does no harm, so we do it end does not require this, but it does no harm, so we do it
unconditionally. */ unconditionally. */
i_type = build_index_type (build_int_cst (NULL_TREE, nchars - 1)); i_type = build_index_type (size_int (nchars - 1));
a_type = build_array_type (e_type, i_type); a_type = build_array_type (e_type, i_type);
if (c_dialect_cxx() || warn_write_strings) if (c_dialect_cxx() || warn_write_strings)
a_type = c_build_qualified_type (a_type, TYPE_QUAL_CONST); a_type = c_build_qualified_type (a_type, TYPE_QUAL_CONST);
...@@ -5670,7 +5671,7 @@ c_init_attributes (void) ...@@ -5670,7 +5671,7 @@ c_init_attributes (void)
#define DEF_ATTR_NULL_TREE(ENUM) \ #define DEF_ATTR_NULL_TREE(ENUM) \
built_in_attributes[(int) ENUM] = NULL_TREE; built_in_attributes[(int) ENUM] = NULL_TREE;
#define DEF_ATTR_INT(ENUM, VALUE) \ #define DEF_ATTR_INT(ENUM, VALUE) \
built_in_attributes[(int) ENUM] = build_int_cst (NULL_TREE, VALUE); built_in_attributes[(int) ENUM] = build_int_cst (integer_type_node, VALUE);
#define DEF_ATTR_IDENT(ENUM, STRING) \ #define DEF_ATTR_IDENT(ENUM, STRING) \
built_in_attributes[(int) ENUM] = get_identifier (STRING); built_in_attributes[(int) ENUM] = get_identifier (STRING);
#define DEF_ATTR_TREE_LIST(ENUM, PURPOSE, VALUE, CHAIN) \ #define DEF_ATTR_TREE_LIST(ENUM, PURPOSE, VALUE, CHAIN) \
......
...@@ -437,7 +437,7 @@ c_lex_with_flags (tree *value, location_t *loc, unsigned char *cpp_flags, ...@@ -437,7 +437,7 @@ c_lex_with_flags (tree *value, location_t *loc, unsigned char *cpp_flags,
break; break;
case CPP_PRAGMA: case CPP_PRAGMA:
*value = build_int_cst (NULL, tok->val.pragma); *value = build_int_cst (integer_type_node, tok->val.pragma);
break; break;
/* These tokens should not be visible outside cpplib. */ /* These tokens should not be visible outside cpplib. */
......
...@@ -6636,7 +6636,7 @@ really_start_incremental_init (tree type) ...@@ -6636,7 +6636,7 @@ really_start_incremental_init (tree type)
{ {
/* Vectors are like simple fixed-size arrays. */ /* Vectors are like simple fixed-size arrays. */
constructor_max_index = constructor_max_index =
build_int_cst (NULL_TREE, TYPE_VECTOR_SUBPARTS (constructor_type) - 1); bitsize_int (TYPE_VECTOR_SUBPARTS (constructor_type) - 1);
constructor_index = bitsize_zero_node; constructor_index = bitsize_zero_node;
constructor_unfilled_index = constructor_index; constructor_unfilled_index = constructor_index;
} }
...@@ -6805,8 +6805,8 @@ push_init_level (int implicit, struct obstack * braced_init_obstack) ...@@ -6805,8 +6805,8 @@ push_init_level (int implicit, struct obstack * braced_init_obstack)
{ {
/* Vectors are like simple fixed-size arrays. */ /* Vectors are like simple fixed-size arrays. */
constructor_max_index = constructor_max_index =
build_int_cst (NULL_TREE, TYPE_VECTOR_SUBPARTS (constructor_type) - 1); bitsize_int (TYPE_VECTOR_SUBPARTS (constructor_type) - 1);
constructor_index = convert (bitsizetype, integer_zero_node); constructor_index = bitsize_int (0);
constructor_unfilled_index = constructor_index; constructor_unfilled_index = constructor_index;
} }
else if (TREE_CODE (constructor_type) == ARRAY_TYPE) else if (TREE_CODE (constructor_type) == ARRAY_TYPE)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment