Makefile.in (convert.o, [...]): Update.
* Makefile.in (convert.o, calls.o, expmed.o): Update. * attribs.c (handle_mode_attribute, handle_vector_size_attribute): Use new hooks. * builtin-types.def (BT_PTRMODE): Update. * c-common.c (type_for_size): Rename c_common_type_for_size. (type_for_mode): Similarly. (shorten_compare, pointer_int_sum, c_common_nodes_and_builtins): Use new hook. * c-bommon.h (c_common_type_for_size, c_common_type_for_mode): New. * c-decl.c (finish_enum, build_enumerator): Use new hooks. * c-lang.c (LANG_HOOKS_TYPE_FOR_MODE, LANG_HOOKS_TYPE_FOR_SIZE): Redefine. * c-typeck.c (common_type, comptypes, default_conversion): Use new hooks. * calls.c: Include langhooks.h. (emit_library_call_value_1): Use new hooks. Avoid redundant calls. * convert.c: Include langhooks.h (convert_to_pointer, convert_to_integer): Use new hooks. * except.c (init_eh): Similarly. * expmed.c: Include langhooks.h. (expand_mult_add): Use new hooks. * expr.c (store_expr, store_constructor, expand_expr, do_jump, try_casesi): Similarly. * fold-const.c (optimize_bit_field_compare, make_range, decode_field_reference, fold_truthop, fold): Similarly. * function.c (assign_stack_local_1, assign_stack_temp_for_type, put_var_into_stack): Similarly. * langhooks-def.h (LANG_HOOKS_TYPE_FOR_MODE, LANG_HOOKS_TYPE_FOR_SIZE): New. (LANG_HOOKS_TYPES_INITIALIZER): Update. * langhooks.h (lang_hooks_for_types): New hooks. * stmt.c (expand_decl_cleanup, emit_case_nodes): Use new hooks. * tree.c (get_unwidened, get_narrower): Similarly. * tree.h (type_for_mode, type_for_size): Remove. * varasm.c (force_const_mem): Use new hooks. ada: * gigi.h (type_for_size, type_for_mode): Rename. * misc.c (LANG_HOOKS_TYPE_FOR_MODE, LANG_HOOKS_TYPE_FOR_SIZE): Redefine. * trans.c (tree_transform): Update. * utils.c (gnat_init_decl_processing, init_gigi_decls, builtin_function, float_type_for_size, signed_or_unsigned_type, build_vms_descriptor, unchecked_convert): Update. (type_for_mode, type_for_size): Rename. * utils2.c (nonbinary_modular_operation): Update. cp: * cp-lang.c (LANG_HOOKS_TYPE_FOR_MODE, LANG_HOOKS_TYPE_FOR_SIZE): Redefine. * cvt.c (cp_convert_to_pointer, type_promotes_to): Use new hooks. * decl.c (finish_enum): Similarly. * error.c (dump_type): Similarly. * lex.c (cxx_init): Similarly. * mangle.c (write_builtin_type): Similarly. * typeck.c (comptypes): Similarly. f: * com.c (LANG_HOOKS_TYPE_FOR_MODE, LANG_HOOKS_TYPE_FOR_SIZE): Redefine. (type_for_mode, type_for_size): Rename. (signed_or_unsigned_type, signed_type, truthvalue_conversion, unsigned_type): Use new hooks. java: * Make-lang.in (builtins.o): Update. * boehm.c (get_boehm_type_descriptor): Update. * builtins.c: Include langhooks.h. * decl.c (java_init_decl_processing): Update. * java-tree.h (java_type_for_mode, java_type_for_size): New. * lang.c (LANG_HOOKS_TYPE_FOR_MODE, LANG_HOOKS_TYPE_FOR_SIaZE): Redefine. * typeck.c (type_for_mode, type_for_size): Update. objc: * objc-act.c (handle_impent): Update. * objc-lang.c (LANG_HOOKS_TYPE_FOR_MODE, LANG_HOOKS_TYPE_FOR_SIaZE): Redefine. From-SVN: r51571
This commit is contained in:
parent
d52e4867ca
commit
b0c4822985
47 changed files with 293 additions and 160 deletions
|
@ -1,3 +1,47 @@
|
|||
2002-03-29 Neil Booth <neil@daikokuya.demon.co.uk>
|
||||
|
||||
* Makefile.in (convert.o, calls.o, expmed.o): Update.
|
||||
* attribs.c (handle_mode_attribute, handle_vector_size_attribute):
|
||||
Use new hooks.
|
||||
* builtin-types.def (BT_PTRMODE): Update.
|
||||
* c-common.c (type_for_size): Rename c_common_type_for_size.
|
||||
(type_for_mode): Similarly.
|
||||
(shorten_compare, pointer_int_sum, c_common_nodes_and_builtins):
|
||||
Use new hook.
|
||||
* c-bommon.h (c_common_type_for_size, c_common_type_for_mode): New.
|
||||
* c-decl.c (finish_enum, build_enumerator): Use new hooks.
|
||||
* c-lang.c (LANG_HOOKS_TYPE_FOR_MODE, LANG_HOOKS_TYPE_FOR_SIZE):
|
||||
Redefine.
|
||||
* c-typeck.c (common_type, comptypes, default_conversion):
|
||||
Use new hooks.
|
||||
* calls.c: Include langhooks.h.
|
||||
(emit_library_call_value_1): Use new hooks. Avoid redundant
|
||||
calls.
|
||||
* convert.c: Include langhooks.h
|
||||
(convert_to_pointer, convert_to_integer): Use new hooks.
|
||||
* except.c (init_eh): Similarly.
|
||||
* expmed.c: Include langhooks.h.
|
||||
(expand_mult_add): Use new hooks.
|
||||
* expr.c (store_expr, store_constructor, expand_expr, do_jump,
|
||||
try_casesi): Similarly.
|
||||
* fold-const.c (optimize_bit_field_compare, make_range,
|
||||
decode_field_reference, fold_truthop, fold): Similarly.
|
||||
* function.c (assign_stack_local_1, assign_stack_temp_for_type,
|
||||
put_var_into_stack): Similarly.
|
||||
* langhooks-def.h (LANG_HOOKS_TYPE_FOR_MODE,
|
||||
LANG_HOOKS_TYPE_FOR_SIZE): New.
|
||||
(LANG_HOOKS_TYPES_INITIALIZER): Update.
|
||||
* langhooks.h (lang_hooks_for_types): New hooks.
|
||||
* stmt.c (expand_decl_cleanup, emit_case_nodes): Use new hooks.
|
||||
* tree.c (get_unwidened, get_narrower): Similarly.
|
||||
* tree.h (type_for_mode, type_for_size): Remove.
|
||||
* varasm.c (force_const_mem): Use new hooks.
|
||||
* utils2.c (nonbinary_modular_operation): Update.
|
||||
objc:
|
||||
* objc-act.c (handle_impent): Update.
|
||||
* objc-lang.c (LANG_HOOKS_TYPE_FOR_MODE, LANG_HOOKS_TYPE_FOR_SIaZE):
|
||||
Redefine.
|
||||
|
||||
2002-03-29 Steve Ellcey <sje@cup.hp.com>
|
||||
|
||||
* config/ia64/ia64.md (*ptr_extend_plus_1, *ptr_extend_plus_2): New.
|
||||
|
|
|
@ -1319,7 +1319,8 @@ prefix.o: prefix.c $(CONFIG_H) $(SYSTEM_H) Makefile prefix.h
|
|||
-DPREFIX=\"$(prefix)\" \
|
||||
-c $(srcdir)/prefix.c $(OUTPUT_OPTION)
|
||||
|
||||
convert.o: convert.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) flags.h convert.h toplev.h
|
||||
convert.o: convert.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) flags.h convert.h \
|
||||
toplev.h langhooks.h
|
||||
|
||||
langhooks.o : langhooks.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) toplev.h \
|
||||
tree-inline.h $(RTL_H) insn-config.h integrate.h langhooks.h \
|
||||
|
@ -1395,11 +1396,12 @@ builtins.o : builtins.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TREE_H) flags.h \
|
|||
$(TARGET_H) function.h $(REGS_H) $(EXPR_H) $(OPTABS_H) insn-config.h \
|
||||
$(RECOG_H) output.h typeclass.h hard-reg-set.h toplev.h hard-reg-set.h \
|
||||
except.h $(TM_P_H) $(PREDICT_H) libfuncs.h
|
||||
calls.o : calls.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TREE_H) flags.h $(EXPR_H) \
|
||||
calls.o : calls.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TREE_H) flags.h \
|
||||
$(EXPR_H) langhooks.h \
|
||||
libfuncs.h $(REGS_H) toplev.h output.h function.h $(TIMEVAR_H) $(TM_P_H)
|
||||
expmed.o : expmed.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TREE_H) flags.h \
|
||||
insn-config.h $(EXPR_H) $(OPTABS_H) $(RECOG_H) real.h \
|
||||
toplev.h $(TM_P_H)
|
||||
toplev.h $(TM_P_H) langhooks.h
|
||||
explow.o : explow.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TREE_H) flags.h \
|
||||
hard-reg-set.h insn-config.h $(EXPR_H) $(OPTABS_H) $(RECOG_H) \
|
||||
toplev.h function.h ggc.h $(TM_P_H)
|
||||
|
|
|
@ -423,11 +423,11 @@ extern void gnat_init_gcc_eh PARAMS ((void));
|
|||
/* Return an integer type with the number of bits of precision given by
|
||||
PRECISION. UNSIGNEDP is nonzero if the type is unsigned; otherwise
|
||||
it is a signed type. */
|
||||
extern tree type_for_size PARAMS ((unsigned, int));
|
||||
extern tree gnat_type_for_size PARAMS ((unsigned, int));
|
||||
|
||||
/* Return a data type that has machine mode MODE. UNSIGNEDP selects
|
||||
an unsigned type; otherwise a signed type is returned. */
|
||||
extern tree type_for_mode PARAMS ((enum machine_mode, int));
|
||||
extern tree gnat_type_for_mode PARAMS ((enum machine_mode, int));
|
||||
|
||||
/* Return the unsigned version of a TYPE_NODE, a scalar type. */
|
||||
extern tree unsigned_type PARAMS ((tree));
|
||||
|
|
|
@ -118,6 +118,10 @@ static rtx gnat_expand_expr PARAMS ((tree, rtx, enum machine_mode,
|
|||
#define LANG_HOOKS_PRINT_TYPE gnat_print_type
|
||||
#undef LANG_HOOKS_DECL_PRINTABLE_NAME
|
||||
#define LANG_HOOKS_DECL_PRINTABLE_NAME gnat_printable_name
|
||||
#undef LANG_HOOKS_TYPE_FOR_MODE
|
||||
#define LANG_HOOKS_TYPE_FOR_MODE gnat_type_for_mode
|
||||
#undef LANG_HOOKS_TYPE_FOR_SIZE
|
||||
#define LANG_HOOKS_TYPE_FOR_SIZE gnat_type_for_size
|
||||
|
||||
const struct lang_hooks lang_hooks = LANG_HOOKS_INITIALIZER;
|
||||
|
||||
|
|
|
@ -2994,7 +2994,7 @@ tree_transform (gnat_node)
|
|||
gnu_actual
|
||||
= unchecked_convert
|
||||
(DECL_ARG_TYPE (get_gnu_tree (gnat_formal)),
|
||||
convert (type_for_size
|
||||
convert (gnat_type_for_size
|
||||
(tree_low_cst (gnu_actual_size, 1), 1),
|
||||
integer_zero_node));
|
||||
else
|
||||
|
|
|
@ -499,7 +499,7 @@ gnat_init_decl_processing ()
|
|||
/* In Ada, we use a signed type for SIZETYPE. Use the signed type
|
||||
corresponding to the size of ptr_mode. Make this here since we need
|
||||
this before we can expand the GNAT types. */
|
||||
set_sizetype (type_for_size (GET_MODE_BITSIZE (ptr_mode), 0));
|
||||
set_sizetype (gnat_type_for_size (GET_MODE_BITSIZE (ptr_mode), 0));
|
||||
build_common_tree_nodes_2 (0);
|
||||
|
||||
pushdecl (build_decl (TYPE_DECL, get_identifier (SIZE_TYPE), sizetype));
|
||||
|
@ -543,7 +543,7 @@ init_gigi_decls (long_long_float_type, exception_type)
|
|||
|
||||
except_type_node = TREE_TYPE (exception_type);
|
||||
|
||||
unsigned_type_node = type_for_size (INT_TYPE_SIZE, 1);
|
||||
unsigned_type_node = gnat_type_for_size (INT_TYPE_SIZE, 1);
|
||||
pushdecl (build_decl (TYPE_DECL, get_identifier ("unsigned int"),
|
||||
unsigned_type_node));
|
||||
|
||||
|
@ -579,7 +579,7 @@ init_gigi_decls (long_long_float_type, exception_type)
|
|||
|
||||
/* Make the types and functions used for exception processing. */
|
||||
jmpbuf_type
|
||||
= build_array_type (type_for_mode (Pmode, 0),
|
||||
= build_array_type (gnat_type_for_mode (Pmode, 0),
|
||||
build_index_type (build_int_2 (5, 0)));
|
||||
pushdecl (build_decl (TYPE_DECL, get_identifier ("JMPBUF_T"), jmpbuf_type));
|
||||
jmpbuf_ptr_type = build_pointer_type (jmpbuf_type);
|
||||
|
@ -1954,7 +1954,7 @@ builtin_function (name, type, function_code, class, library_name)
|
|||
it is a signed type. */
|
||||
|
||||
tree
|
||||
type_for_size (precision, unsignedp)
|
||||
gnat_type_for_size (precision, unsignedp)
|
||||
unsigned precision;
|
||||
int unsignedp;
|
||||
{
|
||||
|
@ -2015,14 +2015,14 @@ float_type_for_size (precision, mode)
|
|||
an unsigned type; otherwise a signed type is returned. */
|
||||
|
||||
tree
|
||||
type_for_mode (mode, unsignedp)
|
||||
gnat_type_for_mode (mode, unsignedp)
|
||||
enum machine_mode mode;
|
||||
int unsignedp;
|
||||
{
|
||||
if (GET_MODE_CLASS (mode) == MODE_FLOAT)
|
||||
return float_type_for_size (GET_MODE_BITSIZE (mode), mode);
|
||||
else
|
||||
return type_for_size (GET_MODE_BITSIZE (mode), unsignedp);
|
||||
return gnat_type_for_size (GET_MODE_BITSIZE (mode), unsignedp);
|
||||
}
|
||||
|
||||
/* Return the unsigned version of a TYPE_NODE, a scalar type. */
|
||||
|
@ -2031,7 +2031,7 @@ tree
|
|||
unsigned_type (type_node)
|
||||
tree type_node;
|
||||
{
|
||||
tree type = type_for_size (TYPE_PRECISION (type_node), 1);
|
||||
tree type = gnat_type_for_size (TYPE_PRECISION (type_node), 1);
|
||||
|
||||
if (TREE_CODE (type_node) == INTEGER_TYPE && TYPE_MODULAR_P (type_node))
|
||||
{
|
||||
|
@ -2055,7 +2055,7 @@ tree
|
|||
signed_type (type_node)
|
||||
tree type_node;
|
||||
{
|
||||
tree type = type_for_size (TYPE_PRECISION (type_node), 0);
|
||||
tree type = gnat_type_for_size (TYPE_PRECISION (type_node), 0);
|
||||
|
||||
if (TREE_CODE (type_node) == INTEGER_TYPE && TYPE_MODULAR_P (type_node))
|
||||
{
|
||||
|
@ -2084,7 +2084,7 @@ signed_or_unsigned_type (unsignedp, type)
|
|||
if (! INTEGRAL_TYPE_P (type) || TREE_UNSIGNED (type) == unsignedp)
|
||||
return type;
|
||||
else
|
||||
return type_for_size (TYPE_PRECISION (type), unsignedp);
|
||||
return gnat_type_for_size (TYPE_PRECISION (type), unsignedp);
|
||||
}
|
||||
|
||||
/* EXP is an expression for the size of an object. If this size contains
|
||||
|
@ -2401,14 +2401,16 @@ build_vms_descriptor (type, mech, gnat_entity)
|
|||
field_list
|
||||
= chainon (field_list,
|
||||
make_descriptor_field
|
||||
("LENGTH", type_for_size (16, 1), record_type,
|
||||
("LENGTH", gnat_type_for_size (16, 1), record_type,
|
||||
size_in_bytes (mech == By_Descriptor_A ? inner_type : type)));
|
||||
|
||||
field_list = chainon (field_list,
|
||||
make_descriptor_field ("DTYPE", type_for_size (8, 1),
|
||||
make_descriptor_field ("DTYPE",
|
||||
gnat_type_for_size (8, 1),
|
||||
record_type, size_int (dtype)));
|
||||
field_list = chainon (field_list,
|
||||
make_descriptor_field ("CLASS", type_for_size (8, 1),
|
||||
make_descriptor_field ("CLASS",
|
||||
gnat_type_for_size (8, 1),
|
||||
record_type, size_int (class)));
|
||||
|
||||
field_list
|
||||
|
@ -2431,13 +2433,13 @@ build_vms_descriptor (type, mech, gnat_entity)
|
|||
field_list
|
||||
= chainon (field_list,
|
||||
make_descriptor_field
|
||||
("SB_L1", type_for_size (32, 1), record_type,
|
||||
("SB_L1", gnat_type_for_size (32, 1), record_type,
|
||||
TREE_CODE (type) == ARRAY_TYPE
|
||||
? TYPE_MIN_VALUE (TYPE_DOMAIN (type)) : size_zero_node));
|
||||
field_list
|
||||
= chainon (field_list,
|
||||
make_descriptor_field
|
||||
("SB_L2", type_for_size (32, 1), record_type,
|
||||
("SB_L2", gnat_type_for_size (32, 1), record_type,
|
||||
TREE_CODE (type) == ARRAY_TYPE
|
||||
? TYPE_MAX_VALUE (TYPE_DOMAIN (type)) : size_zero_node));
|
||||
break;
|
||||
|
@ -2446,20 +2448,20 @@ build_vms_descriptor (type, mech, gnat_entity)
|
|||
case By_Descriptor_NCA:
|
||||
field_list = chainon (field_list,
|
||||
make_descriptor_field ("SCALE",
|
||||
type_for_size (8, 1),
|
||||
gnat_type_for_size (8, 1),
|
||||
record_type,
|
||||
size_zero_node));
|
||||
|
||||
field_list = chainon (field_list,
|
||||
make_descriptor_field ("DIGITS",
|
||||
type_for_size (8, 1),
|
||||
gnat_type_for_size (8, 1),
|
||||
record_type,
|
||||
size_zero_node));
|
||||
|
||||
field_list
|
||||
= chainon (field_list,
|
||||
make_descriptor_field
|
||||
("AFLAGS", type_for_size (8, 1), record_type,
|
||||
("AFLAGS", gnat_type_for_size (8, 1), record_type,
|
||||
size_int (mech == By_Descriptor_NCA
|
||||
? 0
|
||||
/* Set FL_COLUMN, FL_COEFF, and FL_BOUNDS. */
|
||||
|
@ -2469,13 +2471,13 @@ build_vms_descriptor (type, mech, gnat_entity)
|
|||
|
||||
field_list = chainon (field_list,
|
||||
make_descriptor_field ("DIMCT",
|
||||
type_for_size (8, 1),
|
||||
gnat_type_for_size (8, 1),
|
||||
record_type,
|
||||
size_int (ndim)));
|
||||
|
||||
field_list = chainon (field_list,
|
||||
make_descriptor_field ("ARSIZE",
|
||||
type_for_size (32, 1),
|
||||
gnat_type_for_size (32, 1),
|
||||
record_type,
|
||||
size_in_bytes (type)));
|
||||
|
||||
|
@ -2507,11 +2509,11 @@ build_vms_descriptor (type, mech, gnat_entity)
|
|||
|
||||
fname[0] = (mech == By_Descriptor_NCA ? 'S' : 'M');
|
||||
fname[1] = '0' + i, fname[2] = 0;
|
||||
field_list = chainon (field_list,
|
||||
make_descriptor_field (fname,
|
||||
type_for_size (32, 1),
|
||||
record_type,
|
||||
idx_length));
|
||||
field_list
|
||||
= chainon (field_list,
|
||||
make_descriptor_field (fname,
|
||||
gnat_type_for_size (32, 1),
|
||||
record_type, idx_length));
|
||||
|
||||
if (mech == By_Descriptor_NCA)
|
||||
tem = idx_length;
|
||||
|
@ -2526,14 +2528,14 @@ build_vms_descriptor (type, mech, gnat_entity)
|
|||
field_list
|
||||
= chainon (field_list,
|
||||
make_descriptor_field
|
||||
(fname, type_for_size (32, 1), record_type,
|
||||
(fname, gnat_type_for_size (32, 1), record_type,
|
||||
TYPE_MIN_VALUE (idx_arr[i])));
|
||||
|
||||
fname[0] = 'U';
|
||||
field_list
|
||||
= chainon (field_list,
|
||||
make_descriptor_field
|
||||
(fname, type_for_size (32, 1), record_type,
|
||||
(fname, gnat_type_for_size (32, 1), record_type,
|
||||
TYPE_MAX_VALUE (idx_arr[i])));
|
||||
}
|
||||
break;
|
||||
|
@ -3348,7 +3350,8 @@ unchecked_convert (type, expr)
|
|||
0))
|
||||
&& ! (TREE_UNSIGNED (type) && TREE_UNSIGNED (etype)))
|
||||
{
|
||||
tree base_type = type_for_mode (TYPE_MODE (type), TREE_UNSIGNED (type));
|
||||
tree base_type = gnat_type_for_mode (TYPE_MODE (type),
|
||||
TREE_UNSIGNED (type));
|
||||
tree shift_expr
|
||||
= convert (base_type,
|
||||
size_binop (MINUS_EXPR,
|
||||
|
|
|
@ -511,7 +511,7 @@ nonbinary_modular_operation (op_code, type, lhs, rhs)
|
|||
|| TREE_UNSIGNED (op_type) != unsignedp)
|
||||
{
|
||||
/* Copy the node so we ensure it can be modified to make it modular. */
|
||||
op_type = copy_node (type_for_size (precision, unsignedp));
|
||||
op_type = copy_node (gnat_type_for_size (precision, unsignedp));
|
||||
modulus = convert (op_type, modulus);
|
||||
TYPE_MODULUS (op_type) = modulus;
|
||||
TYPE_MODULAR_P (op_type) = 1;
|
||||
|
@ -527,7 +527,7 @@ nonbinary_modular_operation (op_code, type, lhs, rhs)
|
|||
possible size. */
|
||||
if (op_code == MULT_EXPR)
|
||||
{
|
||||
tree div_type = copy_node (type_for_size (needed_precision, 1));
|
||||
tree div_type = copy_node (gnat_type_for_size (needed_precision, 1));
|
||||
modulus = convert (div_type, modulus);
|
||||
TYPE_MODULUS (div_type) = modulus;
|
||||
TYPE_MODULAR_P (div_type) = 1;
|
||||
|
|
|
@ -835,8 +835,8 @@ handle_mode_attribute (node, name, args, flags, no_add_attrs)
|
|||
|
||||
if (mode == VOIDmode)
|
||||
error ("unknown machine mode `%s'", p);
|
||||
else if (0 == (typefm = type_for_mode (mode,
|
||||
TREE_UNSIGNED (type))))
|
||||
else if (0 == (typefm = (*lang_hooks.types.type_for_mode)
|
||||
(mode, TREE_UNSIGNED (type))))
|
||||
error ("no data type for mode `%s'", p);
|
||||
else
|
||||
*node = typefm;
|
||||
|
@ -1343,7 +1343,8 @@ handle_vector_size_attribute (node, name, args, flags, no_add_attrs)
|
|||
{
|
||||
tree index, array, rt;
|
||||
|
||||
new_type = type_for_mode (new_mode, TREE_UNSIGNED (type));
|
||||
new_type = (*lang_hooks.types.type_for_mode) (new_mode,
|
||||
TREE_UNSIGNED (type));
|
||||
|
||||
if (!new_type)
|
||||
{
|
||||
|
|
|
@ -73,7 +73,7 @@ DEF_PRIMITIVE_TYPE (BT_COMPLEX_LONG_DOUBLE, complex_long_double_type_node)
|
|||
|
||||
DEF_PRIMITIVE_TYPE (BT_PTR, ptr_type_node)
|
||||
DEF_PRIMITIVE_TYPE (BT_CONST_PTR, const_ptr_type_node)
|
||||
DEF_PRIMITIVE_TYPE (BT_PTRMODE, type_for_mode (ptr_mode, 0))
|
||||
DEF_PRIMITIVE_TYPE (BT_PTRMODE, (*lang_hooks.types.type_for_mode)(ptr_mode, 0))
|
||||
DEF_PRIMITIVE_TYPE (BT_SIZE, c_size_type_node)
|
||||
DEF_PRIMITIVE_TYPE (BT_STRING, string_type_node)
|
||||
DEF_PRIMITIVE_TYPE (BT_CONST_STRING, const_string_type_node)
|
||||
|
|
|
@ -1302,7 +1302,7 @@ check_case_value (value)
|
|||
that is unsigned if UNSIGNEDP is nonzero, otherwise signed. */
|
||||
|
||||
tree
|
||||
type_for_size (bits, unsignedp)
|
||||
c_common_type_for_size (bits, unsignedp)
|
||||
unsigned bits;
|
||||
int unsignedp;
|
||||
{
|
||||
|
@ -1346,7 +1346,7 @@ type_for_size (bits, unsignedp)
|
|||
then UNSIGNEDP selects between signed and unsigned types. */
|
||||
|
||||
tree
|
||||
type_for_mode (mode, unsignedp)
|
||||
c_common_type_for_mode (mode, unsignedp)
|
||||
enum machine_mode mode;
|
||||
int unsignedp;
|
||||
{
|
||||
|
@ -1761,7 +1761,7 @@ shorten_compare (op0_ptr, op1_ptr, restype_ptr, rescode_ptr)
|
|||
values from it's underlying integral type, not the enumerated
|
||||
type itself. */
|
||||
if (TREE_CODE (type) == ENUMERAL_TYPE)
|
||||
type = type_for_size (TYPE_PRECISION (type), unsignedp0);
|
||||
type = c_common_type_for_size (TYPE_PRECISION (type), unsignedp0);
|
||||
|
||||
maxval = TYPE_MAX_VALUE (type);
|
||||
minval = TYPE_MIN_VALUE (type);
|
||||
|
@ -2065,8 +2065,8 @@ pointer_int_sum (resultcode, ptrop, intop)
|
|||
|
||||
if (TYPE_PRECISION (TREE_TYPE (intop)) != TYPE_PRECISION (sizetype)
|
||||
|| TREE_UNSIGNED (TREE_TYPE (intop)) != TREE_UNSIGNED (sizetype))
|
||||
intop = convert (type_for_size (TYPE_PRECISION (sizetype),
|
||||
TREE_UNSIGNED (sizetype)), intop);
|
||||
intop = convert (c_common_type_for_size (TYPE_PRECISION (sizetype),
|
||||
TREE_UNSIGNED (sizetype)), intop);
|
||||
|
||||
/* Replace the integer argument with a suitable product by the object size.
|
||||
Do this multiplication as signed, then convert to the appropriate
|
||||
|
@ -2577,7 +2577,8 @@ c_common_nodes_and_builtins ()
|
|||
record_builtin_type (RID_MAX, "signed char", signed_char_type_node);
|
||||
record_builtin_type (RID_MAX, "unsigned char", unsigned_char_type_node);
|
||||
|
||||
/* These are types that type_for_size and type_for_mode use. */
|
||||
/* These are types that c_common_type_for_size and
|
||||
c_common_type_for_mode use. */
|
||||
(*lang_hooks.decls.pushdecl) (build_decl (TYPE_DECL, NULL_TREE,
|
||||
intQI_type_node));
|
||||
(*lang_hooks.decls.pushdecl) (build_decl (TYPE_DECL, NULL_TREE,
|
||||
|
|
|
@ -507,6 +507,9 @@ extern tree handle_format_attribute PARAMS ((tree *, tree, tree,
|
|||
extern tree handle_format_arg_attribute PARAMS ((tree *, tree, tree,
|
||||
int, bool *));
|
||||
extern void c_common_insert_default_attributes PARAMS ((tree));
|
||||
extern tree c_common_type_for_mode PARAMS ((enum machine_mode,
|
||||
int));
|
||||
extern tree c_common_type_for_size PARAMS ((unsigned int, int));
|
||||
extern void c_apply_type_quals_to_decl PARAMS ((int, tree));
|
||||
extern tree c_sizeof PARAMS ((tree));
|
||||
extern tree c_alignof PARAMS ((tree));
|
||||
|
|
13
gcc/c-decl.c
13
gcc/c-decl.c
|
@ -5844,7 +5844,7 @@ finish_enum (enumtype, values, attributes)
|
|||
min_precision (maxnode, unsign));
|
||||
if (TYPE_PACKED (enumtype) || precision > TYPE_PRECISION (integer_type_node))
|
||||
{
|
||||
tree narrowest = type_for_size (precision, unsign);
|
||||
tree narrowest = c_common_type_for_size (precision, unsign);
|
||||
if (narrowest == 0)
|
||||
{
|
||||
warning ("enumeration values exceed range of largest integer");
|
||||
|
@ -5857,7 +5857,7 @@ finish_enum (enumtype, values, attributes)
|
|||
precision = TYPE_PRECISION (integer_type_node);
|
||||
|
||||
if (precision == TYPE_PRECISION (integer_type_node))
|
||||
enum_value_type = type_for_size (precision, 0);
|
||||
enum_value_type = c_common_type_for_size (precision, 0);
|
||||
else
|
||||
enum_value_type = enumtype;
|
||||
|
||||
|
@ -5985,10 +5985,11 @@ build_enumerator (name, value)
|
|||
/* Now create a declaration for the enum value name. */
|
||||
|
||||
type = TREE_TYPE (value);
|
||||
type = type_for_size (MAX (TYPE_PRECISION (type),
|
||||
TYPE_PRECISION (integer_type_node)),
|
||||
(TYPE_PRECISION (type) >= TYPE_PRECISION (integer_type_node)
|
||||
&& TREE_UNSIGNED (type)));
|
||||
type = c_common_type_for_size (MAX (TYPE_PRECISION (type),
|
||||
TYPE_PRECISION (integer_type_node)),
|
||||
(TYPE_PRECISION (type)
|
||||
>= TYPE_PRECISION (integer_type_node)
|
||||
&& TREE_UNSIGNED (type)));
|
||||
|
||||
decl = build_decl (CONST_DECL, name, type);
|
||||
DECL_INITIAL (decl) = convert (type, value);
|
||||
|
|
|
@ -80,6 +80,11 @@ static void c_post_options PARAMS ((void));
|
|||
#define LANG_HOOKS_TREE_INLINING_CONVERT_PARM_FOR_INLINING \
|
||||
c_convert_parm_for_inlining
|
||||
|
||||
#undef LANG_HOOKS_TYPE_FOR_MODE
|
||||
#define LANG_HOOKS_TYPE_FOR_MODE c_common_type_for_mode
|
||||
#undef LANG_HOOKS_TYPE_FOR_SIZE
|
||||
#define LANG_HOOKS_TYPE_FOR_SIZE c_common_type_for_size
|
||||
|
||||
/* ### When changing hooks, consider if ObjC needs changing too!! ### */
|
||||
|
||||
/* Each front end provides its own. */
|
||||
|
|
|
@ -216,9 +216,9 @@ common_type (t1, t2)
|
|||
/* Treat an enum type as the unsigned integer type of the same width. */
|
||||
|
||||
if (TREE_CODE (t1) == ENUMERAL_TYPE)
|
||||
t1 = type_for_size (TYPE_PRECISION (t1), 1);
|
||||
t1 = c_common_type_for_size (TYPE_PRECISION (t1), 1);
|
||||
if (TREE_CODE (t2) == ENUMERAL_TYPE)
|
||||
t2 = type_for_size (TYPE_PRECISION (t2), 1);
|
||||
t2 = c_common_type_for_size (TYPE_PRECISION (t2), 1);
|
||||
|
||||
code1 = TREE_CODE (t1);
|
||||
code2 = TREE_CODE (t2);
|
||||
|
@ -465,9 +465,9 @@ comptypes (type1, type2)
|
|||
signedness. */
|
||||
|
||||
if (TREE_CODE (t1) == ENUMERAL_TYPE)
|
||||
t1 = type_for_size (TYPE_PRECISION (t1), TREE_UNSIGNED (t1));
|
||||
t1 = c_common_type_for_size (TYPE_PRECISION (t1), TREE_UNSIGNED (t1));
|
||||
if (TREE_CODE (t2) == ENUMERAL_TYPE)
|
||||
t2 = type_for_size (TYPE_PRECISION (t2), TREE_UNSIGNED (t2));
|
||||
t2 = c_common_type_for_size (TYPE_PRECISION (t2), TREE_UNSIGNED (t2));
|
||||
|
||||
if (t1 == t2)
|
||||
return 1;
|
||||
|
@ -994,11 +994,11 @@ default_conversion (exp)
|
|||
but convert wide enums to something wider. */
|
||||
if (code == ENUMERAL_TYPE)
|
||||
{
|
||||
type = type_for_size (MAX (TYPE_PRECISION (type),
|
||||
TYPE_PRECISION (integer_type_node)),
|
||||
((TYPE_PRECISION (type)
|
||||
>= TYPE_PRECISION (integer_type_node))
|
||||
&& TREE_UNSIGNED (type)));
|
||||
type = c_common_type_for_size (MAX (TYPE_PRECISION (type),
|
||||
TYPE_PRECISION (integer_type_node)),
|
||||
((TYPE_PRECISION (type)
|
||||
>= TYPE_PRECISION (integer_type_node))
|
||||
&& TREE_UNSIGNED (type)));
|
||||
|
||||
return convert (type, exp);
|
||||
}
|
||||
|
|
46
gcc/calls.c
46
gcc/calls.c
|
@ -33,6 +33,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
|
|||
#include "tm_p.h"
|
||||
#include "timevar.h"
|
||||
#include "sbitmap.h"
|
||||
#include "langhooks.h"
|
||||
|
||||
#if !defined FUNCTION_OK_FOR_SIBCALL
|
||||
#define FUNCTION_OK_FOR_SIBCALL(DECL) 1
|
||||
|
@ -3476,6 +3477,7 @@ emit_library_call_value_1 (retval, orgfun, value, fn_type, outmode, nargs, p)
|
|||
int reg_parm_stack_space = 0;
|
||||
int needed;
|
||||
rtx before_call;
|
||||
tree tfom; /* type_for_mode (outmode, 0) */
|
||||
|
||||
#ifdef REG_PARM_STACK_SPACE
|
||||
/* Define the boundary of the register parm stack space that needs to be
|
||||
|
@ -3537,27 +3539,31 @@ emit_library_call_value_1 (retval, orgfun, value, fn_type, outmode, nargs, p)
|
|||
|
||||
/* If this kind of value comes back in memory,
|
||||
decide where in memory it should come back. */
|
||||
if (outmode != VOIDmode && aggregate_value_p (type_for_mode (outmode, 0)))
|
||||
if (outmode != VOIDmode)
|
||||
{
|
||||
tfom = (*lang_hooks.types.type_for_mode) (outmode, 0);
|
||||
if (aggregate_value_p (tfom))
|
||||
{
|
||||
#ifdef PCC_STATIC_STRUCT_RETURN
|
||||
rtx pointer_reg
|
||||
= hard_function_value (build_pointer_type (type_for_mode (outmode, 0)),
|
||||
0, 0);
|
||||
mem_value = gen_rtx_MEM (outmode, pointer_reg);
|
||||
pcc_struct_value = 1;
|
||||
if (value == 0)
|
||||
value = gen_reg_rtx (outmode);
|
||||
rtx pointer_reg
|
||||
= hard_function_value (build_pointer_type (tfom), 0, 0);
|
||||
mem_value = gen_rtx_MEM (outmode, pointer_reg);
|
||||
pcc_struct_value = 1;
|
||||
if (value == 0)
|
||||
value = gen_reg_rtx (outmode);
|
||||
#else /* not PCC_STATIC_STRUCT_RETURN */
|
||||
struct_value_size = GET_MODE_SIZE (outmode);
|
||||
if (value != 0 && GET_CODE (value) == MEM)
|
||||
mem_value = value;
|
||||
else
|
||||
mem_value = assign_temp (type_for_mode (outmode, 0), 0, 1, 1);
|
||||
struct_value_size = GET_MODE_SIZE (outmode);
|
||||
if (value != 0 && GET_CODE (value) == MEM)
|
||||
mem_value = value;
|
||||
else
|
||||
mem_value = assign_temp (tfom, 0, 1, 1);
|
||||
#endif
|
||||
|
||||
/* This call returns a big structure. */
|
||||
flags &= ~(ECF_CONST | ECF_PURE | ECF_LIBCALL_BLOCK);
|
||||
/* This call returns a big structure. */
|
||||
flags &= ~(ECF_CONST | ECF_PURE | ECF_LIBCALL_BLOCK);
|
||||
}
|
||||
}
|
||||
else
|
||||
tfom = void_type_node;
|
||||
|
||||
/* ??? Unfinished: must pass the memory address as an argument. */
|
||||
|
||||
|
@ -3670,12 +3676,13 @@ emit_library_call_value_1 (retval, orgfun, value, fn_type, outmode, nargs, p)
|
|||
slot = val;
|
||||
else if (must_copy)
|
||||
{
|
||||
slot = assign_temp (type_for_mode (mode, 0), 0, 1, 1);
|
||||
slot = assign_temp ((*lang_hooks.types.type_for_mode) (mode, 0),
|
||||
0, 1, 1);
|
||||
emit_move_insn (slot, val);
|
||||
}
|
||||
else
|
||||
{
|
||||
tree type = type_for_mode (mode, 0);
|
||||
tree type = (*lang_hooks.types.type_for_mode) (mode, 0);
|
||||
|
||||
slot = gen_rtx_MEM (mode,
|
||||
expand_expr (build1 (ADDR_EXPR,
|
||||
|
@ -4042,8 +4049,7 @@ emit_library_call_value_1 (retval, orgfun, value, fn_type, outmode, nargs, p)
|
|||
|
||||
emit_call_1 (fun,
|
||||
get_identifier (XSTR (orgfun, 0)),
|
||||
build_function_type (outmode == VOIDmode ? void_type_node
|
||||
: type_for_mode (outmode, 0), NULL_TREE),
|
||||
build_function_type (tfom, NULL_TREE),
|
||||
original_args_size.constant, args_size.constant,
|
||||
struct_value_size,
|
||||
FUNCTION_ARG (args_so_far, VOIDmode, void_type_node, 1),
|
||||
|
|
|
@ -29,6 +29,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
|
|||
#include "flags.h"
|
||||
#include "convert.h"
|
||||
#include "toplev.h"
|
||||
#include "langhooks.h"
|
||||
|
||||
/* Convert EXPR to some pointer or reference type TYPE.
|
||||
|
||||
|
@ -61,7 +62,8 @@ convert_to_pointer (type, expr)
|
|||
|
||||
return
|
||||
convert_to_pointer (type,
|
||||
convert (type_for_size (POINTER_SIZE, 0), expr));
|
||||
convert ((*lang_hooks.types.type_for_size)
|
||||
(POINTER_SIZE, 0), expr));
|
||||
|
||||
default:
|
||||
error ("cannot convert to a pointer type");
|
||||
|
@ -138,8 +140,8 @@ convert_to_integer (type, expr)
|
|||
if (integer_zerop (expr))
|
||||
expr = integer_zero_node;
|
||||
else
|
||||
expr = fold (build1 (CONVERT_EXPR,
|
||||
type_for_size (POINTER_SIZE, 0), expr));
|
||||
expr = fold (build1 (CONVERT_EXPR, (*lang_hooks.types.type_for_size)
|
||||
(POINTER_SIZE, 0), expr));
|
||||
|
||||
return convert_to_integer (type, expr);
|
||||
|
||||
|
@ -189,8 +191,8 @@ convert_to_integer (type, expr)
|
|||
else if (TREE_CODE (type) == ENUMERAL_TYPE
|
||||
|| outprec != GET_MODE_BITSIZE (TYPE_MODE (type)))
|
||||
return build1 (NOP_EXPR, type,
|
||||
convert (type_for_mode (TYPE_MODE (type),
|
||||
TREE_UNSIGNED (type)),
|
||||
convert ((*lang_hooks.types.type_for_mode)
|
||||
(TYPE_MODE (type), TREE_UNSIGNED (type)),
|
||||
expr));
|
||||
|
||||
/* Here detect when we can distribute the truncation down past some
|
||||
|
@ -300,8 +302,8 @@ convert_to_integer (type, expr)
|
|||
/* Can't do arithmetic in enumeral types
|
||||
so use an integer type that will hold the values. */
|
||||
if (TREE_CODE (typex) == ENUMERAL_TYPE)
|
||||
typex = type_for_size (TYPE_PRECISION (typex),
|
||||
TREE_UNSIGNED (typex));
|
||||
typex = (*lang_hooks.types.type_for_size)
|
||||
(TYPE_PRECISION (typex), TREE_UNSIGNED (typex));
|
||||
|
||||
/* But now perhaps TYPEX is as wide as INPREC.
|
||||
In that case, do nothing special here.
|
||||
|
@ -338,8 +340,8 @@ convert_to_integer (type, expr)
|
|||
/* Can't do arithmetic in enumeral types
|
||||
so use an integer type that will hold the values. */
|
||||
if (TREE_CODE (typex) == ENUMERAL_TYPE)
|
||||
typex = type_for_size (TYPE_PRECISION (typex),
|
||||
TREE_UNSIGNED (typex));
|
||||
typex = (*lang_hooks.types.type_for_size)
|
||||
(TYPE_PRECISION (typex), TREE_UNSIGNED (typex));
|
||||
|
||||
/* But now perhaps TYPEX is as wide as INPREC.
|
||||
In that case, do nothing special here.
|
||||
|
|
|
@ -1,3 +1,14 @@
|
|||
2002-03-29 Neil Booth <neil@daikokuya.demon.co.uk>
|
||||
|
||||
* cp-lang.c (LANG_HOOKS_TYPE_FOR_MODE, LANG_HOOKS_TYPE_FOR_SIZE):
|
||||
Redefine.
|
||||
* cvt.c (cp_convert_to_pointer, type_promotes_to): Use new hooks.
|
||||
* decl.c (finish_enum): Similarly.
|
||||
* error.c (dump_type): Similarly.
|
||||
* lex.c (cxx_init): Similarly.
|
||||
* mangle.c (write_builtin_type): Similarly.
|
||||
* typeck.c (comptypes): Similarly.
|
||||
|
||||
2002-03-28 Roger Sayle <roger@eyesopen.com>
|
||||
|
||||
PR c++/5998:
|
||||
|
|
|
@ -111,6 +111,10 @@ static bool ok_to_generate_alias_set_for_type PARAMS ((tree));
|
|||
|
||||
#undef LANG_HOOKS_MAKE_TYPE
|
||||
#define LANG_HOOKS_MAKE_TYPE cxx_make_type
|
||||
#undef LANG_HOOKS_TYPE_FOR_MODE
|
||||
#define LANG_HOOKS_TYPE_FOR_MODE c_common_type_for_mode
|
||||
#undef LANG_HOOKS_TYPE_FOR_SIZE
|
||||
#define LANG_HOOKS_TYPE_FOR_SIZE c_common_type_for_size
|
||||
|
||||
/* Each front end provides its own hooks, for toplev.c. */
|
||||
const struct lang_hooks lang_hooks = LANG_HOOKS_INITIALIZER;
|
||||
|
|
|
@ -256,7 +256,7 @@ cp_convert_to_pointer (type, expr, force)
|
|||
{
|
||||
if (TYPE_PRECISION (intype) == POINTER_SIZE)
|
||||
return build1 (CONVERT_EXPR, type, expr);
|
||||
expr = cp_convert (type_for_size (POINTER_SIZE, 0), expr);
|
||||
expr = cp_convert (c_common_type_for_size (POINTER_SIZE, 0), expr);
|
||||
/* Modes may be different but sizes should be the same. */
|
||||
if (GET_MODE_SIZE (TYPE_MODE (TREE_TYPE (expr)))
|
||||
!= GET_MODE_SIZE (TYPE_MODE (type)))
|
||||
|
@ -1183,10 +1183,10 @@ type_promotes_to (type)
|
|||
{
|
||||
int precision = MAX (TYPE_PRECISION (type),
|
||||
TYPE_PRECISION (integer_type_node));
|
||||
tree totype = type_for_size (precision, 0);
|
||||
tree totype = c_common_type_for_size (precision, 0);
|
||||
if (TREE_UNSIGNED (type)
|
||||
&& ! int_fits_type_p (TYPE_MAX_VALUE (type), totype))
|
||||
type = type_for_size (precision, 1);
|
||||
type = c_common_type_for_size (precision, 1);
|
||||
else
|
||||
type = totype;
|
||||
}
|
||||
|
|
|
@ -13247,7 +13247,7 @@ finish_enum (enumtype)
|
|||
if (flag_short_enums || (precision > TYPE_PRECISION (integer_type_node)))
|
||||
/* Use the width of the narrowest normal C type which is wide
|
||||
enough. */
|
||||
TYPE_PRECISION (enumtype) = TYPE_PRECISION (type_for_size
|
||||
TYPE_PRECISION (enumtype) = TYPE_PRECISION (c_common_type_for_size
|
||||
(precision, 1));
|
||||
else
|
||||
TYPE_PRECISION (enumtype) = TYPE_PRECISION (integer_type_node);
|
||||
|
|
|
@ -387,7 +387,7 @@ dump_type (t, flags)
|
|||
which has no name and is not very useful for diagnostics. So
|
||||
look up the equivalent C type and print its name. */
|
||||
tree elt = TREE_TYPE (t);
|
||||
elt = type_for_mode (TYPE_MODE (elt), TREE_UNSIGNED (elt));
|
||||
elt = c_common_type_for_mode (TYPE_MODE (elt), TREE_UNSIGNED (elt));
|
||||
dump_type (elt, flags);
|
||||
}
|
||||
break;
|
||||
|
|
|
@ -677,7 +677,7 @@ cxx_init (filename)
|
|||
|
||||
/* Create the built-in __null node. */
|
||||
null_node = build_int_2 (0, 0);
|
||||
TREE_TYPE (null_node) = type_for_size (POINTER_SIZE, 0);
|
||||
TREE_TYPE (null_node) = c_common_type_for_size (POINTER_SIZE, 0);
|
||||
ridpointers[RID_NULL] = null_node;
|
||||
|
||||
token_count = init_cpp_parse ();
|
||||
|
|
|
@ -1560,7 +1560,8 @@ write_builtin_type (type)
|
|||
|
||||
if (itk == itk_none)
|
||||
{
|
||||
tree t = type_for_mode (TYPE_MODE (type), TREE_UNSIGNED (type));
|
||||
tree t = c_common_type_for_mode (TYPE_MODE (type),
|
||||
TREE_UNSIGNED (type));
|
||||
if (type == t)
|
||||
{
|
||||
if (TYPE_PRECISION (type) == 128)
|
||||
|
|
|
@ -910,9 +910,9 @@ comptypes (t1, t2, strict)
|
|||
/* Treat an enum type as the unsigned integer type of the same width. */
|
||||
|
||||
if (TREE_CODE (t1) == ENUMERAL_TYPE)
|
||||
t1 = type_for_size (TYPE_PRECISION (t1), 1);
|
||||
t1 = c_common_type_for_size (TYPE_PRECISION (t1), 1);
|
||||
if (TREE_CODE (t2) == ENUMERAL_TYPE)
|
||||
t2 = type_for_size (TYPE_PRECISION (t2), 1);
|
||||
t2 = c_common_type_for_size (TYPE_PRECISION (t2), 1);
|
||||
|
||||
if (t1 == t2)
|
||||
return 1;
|
||||
|
|
|
@ -396,7 +396,8 @@ init_eh ()
|
|||
DECL_FIELD_CONTEXT (f_cs) = sjlj_fc_type_node;
|
||||
|
||||
tmp = build_index_type (build_int_2 (4 - 1, 0));
|
||||
tmp = build_array_type (type_for_mode (word_mode, 1), tmp);
|
||||
tmp = build_array_type ((*lang_hooks.types.type_for_mode) (word_mode, 1),
|
||||
tmp);
|
||||
f_data = build_decl (FIELD_DECL, get_identifier ("__data"), tmp);
|
||||
DECL_FIELD_CONTEXT (f_data) = sjlj_fc_type_node;
|
||||
|
||||
|
|
|
@ -33,6 +33,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
|
|||
#include "optabs.h"
|
||||
#include "real.h"
|
||||
#include "recog.h"
|
||||
#include "langhooks.h"
|
||||
|
||||
static void store_fixed_bit_field PARAMS ((rtx, unsigned HOST_WIDE_INT,
|
||||
unsigned HOST_WIDE_INT,
|
||||
|
@ -4168,9 +4169,10 @@ expand_mult_add (x, target, mult, add, mode, unsignedp)
|
|||
enum machine_mode mode;
|
||||
int unsignedp;
|
||||
{
|
||||
tree type = type_for_mode (mode, unsignedp);
|
||||
tree type = (*lang_hooks.types.type_for_mode) (mode, unsignedp);
|
||||
tree add_type = (GET_MODE (add) == VOIDmode
|
||||
? type : type_for_mode (GET_MODE (add), unsignedp));
|
||||
? type: (*lang_hooks.types.type_for_mode) (GET_MODE (add),
|
||||
unsignedp));
|
||||
tree result = fold (build (PLUS_EXPR, type,
|
||||
fold (build (MULT_EXPR, type,
|
||||
make_tree (type, x),
|
||||
|
|
22
gcc/expr.c
22
gcc/expr.c
|
@ -4027,8 +4027,9 @@ store_expr (exp, target, want_value)
|
|||
TREE_TYPE (exp)),
|
||||
exp);
|
||||
|
||||
exp = convert (type_for_mode (GET_MODE (SUBREG_REG (target)),
|
||||
SUBREG_PROMOTED_UNSIGNED_P (target)),
|
||||
exp = convert ((*lang_hooks.types.type_for_mode)
|
||||
(GET_MODE (SUBREG_REG (target)),
|
||||
SUBREG_PROMOTED_UNSIGNED_P (target)),
|
||||
exp);
|
||||
|
||||
inner_target = SUBREG_REG (target);
|
||||
|
@ -4526,7 +4527,8 @@ store_constructor (exp, target, cleared, size)
|
|||
|
||||
if (TYPE_PRECISION (type) < BITS_PER_WORD)
|
||||
{
|
||||
type = type_for_size (BITS_PER_WORD, TREE_UNSIGNED (type));
|
||||
type = (*lang_hooks.types.type_for_size)
|
||||
(BITS_PER_WORD, TREE_UNSIGNED (type));
|
||||
value = convert (type, value);
|
||||
}
|
||||
|
||||
|
@ -4955,7 +4957,8 @@ store_constructor (exp, target, cleared, size)
|
|||
{
|
||||
targetx
|
||||
= assign_temp
|
||||
((build_qualified_type (type_for_mode (GET_MODE (target), 0),
|
||||
((build_qualified_type ((*lang_hooks.types.type_for_mode)
|
||||
(GET_MODE (target), 0),
|
||||
TYPE_QUAL_CONST)),
|
||||
0, 1, 1);
|
||||
emit_move_insn (targetx, target);
|
||||
|
@ -7015,7 +7018,8 @@ expand_expr (exp, target, tmode, modifier)
|
|||
if (mode == BLKmode)
|
||||
{
|
||||
rtx new = assign_temp (build_qualified_type
|
||||
(type_for_mode (ext_mode, 0),
|
||||
((*lang_hooks.types.type_for_mode)
|
||||
(ext_mode, 0),
|
||||
TYPE_QUAL_CONST), 0, 1, 1);
|
||||
|
||||
emit_move_insn (new, op0);
|
||||
|
@ -9252,7 +9256,7 @@ do_jump (exp, if_false_label, if_true_label)
|
|||
&& TYPE_PRECISION (TREE_TYPE (exp)) <= HOST_BITS_PER_WIDE_INT
|
||||
&& (i = tree_floor_log2 (TREE_OPERAND (exp, 1))) >= 0
|
||||
&& (mode = mode_for_size (i + 1, MODE_INT, 0)) != BLKmode
|
||||
&& (type = type_for_mode (mode, 1)) != 0
|
||||
&& (type = (*lang_hooks.types.type_for_mode) (mode, 1)) != 0
|
||||
&& TYPE_PRECISION (type) < TYPE_PRECISION (TREE_TYPE (exp))
|
||||
&& (cmp_optab->handlers[(int) TYPE_MODE (type)].insn_code
|
||||
!= CODE_FOR_nothing))
|
||||
|
@ -9312,7 +9316,7 @@ do_jump (exp, if_false_label, if_true_label)
|
|||
get_inner_reference (exp, &bitsize, &bitpos, &offset, &mode,
|
||||
&unsignedp, &volatilep);
|
||||
|
||||
type = type_for_size (bitsize, unsignedp);
|
||||
type = (*lang_hooks.types.type_for_size) (bitsize, unsignedp);
|
||||
if (! SLOW_BYTE_ACCESS
|
||||
&& type != 0 && bitsize >= 0
|
||||
&& TYPE_PRECISION (type) < TYPE_PRECISION (TREE_TYPE (exp))
|
||||
|
@ -10393,8 +10397,8 @@ try_casesi (index_type, index_expr, minval, range,
|
|||
{
|
||||
if (TYPE_MODE (index_type) != index_mode)
|
||||
{
|
||||
index_expr = convert (type_for_size (index_bits, 0),
|
||||
index_expr);
|
||||
index_expr = convert ((*lang_hooks.types.type_for_size)
|
||||
(index_bits, 0), index_expr);
|
||||
index_type = TREE_TYPE (index_expr);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,3 +1,11 @@
|
|||
Fri Mar 29 21:59:15 2002 Neil Booth <neil@daikokuya.demon.co.uk>
|
||||
|
||||
* com.c (LANG_HOOKS_TYPE_FOR_MODE, LANG_HOOKS_TYPE_FOR_SIZE):
|
||||
Redefine.
|
||||
(type_for_mode, type_for_size): Rename.
|
||||
(signed_or_unsigned_type, signed_type, truthvalue_conversion,
|
||||
unsigned_type): Use new hooks.
|
||||
|
||||
Tue Mar 26 10:30:05 2002 Andrew Cagney <ac131313@redhat.com>
|
||||
|
||||
* invoke.texi (Warning Options): Mention -Wswitch-enum.
|
||||
|
|
20
gcc/f/com.c
20
gcc/f/com.c
|
@ -261,6 +261,8 @@ struct _ffecom_concat_list_
|
|||
|
||||
/* Static functions (internal). */
|
||||
|
||||
static tree ffe_type_for_mode PARAMS ((enum machine_mode, int));
|
||||
static tree ffe_type_for_size PARAMS ((unsigned int, int));
|
||||
static void ffecom_init_decl_processing PARAMS ((void));
|
||||
static tree ffecom_arglist_expr_ (const char *argstring, ffebld args);
|
||||
static tree ffecom_widest_expr_type_ (ffebld list);
|
||||
|
@ -14225,6 +14227,10 @@ static void ffe_mark_tree (tree);
|
|||
#define LANG_HOOKS_PRINT_IDENTIFIER ffe_print_identifier
|
||||
#undef LANG_HOOKS_DECL_PRINTABLE_NAME
|
||||
#define LANG_HOOKS_DECL_PRINTABLE_NAME ffe_printable_name
|
||||
#undef LANG_HOOKS_TYPE_FOR_MODE
|
||||
#define LANG_HOOKS_TYPE_FOR_MODE ffe_type_for_mode
|
||||
#undef LANG_HOOKS_TYPE_FOR_SIZE
|
||||
#define LANG_HOOKS_TYPE_FOR_SIZE ffe_type_for_size
|
||||
|
||||
/* We do not wish to use alias-set based aliasing at all. Used in the
|
||||
extreme (every object with its own set, with equivalences recorded) it
|
||||
|
@ -14758,7 +14764,7 @@ signed_or_unsigned_type (unsignedp, type)
|
|||
return (unsignedp ? long_long_unsigned_type_node
|
||||
: long_long_integer_type_node);
|
||||
|
||||
type2 = type_for_size (TYPE_PRECISION (type), unsignedp);
|
||||
type2 = ffe_type_for_size (TYPE_PRECISION (type), unsignedp);
|
||||
if (type2 == NULL_TREE)
|
||||
return type;
|
||||
|
||||
|
@ -14794,7 +14800,7 @@ signed_type (type)
|
|||
return intQI_type_node;
|
||||
#endif
|
||||
|
||||
type2 = type_for_size (TYPE_PRECISION (type1), 0);
|
||||
type2 = ffe_type_for_size (TYPE_PRECISION (type1), 0);
|
||||
if (type2 != NULL_TREE)
|
||||
return type2;
|
||||
|
||||
|
@ -14992,8 +14998,8 @@ truthvalue_conversion (expr)
|
|||
convert (TREE_TYPE (expr), integer_zero_node));
|
||||
}
|
||||
|
||||
tree
|
||||
type_for_mode (mode, unsignedp)
|
||||
static tree
|
||||
ffe_type_for_mode (mode, unsignedp)
|
||||
enum machine_mode mode;
|
||||
int unsignedp;
|
||||
{
|
||||
|
@ -15049,8 +15055,8 @@ type_for_mode (mode, unsignedp)
|
|||
return 0;
|
||||
}
|
||||
|
||||
tree
|
||||
type_for_size (bits, unsignedp)
|
||||
static tree
|
||||
ffe_type_for_size (bits, unsignedp)
|
||||
unsigned bits;
|
||||
int unsignedp;
|
||||
{
|
||||
|
@ -15114,7 +15120,7 @@ unsigned_type (type)
|
|||
return unsigned_intQI_type_node;
|
||||
#endif
|
||||
|
||||
type2 = type_for_size (TYPE_PRECISION (type1), 1);
|
||||
type2 = ffe_type_for_size (TYPE_PRECISION (type1), 1);
|
||||
if (type2 != NULL_TREE)
|
||||
return type2;
|
||||
|
||||
|
|
|
@ -2426,8 +2426,8 @@ optimize_bit_field_compare (code, compare_type, lhs, rhs)
|
|||
|
||||
/* Set signed and unsigned types of the precision of this mode for the
|
||||
shifts below. */
|
||||
signed_type = type_for_mode (nmode, 0);
|
||||
unsigned_type = type_for_mode (nmode, 1);
|
||||
signed_type = (*lang_hooks.types.type_for_mode) (nmode, 0);
|
||||
unsigned_type = (*lang_hooks.types.type_for_mode) (nmode, 1);
|
||||
|
||||
/* Compute the bit position and size for the new reference and our offset
|
||||
within it. If the new reference is the same size as the original, we
|
||||
|
@ -2590,7 +2590,7 @@ decode_field_reference (exp, pbitsize, pbitpos, pmode, punsignedp,
|
|||
return 0;
|
||||
|
||||
/* Compute the mask to access the bitfield. */
|
||||
unsigned_type = type_for_size (*pbitsize, 1);
|
||||
unsigned_type = (*lang_hooks.types.type_for_size) (*pbitsize, 1);
|
||||
precision = TYPE_PRECISION (unsigned_type);
|
||||
|
||||
mask = build_int_2 (~0, ~0);
|
||||
|
@ -2960,7 +2960,8 @@ make_range (exp, pin_p, plow, phigh)
|
|||
be interpreted as positive. */
|
||||
if (TREE_UNSIGNED (type) && ! TREE_UNSIGNED (TREE_TYPE (exp)))
|
||||
{
|
||||
tree equiv_type = type_for_mode (TYPE_MODE (type), 1);
|
||||
tree equiv_type = (*lang_hooks.types.type_for_mode)
|
||||
(TYPE_MODE (type), 1);
|
||||
tree high_positive;
|
||||
|
||||
/* A range without an upper bound is, naturally, unbounded.
|
||||
|
@ -3509,7 +3510,7 @@ fold_truthop (code, truth_type, lhs, rhs)
|
|||
|
||||
lnbitsize = GET_MODE_BITSIZE (lnmode);
|
||||
lnbitpos = first_bit & ~ (lnbitsize - 1);
|
||||
lntype = type_for_size (lnbitsize, 1);
|
||||
lntype = (*lang_hooks.types.type_for_size) (lnbitsize, 1);
|
||||
xll_bitpos = ll_bitpos - lnbitpos, xrl_bitpos = rl_bitpos - lnbitpos;
|
||||
|
||||
if (BYTES_BIG_ENDIAN)
|
||||
|
@ -3580,7 +3581,7 @@ fold_truthop (code, truth_type, lhs, rhs)
|
|||
|
||||
rnbitsize = GET_MODE_BITSIZE (rnmode);
|
||||
rnbitpos = first_bit & ~ (rnbitsize - 1);
|
||||
rntype = type_for_size (rnbitsize, 1);
|
||||
rntype = (*lang_hooks.types.type_for_size) (rnbitsize, 1);
|
||||
xlr_bitpos = lr_bitpos - rnbitpos, xrr_bitpos = rr_bitpos - rnbitpos;
|
||||
|
||||
if (BYTES_BIG_ENDIAN)
|
||||
|
@ -5720,7 +5721,7 @@ fold (expr)
|
|||
|| integer_onep (folded_compare))
|
||||
return omit_one_operand (type, folded_compare, varop);
|
||||
|
||||
unsigned_type = type_for_size (size, 1);
|
||||
unsigned_type = (*lang_hooks.types.type_for_size)(size, 1);
|
||||
precision = TYPE_PRECISION (unsigned_type);
|
||||
mask = build_int_2 (~0, ~0);
|
||||
TREE_TYPE (mask) = unsigned_type;
|
||||
|
@ -5781,7 +5782,7 @@ fold (expr)
|
|||
|| integer_onep (folded_compare))
|
||||
return omit_one_operand (type, folded_compare, varop);
|
||||
|
||||
unsigned_type = type_for_size (size, 1);
|
||||
unsigned_type = (*lang_hooks.types.type_for_size)(size, 1);
|
||||
precision = TYPE_PRECISION (unsigned_type);
|
||||
mask = build_int_2 (~0, ~0);
|
||||
TREE_TYPE (mask) = TREE_TYPE (varop);
|
||||
|
|
|
@ -556,7 +556,7 @@ assign_stack_local_1 (mode, size, align, function)
|
|||
|
||||
/* Allow the target to (possibly) increase the alignment of this
|
||||
stack slot. */
|
||||
type = type_for_mode (mode, 0);
|
||||
type = (*lang_hooks.types.type_for_mode) (mode, 0);
|
||||
if (type)
|
||||
alignment = LOCAL_ALIGNMENT (type, alignment);
|
||||
|
||||
|
@ -675,7 +675,7 @@ assign_stack_temp_for_type (mode, size, keep, type)
|
|||
align = GET_MODE_ALIGNMENT (mode);
|
||||
|
||||
if (! type)
|
||||
type = type_for_mode (mode, 0);
|
||||
type = (*lang_hooks.types.type_for_mode) (mode, 0);
|
||||
|
||||
if (type)
|
||||
align = LOCAL_ALIGNMENT (type, align);
|
||||
|
@ -1415,7 +1415,7 @@ put_var_into_stack (decl)
|
|||
to the whole CONCAT, lest we do double fixups for the latter
|
||||
references. */
|
||||
enum machine_mode part_mode = GET_MODE (XEXP (reg, 0));
|
||||
tree part_type = type_for_mode (part_mode, 0);
|
||||
tree part_type = (*lang_hooks.types.type_for_mode) (part_mode, 0);
|
||||
rtx lopart = XEXP (reg, 0);
|
||||
rtx hipart = XEXP (reg, 1);
|
||||
#ifdef FRAME_GROWS_DOWNWARD
|
||||
|
|
|
@ -1,3 +1,14 @@
|
|||
2002-03-29 Neil Booth <neil@daikokuya.demon.co.uk>
|
||||
|
||||
* Make-lang.in (builtins.o): Update.
|
||||
* boehm.c (get_boehm_type_descriptor): Update.
|
||||
* builtins.c: Include langhooks.h.
|
||||
* decl.c (java_init_decl_processing): Update.
|
||||
* java-tree.h (java_type_for_mode, java_type_for_size): New.
|
||||
* lang.c (LANG_HOOKS_TYPE_FOR_MODE, LANG_HOOKS_TYPE_FOR_SIaZE):
|
||||
Redefine.
|
||||
* typeck.c (type_for_mode, type_for_size): Update.
|
||||
|
||||
2002-03-29 Martin Kahlert <martin.kahlert@infineon.com>
|
||||
|
||||
* lex.c (java_new_lexer): Alias "646" to DEFAULT_ENCODING.
|
||||
|
|
|
@ -261,7 +261,7 @@ java/boehm.o: java/boehm.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(JAVA_TREE_H) \
|
|||
java/parse.h toplev.h
|
||||
java/buffer.o: java/buffer.c $(CONFIG_H) java/buffer.h $(SYSTEM_H) toplev.h
|
||||
java/builtins.o: java/builtins.c $(CONFIG_H) $(SYSTEM_H) $(JAVA_TREE_H) \
|
||||
$(GGC_H) flags.h
|
||||
$(GGC_H) flags.h builtin-types.def langhooks.h
|
||||
java/check-init.o: java/check-init.c $(CONFIG_H) \
|
||||
$(JAVA_TREE_H) $(SYSTEM_H) toplev.h
|
||||
java/class.o: java/class.c $(CONFIG_H) $(JAVA_TREE_H) $(RTL_H) java/jcf.h \
|
||||
|
|
|
@ -230,6 +230,6 @@ get_boehm_type_descriptor (tree type)
|
|||
value = build_int_2 (2, 0);
|
||||
}
|
||||
|
||||
TREE_TYPE (value) = type_for_mode (ptr_mode, 1);
|
||||
TREE_TYPE (value) = java_type_for_mode (ptr_mode, 1);
|
||||
return value;
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */
|
|||
#include "tree.h"
|
||||
#include "ggc.h"
|
||||
#include "flags.h"
|
||||
|
||||
#include "langhooks.h"
|
||||
#include "java-tree.h"
|
||||
|
||||
enum builtin_type
|
||||
|
|
|
@ -441,7 +441,7 @@ java_init_decl_processing ()
|
|||
set_sizetype (make_unsigned_type (POINTER_SIZE));
|
||||
|
||||
/* Define these next since types below may used them. */
|
||||
integer_type_node = type_for_size (INT_TYPE_SIZE, 0);
|
||||
integer_type_node = java_type_for_size (INT_TYPE_SIZE, 0);
|
||||
integer_zero_node = build_int_2 (0, 0);
|
||||
integer_one_node = build_int_2 (1, 0);
|
||||
integer_two_node = build_int_2 (2, 0);
|
||||
|
|
|
@ -1039,6 +1039,8 @@ struct lang_type
|
|||
extern void java_set_yydebug PARAMS ((int));
|
||||
extern void java_parse_file PARAMS ((void));
|
||||
extern void java_mark_tree PARAMS ((tree));
|
||||
extern tree java_type_for_mode PARAMS ((enum machine_mode, int));
|
||||
extern tree java_type_for_size PARAMS ((unsigned int, int));
|
||||
extern void add_assume_compiled PARAMS ((const char *, int));
|
||||
extern tree lookup_class PARAMS ((tree));
|
||||
extern tree lookup_java_constructor PARAMS ((tree, tree));
|
||||
|
|
|
@ -231,6 +231,10 @@ static int dependency_tracking = 0;
|
|||
#define LANG_HOOKS_DUP_LANG_SPECIFIC_DECL java_dup_lang_specific_decl
|
||||
#undef LANG_HOOKS_DECL_PRINTABLE_NAME
|
||||
#define LANG_HOOKS_DECL_PRINTABLE_NAME lang_printable_name
|
||||
#undef LANG_HOOKS_TYPE_FOR_MODE
|
||||
#define LANG_HOOKS_TYPE_FOR_MODE java_type_for_mode
|
||||
#undef LANG_HOOKS_TYPE_FOR_SIZE
|
||||
#define LANG_HOOKS_TYPE_FOR_SIZE java_type_for_size
|
||||
|
||||
/* Each front end provides its own. */
|
||||
const struct lang_hooks lang_hooks = LANG_HOOKS_INITIALIZER;
|
||||
|
|
|
@ -183,7 +183,7 @@ incomplete_type_error (value, type)
|
|||
then UNSIGNEDP selects between signed and unsigned types. */
|
||||
|
||||
tree
|
||||
type_for_mode (mode, unsignedp)
|
||||
java_type_for_mode (mode, unsignedp)
|
||||
enum machine_mode mode;
|
||||
int unsignedp;
|
||||
{
|
||||
|
@ -207,7 +207,7 @@ type_for_mode (mode, unsignedp)
|
|||
that is unsigned if UNSIGNEDP is nonzero, otherwise signed. */
|
||||
|
||||
tree
|
||||
type_for_size (bits, unsignedp)
|
||||
java_type_for_size (bits, unsignedp)
|
||||
unsigned bits;
|
||||
int unsignedp;
|
||||
{
|
||||
|
|
|
@ -145,11 +145,14 @@ int lhd_tree_dump_type_quals PARAMS ((tree));
|
|||
LANG_HOOKS_TREE_DUMP_TYPE_QUALS_FN \
|
||||
}
|
||||
|
||||
/* Types hooks. */
|
||||
/* Types hooks. No default for LANG_HOOKS_TYPE_FOR_MODE or
|
||||
LANG_HOOKS_TYPE_FOR_SIZE. */
|
||||
#define LANG_HOOKS_MAKE_TYPE make_node
|
||||
|
||||
#define LANG_HOOKS_FOR_TYPES_INITIALIZER { \
|
||||
LANG_HOOKS_MAKE_TYPE \
|
||||
LANG_HOOKS_MAKE_TYPE, \
|
||||
LANG_HOOKS_TYPE_FOR_MODE, \
|
||||
LANG_HOOKS_TYPE_FOR_SIZE \
|
||||
}
|
||||
|
||||
/* Declaration hooks. */
|
||||
|
|
|
@ -71,7 +71,17 @@ struct lang_hooks_for_tree_dump
|
|||
|
||||
struct lang_hooks_for_types
|
||||
{
|
||||
/* Return a new type (with the indicated CODE), doing whatever
|
||||
language-specific processing is required. */
|
||||
tree (*make_type) PARAMS ((enum tree_code));
|
||||
|
||||
/* Given MODE and UNSIGNEDP, return a suitable type-tree with that
|
||||
mode. */
|
||||
tree (*type_for_mode) PARAMS ((enum machine_mode, int));
|
||||
|
||||
/* Given PRECISION and UNSIGNEDP, return a suitable type-tree for an
|
||||
integer type with at least that precision. */
|
||||
tree (*type_for_size) PARAMS ((unsigned, int));
|
||||
};
|
||||
|
||||
/* Language hooks related to decls and the symbol table. */
|
||||
|
|
|
@ -8306,7 +8306,7 @@ handle_impent (impent)
|
|||
tree decl, init;
|
||||
|
||||
init = build_int_2 (0, 0);
|
||||
TREE_TYPE (init) = type_for_size (BITS_PER_WORD, 1);
|
||||
TREE_TYPE (init) = c_common_type_for_size (BITS_PER_WORD, 1);
|
||||
decl = build_decl (VAR_DECL, get_identifier (string), TREE_TYPE (init));
|
||||
TREE_PUBLIC (decl) = 1;
|
||||
TREE_READONLY (decl) = 1;
|
||||
|
|
|
@ -76,6 +76,11 @@ static void objc_post_options PARAMS ((void));
|
|||
#define LANG_HOOKS_TREE_INLINING_CONVERT_PARM_FOR_INLINING \
|
||||
c_convert_parm_for_inlining
|
||||
|
||||
#undef LANG_HOOKS_TYPE_FOR_MODE
|
||||
#define LANG_HOOKS_TYPE_FOR_MODE c_common_type_for_mode
|
||||
#undef LANG_HOOKS_TYPE_FOR_SIZE
|
||||
#define LANG_HOOKS_TYPE_FOR_SIZE c_common_type_for_size
|
||||
|
||||
/* Each front end provides its own hooks, for toplev.c. */
|
||||
const struct lang_hooks lang_hooks = LANG_HOOKS_INITIALIZER;
|
||||
|
||||
|
|
|
@ -4115,7 +4115,8 @@ expand_decl_cleanup (decl, cleanup)
|
|||
|
||||
emit_move_insn (flag, const1_rtx);
|
||||
|
||||
cond = build_decl (VAR_DECL, NULL_TREE, type_for_mode (word_mode, 1));
|
||||
cond = build_decl (VAR_DECL, NULL_TREE,
|
||||
(*lang_hooks.types.type_for_mode) (word_mode, 1));
|
||||
SET_DECL_RTL (cond, flag);
|
||||
|
||||
/* Conditionalize the cleanup. */
|
||||
|
@ -6310,7 +6311,7 @@ emit_case_nodes (index, node, default_label, index_type)
|
|||
else if (!low_bound && !high_bound)
|
||||
{
|
||||
/* Widen LOW and HIGH to the same width as INDEX. */
|
||||
tree type = type_for_mode (mode, unsignedp);
|
||||
tree type = (*lang_hooks.types.type_for_mode) (mode, unsignedp);
|
||||
tree low = build1 (CONVERT_EXPR, type, node->low);
|
||||
tree high = build1 (CONVERT_EXPR, type, node->high);
|
||||
rtx low_rtx, new_index, new_bound;
|
||||
|
|
10
gcc/tree.c
10
gcc/tree.c
|
@ -4024,8 +4024,8 @@ get_unwidened (op, for_type)
|
|||
{
|
||||
unsigned int innerprec
|
||||
= tree_low_cst (DECL_SIZE (TREE_OPERAND (op, 1)), 1);
|
||||
|
||||
type = type_for_size (innerprec, TREE_UNSIGNED (TREE_OPERAND (op, 1)));
|
||||
int unsignedp = TREE_UNSIGNED (TREE_OPERAND (op, 1));
|
||||
type = (*lang_hooks.types.type_for_size) (innerprec, unsignedp);
|
||||
|
||||
/* We can get this structure field in the narrowest type it fits in.
|
||||
If FOR_TYPE is 0, do this only for a field that matches the
|
||||
|
@ -4035,8 +4035,7 @@ get_unwidened (op, for_type)
|
|||
|
||||
if (innerprec < TYPE_PRECISION (TREE_TYPE (op))
|
||||
&& (for_type || ! DECL_BIT_FIELD (TREE_OPERAND (op, 1)))
|
||||
&& (! uns || final_prec <= innerprec
|
||||
|| TREE_UNSIGNED (TREE_OPERAND (op, 1)))
|
||||
&& (! uns || final_prec <= innerprec || unsignedp)
|
||||
&& type != 0)
|
||||
{
|
||||
win = build (COMPONENT_REF, type, TREE_OPERAND (op, 0),
|
||||
|
@ -4110,7 +4109,8 @@ get_narrower (op, unsignedp_ptr)
|
|||
{
|
||||
unsigned HOST_WIDE_INT innerprec
|
||||
= tree_low_cst (DECL_SIZE (TREE_OPERAND (op, 1)), 1);
|
||||
tree type = type_for_size (innerprec, TREE_UNSIGNED (op));
|
||||
tree type = (*lang_hooks.types.type_for_size) (innerprec,
|
||||
TREE_UNSIGNED (op));
|
||||
|
||||
/* We can get this structure field in a narrower type that fits it,
|
||||
but the resulting extension to its nominal type (a fullword type)
|
||||
|
|
14
gcc/tree.h
14
gcc/tree.h
|
@ -2611,20 +2611,6 @@ extern tree get_unwidened PARAMS ((tree, tree));
|
|||
|
||||
extern tree get_narrower PARAMS ((tree, int *));
|
||||
|
||||
/* Given MODE and UNSIGNEDP, return a suitable type-tree
|
||||
with that mode.
|
||||
The definition of this resides in language-specific code
|
||||
as the repertoire of available types may vary. */
|
||||
|
||||
extern tree type_for_mode PARAMS ((enum machine_mode, int));
|
||||
|
||||
/* Given PRECISION and UNSIGNEDP, return a suitable type-tree
|
||||
for an integer type with at least that precision.
|
||||
The definition of this resides in language-specific code
|
||||
as the repertoire of available types may vary. */
|
||||
|
||||
extern tree type_for_size PARAMS ((unsigned, int));
|
||||
|
||||
/* Given an integer type T, return a type like T but unsigned.
|
||||
If T is unsigned, the value is T.
|
||||
The definition of this resides in language-specific code
|
||||
|
|
|
@ -3799,7 +3799,8 @@ force_const_mem (mode, x)
|
|||
/* Align the location counter as required by EXP's data type. */
|
||||
align = GET_MODE_ALIGNMENT (mode == VOIDmode ? word_mode : mode);
|
||||
#ifdef CONSTANT_ALIGNMENT
|
||||
align = CONSTANT_ALIGNMENT (make_tree (type_for_mode (mode, 0), x), align);
|
||||
align = CONSTANT_ALIGNMENT (make_tree ((*lang_hooks.types.type_for_mode)
|
||||
(mode, 0), x), align);
|
||||
#endif
|
||||
|
||||
pool_offset += (align / BITS_PER_UNIT) - 1;
|
||||
|
@ -3837,7 +3838,7 @@ force_const_mem (mode, x)
|
|||
pool->desc->rtl = def
|
||||
= gen_rtx_MEM (mode, gen_rtx_SYMBOL_REF (Pmode, ggc_strdup (label)));
|
||||
set_mem_alias_set (def, const_alias_set);
|
||||
set_mem_attributes (def, type_for_mode (mode, 0), 1);
|
||||
set_mem_attributes (def, (*lang_hooks.types.type_for_mode) (mode, 0), 1);
|
||||
RTX_UNCHANGING_P (def) = 1;
|
||||
|
||||
/* Add label to symbol hash table. */
|
||||
|
|
Loading…
Add table
Reference in a new issue