* combine.c (record_value_for_reg): Change 0 to VOIDmode, twice.
(record_dead_and_set_regs): Likewise.
* df.h (struct df_mw_hardreg): Change flags field to int.
(struct df_base_ref): Likewise.
(struct df): Change changeable_flags field to int.
* df-scan.c (df_defs_record): Change clobber_flags to int.
* dwarf2.h (enum dwarf_tag): Make lo_user and hi_user values enum
constants rather than #define macros.
(enum dwarf_attribute, enum dwarf_location_atom): Likewise.
(enum dwarf_type, enum dwarf_endianity_encoding): Likewise.
(enum dwarf_calling_convention): Likewise.
(enum dwarf_line_number_x_ops): Likewise.
(enum dwarf_call_frame_info): Likewise.
(enum dwarf_source_language): Likewise.
* dwarf2out.c (int_loc_descriptor): Add cast to enum type.
(add_calling_convention_attribute): Likewise.
* fold-const.c (fold_undefer_overflow_warnings): Add cast to enum
type.
(combine_comparisons): Change compcode to int. Add cast to enum
type.
* genrecog.c (maybe_both_true_2): Change c to int.
(write_switch): Likewise. Add cast to enum type.
* gimplify.c (gimplify_omp_for): Handle return values from
gimplify_expr using MIN rather than bitwise or.
(gimplify_expr): Add cast to enum type.
* ipa-prop.c (update_jump_functions_after_inlining): Change
IPA_BOTTOM to IPA_JF_UNKNOWN.
* ira.c (setup_class_subset_and_memory_move_costs): Change mode to
int. Add casts to enum type.
(setup_cover_and_important_classes): Change cl to int. Add casts
to enum type.
(setup_class_translate): Change cl and mode to int.
(ira_init_once): Change mode to int.
(free_register_move_costs): Likewise.
(setup_prohibited_mode_move_regs): Add casts to enum type.
* langhooks.c (add_builtin_function_common): Rework assertion that
value fits bitfield.
* mcf.c (add_fixup_edge): Change type parameter to edge_type.
* omega.c (omega_do_elimination): Avoid math on enum types.
* optabs.c (expand_vec_shift_expr): Remove casts to int.
* opts.c (set_debug_level): Change 2 to enum constant. Use new
int local to handle integral_argment value.
* regmove.c (try_auto_increment): Change PUT_MODE to
PUT_REG_NOTE_KIND.
* reload.c (push_secondary_reload): Add casts to enum type.
(secondary_reload_class, find_valid_class): Likewise.
* reload1.c (emit_input_reload_insns): Likewise.
* rtl.h (NOTE_VAR_LOCATION_STATUS): Likewise.
* sel-sched.c (init_hard_regs_data): Change cur_mode to int.
* sel-sched-ir.c (hash_with_unspec_callback): Change 0 to enum
constant.
* tree.c (build_common_builtin_nodes): Add casts to enum type.
* tree-complex.c (complex_lattice_t): Typedef to int rather than
enum type.
(expand_complex_libcall): Add casts to enum type.
* tree-into-ssa.c (get_ssa_name_ann): Change 0 to enum constant.
* tree-vect-loop.c (vect_model_reduction_cost): Compare reduc_code
with ERROR_MARK, not NUM_TREE_CODES.
(vect_create_epilog_for_reduction): Likewise.
(vectorizable_reduction): Don't initialize epiloc_reduc_code.
When not using it, set it to ERROR_MARK rather than
NUM_TREE_CODES.
* tree-vect-patterns.c (vect_pattern_recog_1): Change vec_mode to
enum machine_mode.
* tree-vect-stmts.c (new_stmt_vec_info): Change 0 to
vect_unused_in_loop. Change 0 to loop_vect.
* tree-vectorizer.c (vect_set_verbosity_level): Add casts to enum
type.
* var-tracking.c (get_init_value): Change return type to enum
var_init_status.
* vec.h (DEF_VEC_FUNC_P) [iterate]: Cast 0 to type T.
* config/arm/arm.c (fp_model_for_fpu): Change to array to enum
arm_fp_model.
(arm_override_options): Add casts to enum type.
(arm_emit_tls_decoration): Likewise.
* config/i386/i386.c (ix86_function_specific_restore): Add casts
to enum type.
* config/i386/i386-c.c (ix86_pragma_target_parse): Likewise.
* config/ia64/ia64.c (ia64_expand_compare): Change magic to int.
* config/rs6000/rs6000.c (rs6000_override_options): Add casts to
enum type.
* config/s390/s390.c (code_for_builtin_64): Change to array of
enum insn_code.
(code_for_builtin_31): Likewise.
(s390_expand_builtin): Change code_for_builtin to enum insn_code
const *.
* config/sparc/sparc.c (sparc_override_options): Change value
field in struct code_model to enum cmodel. In initializer change
0 to NULL and add cast to enum type.
* c-typeck.c (build_modify_expr): Add lhs_origtype parameter.
Change all callers. Issue a -Wc++-compat warning using
lhs_origtype if necessary.
(convert_for_assignment): Issue -Wc++-compat warnings about
invalid conversions to enum type on assignment.
* c-common.h (build_modify_expr): Update declaration.
gcc/cp/:
* call.c (build_temp): Change 0 to enum constant.
* cp-tree.h (cp_lvalue_kind): Typedef to int rather than enum
type.
* cp-gimplify.c (cp_gimplify_expr): Add cast to enum type.
* decl2.c (constrain_visibility): Likewise.
* parser.c (cp_lexer_get_preprocessor_token): Likewise.
(cp_parser_flags): Typedef to int rather than enum type.
(cp_parser_expression_stack_entry): Change prec field to enum
cp_parser_prec.
* typeck.c (build_modify_expr): Add lhs_origtype parameter.
Change all callers.
gcc/fortran/:
* gfortran.h (enum gfc_symbol_type): New named enum type, broken
out of struct gfc_symbol.
(struct gfc_symbol): Use enum gfc_symbol_type.
(enum gfc_array_ref_dimen_type): New named enum type, broken out
of struct gfc_array_ref).
(struct gfc_array_ref): Use enum gfc_array_ref_dimen_type.
(mod_pointee_as): Update declaration.
* decl.c (add_global_entry): Change type to enum gfc_symbol_type.
(gfc_mod_pointee_as): Change return type to "match".
* module.c (mio_array_ref): Add cast to enum type.
(mio_symbol): Likewise.
* resolve.c (resolve_global_procedure): Change type to enum
gfc_symbol_type.
* trans-io.c (gfc_build_st_parameter): Change type to unsigned
int.
gcc/java/:
* jcf-parse.c (handle_constant): Add cast to enum type.
gcc/objc/:
* objc-act.c (get_super_receiver): Update calls to
build_modify_expr to pass new argument.
gcc/testsuite/:
* gcc.dg/Wcxx-compat-4.c: New testcase.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@146735
138bc75d-0d04-0410-961f-
82ee72b054a4
+2009-04-24 Ian Lance Taylor <iant@google.com>
+
+ * combine.c (record_value_for_reg): Change 0 to VOIDmode, twice.
+ (record_dead_and_set_regs): Likewise.
+ * df.h (struct df_mw_hardreg): Change flags field to int.
+ (struct df_base_ref): Likewise.
+ (struct df): Change changeable_flags field to int.
+ * df-scan.c (df_defs_record): Change clobber_flags to int.
+ * dwarf2.h (enum dwarf_tag): Make lo_user and hi_user values enum
+ constants rather than #define macros.
+ (enum dwarf_attribute, enum dwarf_location_atom): Likewise.
+ (enum dwarf_type, enum dwarf_endianity_encoding): Likewise.
+ (enum dwarf_calling_convention): Likewise.
+ (enum dwarf_line_number_x_ops): Likewise.
+ (enum dwarf_call_frame_info): Likewise.
+ (enum dwarf_source_language): Likewise.
+ * dwarf2out.c (int_loc_descriptor): Add cast to enum type.
+ (add_calling_convention_attribute): Likewise.
+ * fold-const.c (fold_undefer_overflow_warnings): Add cast to enum
+ type.
+ (combine_comparisons): Change compcode to int. Add cast to enum
+ type.
+ * genrecog.c (maybe_both_true_2): Change c to int.
+ (write_switch): Likewise. Add cast to enum type.
+ * gimplify.c (gimplify_omp_for): Handle return values from
+ gimplify_expr using MIN rather than bitwise or.
+ (gimplify_expr): Add cast to enum type.
+ * ipa-prop.c (update_jump_functions_after_inlining): Change
+ IPA_BOTTOM to IPA_JF_UNKNOWN.
+ * ira.c (setup_class_subset_and_memory_move_costs): Change mode to
+ int. Add casts to enum type.
+ (setup_cover_and_important_classes): Change cl to int. Add casts
+ to enum type.
+ (setup_class_translate): Change cl and mode to int.
+ (ira_init_once): Change mode to int.
+ (free_register_move_costs): Likewise.
+ (setup_prohibited_mode_move_regs): Add casts to enum type.
+ * langhooks.c (add_builtin_function_common): Rework assertion that
+ value fits bitfield.
+ * mcf.c (add_fixup_edge): Change type parameter to edge_type.
+ * omega.c (omega_do_elimination): Avoid math on enum types.
+ * optabs.c (expand_vec_shift_expr): Remove casts to int.
+ * opts.c (set_debug_level): Change 2 to enum constant. Use new
+ int local to handle integral_argment value.
+ * regmove.c (try_auto_increment): Change PUT_MODE to
+ PUT_REG_NOTE_KIND.
+ * reload.c (push_secondary_reload): Add casts to enum type.
+ (secondary_reload_class, find_valid_class): Likewise.
+ * reload1.c (emit_input_reload_insns): Likewise.
+ * rtl.h (NOTE_VAR_LOCATION_STATUS): Likewise.
+ * sel-sched.c (init_hard_regs_data): Change cur_mode to int.
+ * sel-sched-ir.c (hash_with_unspec_callback): Change 0 to enum
+ constant.
+ * tree.c (build_common_builtin_nodes): Add casts to enum type.
+ * tree-complex.c (complex_lattice_t): Typedef to int rather than
+ enum type.
+ (expand_complex_libcall): Add casts to enum type.
+ * tree-into-ssa.c (get_ssa_name_ann): Change 0 to enum constant.
+ * tree-vect-loop.c (vect_model_reduction_cost): Compare reduc_code
+ with ERROR_MARK, not NUM_TREE_CODES.
+ (vect_create_epilog_for_reduction): Likewise.
+ (vectorizable_reduction): Don't initialize epiloc_reduc_code.
+ When not using it, set it to ERROR_MARK rather than
+ NUM_TREE_CODES.
+ * tree-vect-patterns.c (vect_pattern_recog_1): Change vec_mode to
+ enum machine_mode.
+ * tree-vect-stmts.c (new_stmt_vec_info): Change 0 to
+ vect_unused_in_loop. Change 0 to loop_vect.
+ * tree-vectorizer.c (vect_set_verbosity_level): Add casts to enum
+ type.
+ * var-tracking.c (get_init_value): Change return type to enum
+ var_init_status.
+ * vec.h (DEF_VEC_FUNC_P) [iterate]: Cast 0 to type T.
+ * config/arm/arm.c (fp_model_for_fpu): Change to array to enum
+ arm_fp_model.
+ (arm_override_options): Add casts to enum type.
+ (arm_emit_tls_decoration): Likewise.
+ * config/i386/i386.c (ix86_function_specific_restore): Add casts
+ to enum type.
+ * config/i386/i386-c.c (ix86_pragma_target_parse): Likewise.
+ * config/ia64/ia64.c (ia64_expand_compare): Change magic to int.
+ * config/rs6000/rs6000.c (rs6000_override_options): Add casts to
+ enum type.
+ * config/s390/s390.c (code_for_builtin_64): Change to array of
+ enum insn_code.
+ (code_for_builtin_31): Likewise.
+ (s390_expand_builtin): Change code_for_builtin to enum insn_code
+ const *.
+ * config/sparc/sparc.c (sparc_override_options): Change value
+ field in struct code_model to enum cmodel. In initializer change
+ 0 to NULL and add cast to enum type.
+
+ * c-typeck.c (build_modify_expr): Add lhs_origtype parameter.
+ Change all callers. Issue a -Wc++-compat warning using
+ lhs_origtype if necessary.
+ (convert_for_assignment): Issue -Wc++-compat warnings about
+ invalid conversions to enum type on assignment.
+ * c-common.h (build_modify_expr): Update declaration.
+
2009-04-24 Nick Clifton <nickc@redhat.com>
* config/iq2000/iq2000.c (function_arg): Handle TImode values.
extern void push_cleanup (tree, tree, bool);
extern tree pushdecl_top_level (tree);
extern tree pushdecl (tree);
-extern tree build_modify_expr (location_t, tree, enum tree_code, tree, tree);
+extern tree build_modify_expr (location_t, tree, tree, enum tree_code,
+ tree, tree);
extern tree build_indirect_ref (location_t, tree, const char *);
extern int c_expand_decl (tree);
/* There are lots of warnings, errors, and conversions that need to happen
in the course of interpreting a statement. Use the normal mechanisms
to do this, and then take it apart again. */
- x = build_modify_expr (input_location, lhs, code, rhs, NULL_TREE);
+ x = build_modify_expr (input_location, lhs, NULL_TREE, code, rhs, NULL_TREE);
if (x == error_mark_node)
return error_mark_node;
gcc_assert (TREE_CODE (x) == MODIFY_EXPR);
fail = true;
}
- init = build_modify_expr (elocus, decl, NOP_EXPR, init, NULL_TREE);
+ init = build_modify_expr (elocus, decl, NULL_TREE, NOP_EXPR, init,
+ NULL_TREE);
}
gcc_assert (TREE_CODE (init) == MODIFY_EXPR);
gcc_assert (TREE_OPERAND (init, 0) == decl);
c_parser_consume_token (parser);
rhs = c_parser_expr_no_commas (parser, NULL);
rhs = default_function_array_conversion (rhs);
- ret.value = build_modify_expr (op_location, lhs.value, code, rhs.value,
- rhs.original_type);
+ ret.value = build_modify_expr (op_location, lhs.value, lhs.original_type,
+ code, rhs.value, rhs.original_type);
if (code == NOP_EXPR)
ret.original_code = MODIFY_EXPR;
else
else if (c_parser_next_token_is (parser, CPP_NAME)
&& c_parser_peek_2nd_token (parser)->type == CPP_EQ)
{
+ struct c_expr decl_exp;
struct c_expr init_exp;
location_t init_loc;
- decl = c_parser_postfix_expression (parser).value;
+ decl_exp = c_parser_postfix_expression (parser);
+ decl = decl_exp.value;
c_parser_require (parser, CPP_EQ, "expected %<=%>");
init_loc = c_parser_peek_token (parser)->location;
init_exp = c_parser_expr_no_commas (parser, NULL);
init_exp = default_function_array_conversion (init_exp);
- init = build_modify_expr (init_loc,
- decl, NOP_EXPR, init_exp.value,
+ init = build_modify_expr (init_loc, decl, decl_exp.original_type,
+ NOP_EXPR, init_exp.value,
init_exp.original_type);
init = c_process_expr_stmt (init);
}
\f
/* Build an assignment expression of lvalue LHS from value RHS.
+ If LHS_ORIGTYPE is not NULL, it is the original type of LHS, which
+ may differ from TREE_TYPE (LHS) for an enum bitfield.
MODIFYCODE is the code for a binary operator that we use
to combine the old value of LHS with RHS to get the new value.
Or else MODIFYCODE is NOP_EXPR meaning do a simple assignment.
LOCATION is the location of the MODIFYCODE operator. */
tree
-build_modify_expr (location_t location,
- tree lhs, enum tree_code modifycode, tree rhs,
- tree rhs_origtype)
+build_modify_expr (location_t location, tree lhs, tree lhs_origtype,
+ enum tree_code modifycode, tree rhs, tree rhs_origtype)
{
tree result;
tree newrhs;
if (TREE_CODE (lhs) == C_MAYBE_CONST_EXPR)
{
tree inner = build_modify_expr (location, C_MAYBE_CONST_EXPR_EXPR (lhs),
- modifycode, rhs, rhs_origtype);
+ lhs_origtype, modifycode, rhs,
+ rhs_origtype);
if (inner == error_mark_node)
return error_mark_node;
result = build2 (C_MAYBE_CONST_EXPR, TREE_TYPE (inner),
TREE_TYPE (lhs) = lhstype;
}
+ /* Issue -Wc++-compat warnings about an assignment to an enum type
+ when LHS does not have its original type. This happens for,
+ e.g., an enum bitfield in a struct. */
+ if (warn_cxx_compat
+ && lhs_origtype != NULL_TREE
+ && lhs_origtype != lhstype
+ && TREE_CODE (lhs_origtype) == ENUMERAL_TYPE)
+ {
+ tree checktype = (rhs_origtype != NULL_TREE
+ ? rhs_origtype
+ : TREE_TYPE (rhs));
+ if (checktype != error_mark_node
+ && TYPE_MAIN_VARIANT (checktype) != TYPE_MAIN_VARIANT (lhs_origtype))
+ warning_at (location, OPT_Wc___compat,
+ "enum conversion in assignment is invalid in C++");
+ }
+
/* Convert new value to destination type. Fold it first, then
restore any excess precision information, for the sake of
conversion warnings. */
&& TYPE_MAIN_VARIANT (checktype) != TYPE_MAIN_VARIANT (type))
{
/* FIXME: Until the gcc source code is converted, we only
- warn about parameter passing. We will add the other
- cases when bootstrap succeeds with them. */
- if (errtype == ic_argpass)
+ warn about assignment and parameter passing. We will add
+ the other cases when bootstrap succeeds with them. */
+ if (errtype == ic_argpass || errtype == ic_assign)
{
WARN_FOR_ASSIGNMENT (input_location, OPT_Wc___compat,
G_("enum conversion when passing argument "
rsp->last_set = insn;
rsp->last_set_value = 0;
- rsp->last_set_mode = 0;
+ rsp->last_set_mode = VOIDmode;
rsp->last_set_nonzero_bits = 0;
rsp->last_set_sign_bit_copies = 0;
rsp->last_death = 0;
- rsp->truncated_to_mode = 0;
+ rsp->truncated_to_mode = VOIDmode;
}
/* Mark registers that are being referenced in this value. */
rsp->last_set_invalid = 1;
rsp->last_set = insn;
rsp->last_set_value = 0;
- rsp->last_set_mode = 0;
+ rsp->last_set_mode = VOIDmode;
rsp->last_set_nonzero_bits = 0;
rsp->last_set_sign_bit_copies = 0;
rsp->last_death = 0;
- rsp->truncated_to_mode = 0;
+ rsp->truncated_to_mode = VOIDmode;
}
last_call_luid = mem_last_set = DF_INSN_LUID (insn);
/* Floating point models used by the different hardware.
See fputype in arm.h. */
-static const enum fputype fp_model_for_fpu[] =
+static const enum arm_fp_model fp_model_for_fpu[] =
{
/* No FP hardware. */
ARM_FP_MODEL_UNKNOWN, /* FPUTYPE_NONE */
const struct processors * sel;
unsigned int sought;
- selected_cpu = TARGET_CPU_DEFAULT;
+ selected_cpu = (enum processor_type) TARGET_CPU_DEFAULT;
if (selected_cpu == arm_none)
{
#ifdef SUBTARGET_CPU_DEFAULT
/* Use the subtarget default CPU if none was specified by
configure. */
- selected_cpu = SUBTARGET_CPU_DEFAULT;
+ selected_cpu = (enum processor_type) SUBTARGET_CPU_DEFAULT;
#endif
/* Default to ARM6. */
if (selected_cpu == arm_none)
rtx val;
val = XVECEXP (x, 0, 0);
- reloc = INTVAL (XVECEXP (x, 0, 1));
+ reloc = (enum tls_reloc) INTVAL (XVECEXP (x, 0, 1));
output_addr_const (fp, val);
prev_isa = prev_opt->ix86_isa_flags;
cur_isa = cur_opt->ix86_isa_flags;
diff_isa = (prev_isa ^ cur_isa);
- prev_arch = prev_opt->arch;
- prev_tune = prev_opt->tune;
- cur_arch = cur_opt->arch;
- cur_tune = cur_opt->tune;
+ prev_arch = (enum processor_type) prev_opt->arch;
+ prev_tune = (enum processor_type) prev_opt->tune;
+ cur_arch = (enum processor_type) cur_opt->arch;
+ cur_tune = (enum processor_type) cur_opt->tune;
/* If the same processor is used for both previous and current options, don't
change the macros. */
unsigned int ix86_arch_mask, ix86_tune_mask;
int i;
- ix86_arch = ptr->arch;
- ix86_schedule = ptr->schedule;
- ix86_tune = ptr->tune;
- ix86_fpmath = ptr->fpmath;
+ ix86_arch = (enum processor_type) ptr->arch;
+ ix86_schedule = (enum attr_cpu) ptr->schedule;
+ ix86_tune = (enum processor_type) ptr->tune;
+ ix86_fpmath = (enum fpmath_unit) ptr->fpmath;
ix86_branch_cost = ptr->branch_cost;
ix86_tune_defaulted = ptr->tune_defaulted;
ix86_arch_specified = ptr->arch_specified;
QCMP_EQ = 4,
QCMP_LT = 8,
QCMP_GT = 16
- } magic;
+ };
+ int magic;
enum rtx_code ncode;
rtx ret, insns;
else if (! strcmp (rs6000_sched_costly_dep_str, "store_to_load"))
rs6000_sched_costly_dep = store_to_load_dep_costly;
else
- rs6000_sched_costly_dep = atoi (rs6000_sched_costly_dep_str);
+ rs6000_sched_costly_dep = ((enum rs6000_dependence_cost)
+ atoi (rs6000_sched_costly_dep_str));
}
/* Handle -minsert-sched-nops option. */
else if (! strcmp (rs6000_sched_insert_nops_str, "regroup_exact"))
rs6000_sched_insert_nops = sched_finish_regroup_exact;
else
- rs6000_sched_insert_nops = atoi (rs6000_sched_insert_nops_str);
+ rs6000_sched_insert_nops = ((enum rs6000_nop_insertion)
+ atoi (rs6000_sched_insert_nops_str));
}
#ifdef TARGET_REGNAMES
S390_BUILTIN_max
};
-static unsigned int const code_for_builtin_64[S390_BUILTIN_max] = {
+static enum insn_code const code_for_builtin_64[S390_BUILTIN_max] = {
CODE_FOR_get_tp_64,
CODE_FOR_set_tp_64
};
-static unsigned int const code_for_builtin_31[S390_BUILTIN_max] = {
+static enum insn_code const code_for_builtin_31[S390_BUILTIN_max] = {
CODE_FOR_get_tp_31,
CODE_FOR_set_tp_31
};
{
#define MAX_ARGS 2
- unsigned int const *code_for_builtin =
+ enum insn_code const *code_for_builtin =
TARGET_64BIT ? code_for_builtin_64 : code_for_builtin_31;
tree fndecl = TREE_OPERAND (CALL_EXPR_FN (exp), 0);
{
static struct code_model {
const char *const name;
- const int value;
+ const enum cmodel value;
} const cmodels[] = {
{ "32", CM_32 },
{ "medlow", CM_MEDLOW },
{ "medmid", CM_MEDMID },
{ "medany", CM_MEDANY },
{ "embmedany", CM_EMBMEDANY },
- { 0, 0 }
+ { NULL, (enum cmodel) 0 }
};
const struct code_model *cmodel;
/* Map TARGET_CPU_DEFAULT to value for -m{arch,tune}=. */
+2009-04-24 Ian Lance Taylor <iant@google.com>
+
+ * call.c (build_temp): Change 0 to enum constant.
+ * cp-tree.h (cp_lvalue_kind): Typedef to int rather than enum
+ type.
+ * cp-gimplify.c (cp_gimplify_expr): Add cast to enum type.
+ * decl2.c (constrain_visibility): Likewise.
+ * parser.c (cp_lexer_get_preprocessor_token): Likewise.
+ (cp_parser_flags): Typedef to int rather than enum type.
+ (cp_parser_expression_stack_entry): Change prec field to enum
+ cp_parser_prec.
+
+ * typeck.c (build_modify_expr): Add lhs_origtype parameter.
+ Change all callers.
+
2009-04-22 Dodji Seketeli <dodji@redhat.com>
PR c++/39639
else if (errorcount > savee)
*diagnostic_kind = DK_ERROR;
else
- *diagnostic_kind = 0;
+ *diagnostic_kind = DK_UNSPECIFIED;
return expr;
}
break;
default:
- ret = c_gimplify_expr (expr_p, pre_p, post_p);
+ ret = (enum gimplify_status) c_gimplify_expr (expr_p, pre_p, post_p);
break;
}
};
/* The various kinds of lvalues we distinguish. */
-typedef enum cp_lvalue_kind {
+enum cp_lvalue_kind {
clk_none = 0, /* Things that are not an lvalue. */
clk_ordinary = 1, /* An ordinary lvalue. */
clk_class = 2, /* An rvalue of class-type. */
clk_bitfield = 4, /* An lvalue for a bit-field. */
clk_packed = 8 /* An lvalue for a packed field. */
-} cp_lvalue_kind;
+};
+
+/* This type is used for parameters and variables which hold
+ combinations of the flags in enum cp_lvalue_kind. */
+typedef int cp_lvalue_kind;
/* Various kinds of template specialization, instantiation, etc. */
typedef enum tmpl_spec_kind {
else if (visibility > DECL_VISIBILITY (decl)
&& !DECL_VISIBILITY_SPECIFIED (decl))
{
- DECL_VISIBILITY (decl) = visibility;
+ DECL_VISIBILITY (decl) = (enum symbol_visibility) visibility;
return true;
}
return false;
else if (token->type == CPP_PRAGMA)
{
/* We smuggled the cpp_token->u.pragma value in an INTEGER_CST. */
- token->pragma_kind = TREE_INT_CST_LOW (token->u.value);
+ token->pragma_kind = ((enum pragma_kind)
+ TREE_INT_CST_LOW (token->u.value));
token->u.value = NULL_TREE;
}
}
/* Flags that are passed to some parsing functions. These values can
be bitwise-ored together. */
-typedef enum cp_parser_flags
+enum cp_parser_flags
{
/* No flags. */
CP_PARSER_FLAGS_NONE = 0x0,
CP_PARSER_FLAGS_OPTIONAL = 0x1,
/* When parsing a type-specifier, do not allow user-defined types. */
CP_PARSER_FLAGS_NO_USER_DEFINED_TYPES = 0x2
-} cp_parser_flags;
+};
+
+/* This type is used for parameters and variables which hold
+ combinations of the flags in enum cp_parser_flags. */
+typedef int cp_parser_flags;
/* The different kinds of declarators we want to parse. */
/* Tree code for the binary operation we are parsing. */
enum tree_code tree_type;
/* Precedence of the binary operation we are parsing. */
- int prec;
+ enum cp_parser_prec prec;
} cp_parser_expression_stack_entry;
/* The stack for storing partial expressions. We only need NUM_PREC_VALUES
cond = cp_build_binary_op (elocus,
TREE_CODE (cond), decl, diff,
tf_warning_or_error);
- incr = build_modify_expr (elocus, decl, PLUS_EXPR, incr, NULL_TREE);
+ incr = build_modify_expr (elocus, decl, NULL_TREE, PLUS_EXPR,
+ incr, NULL_TREE);
orig_body = *body;
*body = push_stmt_list ();
/* For use from the C common bits. */
tree
build_modify_expr (location_t location ATTRIBUTE_UNUSED,
- tree lhs, enum tree_code modifycode, tree rhs,
+ tree lhs, tree lhs_origtype ATTRIBUTE_UNUSED,
+ enum tree_code modifycode, tree rhs,
tree rhs_origtype ATTRIBUTE_UNUSED)
{
return cp_build_modify_expr (lhs, modifycode, rhs, tf_warning_or_error);
if (code == SET || code == CLOBBER)
{
/* Mark the single def within the pattern. */
- enum df_ref_flags clobber_flags = flags;
+ int clobber_flags = flags;
clobber_flags |= (code == CLOBBER) ? DF_REF_MUST_CLOBBER : 0;
df_def_record_1 (collection_rec, x, bb, insn_info, clobber_flags);
}
accesses to 16-bit fields will usually be quicker. */
ENUM_BITFIELD(df_ref_type) type : 16;
/* Used to see if the ref is read or write. */
- ENUM_BITFIELD(df_ref_flags) flags : 16;
- /* Various flags. */
+ int flags : 16; /* Various df_ref_flags. */
unsigned int start_regno; /* First word of the multi word subreg. */
unsigned int end_regno; /* Last word of the multi word subreg. */
unsigned int mw_order; /* Same as df_ref.ref_order. */
ENUM_BITFIELD(df_ref_type) type : 8;
/* Type of ref. */
- ENUM_BITFIELD(df_ref_flags) flags : 16;
- /* Various flags. */
+ int flags : 16; /* Various df_ref_flags. */
rtx reg; /* The register referenced. */
struct df_link *chain; /* Head of def-use, use-def. */
/* Pointer to the insn info of the containing instruction. FIXME!
addresses. It is incremented whenever a ref is created. */
unsigned int ref_order;
- /* Problem specific control information. */
- ENUM_BITFIELD (df_changeable_flags) changeable_flags : 8;
+ /* Problem specific control information. This is a combination of
+ enum df_changeable_flags values. */
+ int changeable_flags : 8;
/* If this is true, then only a subset of the blocks of the program
is considered to compute the solutions of dataflow problems. */
/* Declarations and definitions of codes relating to the DWARF2 and
DWARF3 symbolic debugging information formats.
Copyright (C) 1992, 1993, 1995, 1996, 1997, 1999, 2000, 2001, 2002,
- 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+ 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
Written by Gary Funck (gary@intrepid.com) The Ada Joint Program
Office (AJPO), Florida State University and Silicon Graphics Inc.
DW_TAG_imported_unit = 0x3d,
DW_TAG_condition = 0x3f,
DW_TAG_shared_type = 0x40,
+
+ DW_TAG_lo_user = 0x4080,
+ DW_TAG_hi_user = 0xffff,
+
/* SGI/MIPS Extensions. */
DW_TAG_MIPS_loop = 0x4081,
/* HP extensions. See: ftp://ftp.hp.com/pub/lang/tools/WDB/wdb-4.0.tar.gz . */
DW_TAG_PGI_interface_block = 0xA020
};
-#define DW_TAG_lo_user 0x4080
-#define DW_TAG_hi_user 0xffff
-
/* Flag that tells whether entry has a child or not. */
#define DW_children_no 0
#define DW_children_yes 1
DW_AT_elemental = 0x66,
DW_AT_pure = 0x67,
DW_AT_recursive = 0x68,
+
+ DW_AT_lo_user = 0x2000, /* Implementation-defined range start. */
+ DW_AT_hi_user = 0x3ff0, /* Implementation-defined range end. */
+
/* SGI/MIPS extensions. */
DW_AT_MIPS_fde = 0x2001,
DW_AT_MIPS_loop_begin = 0x2002,
DW_AT_PGI_lstride = 0x3a02
};
-#define DW_AT_lo_user 0x2000 /* Implementation-defined range start. */
-#define DW_AT_hi_user 0x3ff0 /* Implementation-defined range end. */
-
/* Location atom names and codes. */
enum dwarf_location_atom
{
DW_OP_form_tls_address = 0x9b,
DW_OP_call_frame_cfa = 0x9c,
DW_OP_bit_piece = 0x9d,
+
+ DW_OP_lo_user = 0xe0, /* Implementation-defined range start. */
+ DW_OP_hi_user = 0xff, /* Implementation-defined range end. */
+
/* GNU extensions. */
DW_OP_GNU_push_tls_address = 0xe0,
/* The following is for marking variables that are uninitialized. */
DW_OP_HP_tls = 0xe6
};
-#define DW_OP_lo_user 0xe0 /* Implementation-defined range start. */
-#define DW_OP_hi_user 0xff /* Implementation-defined range end. */
-
/* Type encodings. */
enum dwarf_type
{
DW_ATE_signed_fixed = 0xd,
DW_ATE_unsigned_fixed = 0xe,
DW_ATE_decimal_float = 0xf,
+
+ DW_ATE_lo_user = 0x80,
+ DW_ATE_hi_user = 0xff,
+
/* HP extensions. */
DW_ATE_HP_float80 = 0x80, /* Floating-point (80 bit). */
DW_ATE_HP_complex_float80 = 0x81, /* Complex floating-point (80 bit). */
DW_ATE_HP_imaginary_float128 = 0x86
};
-#define DW_ATE_lo_user 0x80
-#define DW_ATE_hi_user 0xff
-
/* Decimal sign encodings. */
enum dwarf_decimal_sign_encoding
{
/* DWARF 3. */
DW_END_default = 0x00,
DW_END_big = 0x01,
- DW_END_little = 0x02
- };
+ DW_END_little = 0x02,
-#define DW_END_lo_user 0x40
-#define DW_END_hi_user 0xff
+ DW_END_lo_user = 0x40,
+ DW_END_hi_user = 0xff
+ };
/* Array ordering names and codes. */
enum dwarf_array_dim_ordering
DW_CC_normal = 0x1,
DW_CC_program = 0x2,
DW_CC_nocall = 0x3,
+
+ DW_CC_lo_user = 0x40,
+ DW_CC_hi_user = 0xff,
+
DW_CC_GNU_renesas_sh = 0x40
};
-#define DW_CC_lo_user 0x40
-#define DW_CC_hi_user 0xff
-
/* Inline attribute. */
enum dwarf_inline_attribute
{
DW_LNE_HP_negate_post_semantics = 0x17,
DW_LNE_HP_negate_function_exit = 0x18,
DW_LNE_HP_negate_front_end_logical = 0x19,
- DW_LNE_HP_define_proc = 0x20
- };
+ DW_LNE_HP_define_proc = 0x20,
-#define DW_LNE_lo_user 0x80
-#define DW_LNE_hi_user 0xff
+ DW_LNE_lo_user = 0x80,
+ DW_LNE_hi_user = 0xff
+ };
/* Call frame information. */
enum dwarf_call_frame_info
DW_CFA_val_offset = 0x14,
DW_CFA_val_offset_sf = 0x15,
DW_CFA_val_expression = 0x16,
+
+ DW_CFA_lo_user = 0x1c,
+ DW_CFA_hi_user = 0x3f,
+
/* SGI/MIPS specific. */
DW_CFA_MIPS_advance_loc8 = 0x1d,
/* GNU extensions. */
#define DW_CIE_VERSION 1
#define DW_CFA_extended 0
-#define DW_CFA_lo_user 0x1c
-#define DW_CFA_hi_user 0x3f
#define DW_CHILDREN_no 0x00
#define DW_CHILDREN_yes 0x01
DW_LANG_ObjC_plus_plus = 0x0011,
DW_LANG_UPC = 0x0012,
DW_LANG_D = 0x0013,
+
+ DW_LANG_lo_user = 0x8000, /* Implementation-defined range start. */
+ DW_LANG_hi_user = 0xffff, /* Implementation-defined range start. */
+
/* MIPS. */
DW_LANG_Mips_Assembler = 0x8001,
/* UPC. */
DW_LANG_Upc = 0x8765
};
-#define DW_LANG_lo_user 0x8000 /* Implementation-defined range start. */
-#define DW_LANG_hi_user 0xffff /* Implementation-defined range start. */
-
/* Names and codes for macro information. */
enum dwarf_macinfo_record_type
{
if (i >= 0)
{
if (i <= 31)
- op = DW_OP_lit0 + i;
+ op = (enum dwarf_location_atom) (DW_OP_lit0 + i);
else if (i <= 0xff)
op = DW_OP_const1u;
else if (i <= 0xffff)
{
enum dwarf_calling_convention value = DW_CC_normal;
- value = targetm.dwarf_calling_convention (TREE_TYPE (decl));
+ value = ((enum dwarf_calling_convention)
+ targetm.dwarf_calling_convention (TREE_TYPE (decl)));
/* DWARF doesn't provide a way to identify a program's source-level
entry point. DW_AT_calling_convention attributes are only meant
if (fold_deferred_overflow_warning != NULL
&& code != 0
&& code < (int) fold_deferred_overflow_code)
- fold_deferred_overflow_code = code;
+ fold_deferred_overflow_code = (enum warn_strict_overflow_code) code;
return;
}
bool honor_nans = HONOR_NANS (TYPE_MODE (TREE_TYPE (ll_arg)));
enum comparison_code lcompcode = comparison_to_compcode (lcode);
enum comparison_code rcompcode = comparison_to_compcode (rcode);
- enum comparison_code compcode;
+ int compcode;
switch (code)
{
else if (compcode == COMPCODE_FALSE)
return constant_boolean_node (false, truth_type);
else
- return fold_build2 (compcode_to_comparison (compcode),
- truth_type, ll_arg, lr_arg);
+ {
+ enum tree_code tcode;
+
+ tcode = compcode_to_comparison ((enum comparison_code) compcode);
+ return fold_build2 (tcode, truth_type, ll_arg, lr_arg);
+ }
}
\f
/* Return nonzero if two operands (typically of the same tree node)
+2009-04-24 Ian Lance Taylor <iant@google.com>
+
+ * gfortran.h (enum gfc_symbol_type): New named enum type, broken
+ out of struct gfc_symbol.
+ (struct gfc_symbol): Use enum gfc_symbol_type.
+ (enum gfc_array_ref_dimen_type): New named enum type, broken out
+ of struct gfc_array_ref).
+ (struct gfc_array_ref): Use enum gfc_array_ref_dimen_type.
+ (mod_pointee_as): Update declaration.
+ * decl.c (add_global_entry): Change type to enum gfc_symbol_type.
+ (gfc_mod_pointee_as): Change return type to "match".
+ * module.c (mio_array_ref): Add cast to enum type.
+ (mio_symbol): Likewise.
+ * resolve.c (resolve_global_procedure): Change type to enum
+ gfc_symbol_type.
+ * trans-io.c (gfc_build_st_parameter): Change type to unsigned
+ int.
+
2009-04-24 Daniel Kraft <d@domob.eu>
* gfortran.h (gfc_get_typebound_proc): Removed as macro, now a function.
/* Declaration statement matcher
- Copyright (C) 2002, 2004, 2005, 2006, 2007, 2008
+ Copyright (C) 2002, 2004, 2005, 2006, 2007, 2008, 2009
Free Software Foundation, Inc.
Contributed by Andy Vaught
add_global_entry (const char *name, int sub)
{
gfc_gsymbol *s;
- unsigned int type;
+ enum gfc_symbol_type type;
s = gfc_get_gsymbol(name);
type = sub ? GSYM_SUBROUTINE : GSYM_FUNCTION;
is the case. Since there is no bounds-checking for Cray Pointees,
this will be okay. */
-gfc_try
+match
gfc_mod_pointee_as (gfc_array_spec *as)
{
as->cray_pointee = true; /* This will be useful to know later. */
this to detect collisions already when parsing.
TODO: Extend to verify procedure calls. */
+enum gfc_symbol_type
+{
+ GSYM_UNKNOWN=1, GSYM_PROGRAM, GSYM_FUNCTION, GSYM_SUBROUTINE,
+ GSYM_MODULE, GSYM_COMMON, GSYM_BLOCK_DATA
+};
+
typedef struct gfc_gsymbol
{
BBT_HEADER(gfc_gsymbol);
const char *sym_name;
const char *mod_name;
const char *binding_label;
- enum { GSYM_UNKNOWN=1, GSYM_PROGRAM, GSYM_FUNCTION, GSYM_SUBROUTINE,
- GSYM_MODULE, GSYM_COMMON, GSYM_BLOCK_DATA } type;
+ enum gfc_symbol_type type;
int defined, used;
locus where;
/* Array reference. */
+
+enum gfc_array_ref_dimen_type
+{
+ DIMEN_ELEMENT = 1, DIMEN_RANGE, DIMEN_VECTOR, DIMEN_UNKNOWN
+};
+
typedef struct gfc_array_ref
{
ar_type type;
struct gfc_expr *start[GFC_MAX_DIMENSIONS], *end[GFC_MAX_DIMENSIONS],
*stride[GFC_MAX_DIMENSIONS];
- enum
- { DIMEN_ELEMENT = 1, DIMEN_RANGE, DIMEN_VECTOR, DIMEN_UNKNOWN }
- dimen_type[GFC_MAX_DIMENSIONS];
+ enum gfc_array_ref_dimen_type dimen_type[GFC_MAX_DIMENSIONS];
struct gfc_expr *offset;
}
gfc_try gfc_add_pointer (symbol_attribute *, locus *);
gfc_try gfc_add_cray_pointer (symbol_attribute *, locus *);
gfc_try gfc_add_cray_pointee (symbol_attribute *, locus *);
-gfc_try gfc_mod_pointee_as (gfc_array_spec *);
+match gfc_mod_pointee_as (gfc_array_spec *);
gfc_try gfc_add_protected (symbol_attribute *, const char *, locus *);
gfc_try gfc_add_result (symbol_attribute *, const char *, locus *);
gfc_try gfc_add_save (symbol_attribute *, const char *, locus *);
for (i = 0; i < ar->dimen; i++)
{
require_atom (ATOM_INTEGER);
- ar->dimen_type[i] = atom_int;
+ ar->dimen_type[i] = (enum gfc_array_ref_dimen_type) atom_int;
}
}
else
{
mio_integer (&intmod);
- sym->from_intmod = intmod;
+ sym->from_intmod = (intmod_id) intmod;
}
mio_integer (&(sym->intmod_sym_id));
{
gfc_gsymbol * gsym;
gfc_namespace *ns;
- unsigned int type;
+ enum gfc_symbol_type type;
type = sub ? GSYM_SUBROUTINE : GSYM_FUNCTION;
/* IO Code translation/library interface
- Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008
+ Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
Free Software Foundation, Inc.
Contributed by Paul Brook
static void
gfc_build_st_parameter (enum ioparam_type ptype, tree *types)
{
- enum iofield type;
+ unsigned int type;
gfc_st_parameter_field *p;
char name[64];
size_t len;
}
#include "gt-fortran-trans-io.h"
-
else if (d2->type == DT_pred && d2->u.pred.data)
{
bool common = false;
- enum rtx_code c;
+ int c;
for (c = 0; c < NUM_RTX_CODE; c++)
if (d1->u.pred.data->codes[c] && d2->u.pred.data->codes[c])
while (p && p->tests->type == DT_pred && p->tests->u.pred.data)
{
const struct pred_data *data = p->tests->u.pred.data;
- RTX_CODE c;
+ int c;
+
for (c = 0; c < NUM_RTX_CODE; c++)
if (codemap[c] && data->codes[c])
goto pred_done;
if (data->codes[c])
{
fputs (" case ", stdout);
- print_code (c);
+ print_code ((enum rtx_code) c);
fputs (":\n", stdout);
codemap[c] = 1;
}
gimplify_omp_for (tree *expr_p, gimple_seq *pre_p)
{
tree for_stmt, decl, var, t;
- enum gimplify_status ret = GS_OK;
+ enum gimplify_status ret = GS_ALL_DONE;
+ enum gimplify_status tret;
gimple gfor;
gimple_seq for_body, for_pre_body;
int i;
else
var = decl;
- ret |= gimplify_expr (&TREE_OPERAND (t, 1), &for_pre_body, NULL,
+ tret = gimplify_expr (&TREE_OPERAND (t, 1), &for_pre_body, NULL,
is_gimple_val, fb_rvalue);
+ ret = MIN (ret, tret);
if (ret == GS_ERROR)
return ret;
gcc_assert (COMPARISON_CLASS_P (t));
gcc_assert (TREE_OPERAND (t, 0) == decl);
- ret |= gimplify_expr (&TREE_OPERAND (t, 1), &for_pre_body, NULL,
+ tret = gimplify_expr (&TREE_OPERAND (t, 1), &for_pre_body, NULL,
is_gimple_val, fb_rvalue);
+ ret = MIN (ret, tret);
/* Handle OMP_FOR_INCR. */
t = TREE_VEC_ELT (OMP_FOR_INCR (for_stmt), i);
gcc_unreachable ();
}
- ret |= gimplify_expr (&TREE_OPERAND (t, 1), &for_pre_body, NULL,
+ tret = gimplify_expr (&TREE_OPERAND (t, 1), &for_pre_body, NULL,
is_gimple_val, fb_rvalue);
+ ret = MIN (ret, tret);
break;
default:
}
/* Do any language-specific gimplification. */
- ret = lang_hooks.gimplify_expr (expr_p, pre_p, post_p);
+ ret = ((enum gimplify_status)
+ lang_hooks.gimplify_expr (expr_p, pre_p, post_p));
if (ret == GS_OK)
{
if (*expr_p == NULL_TREE)
/* Interprocedural analyses.
- Copyright (C) 2005, 2007, 2008 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2007, 2008, 2009 Free Software Foundation, Inc.
This file is part of GCC.
/* We must check range due to calls with variable number of arguments: */
if (dst->value.formal_id >= (unsigned) ipa_get_cs_argument_count (top))
{
- dst->type = IPA_BOTTOM;
+ dst->type = IPA_JF_UNKNOWN;
continue;
}
static void
setup_class_subset_and_memory_move_costs (void)
{
- int cl, cl2;
- enum machine_mode mode;
+ int cl, cl2, mode;
HARD_REG_SET temp_hard_regset2;
for (mode = 0; mode < MAX_MACHINE_MODE; mode++)
for (mode = 0; mode < MAX_MACHINE_MODE; mode++)
{
ira_memory_move_cost[mode][cl][0] =
- MEMORY_MOVE_COST (mode, (enum reg_class) cl, 0);
+ MEMORY_MOVE_COST ((enum machine_mode) mode,
+ (enum reg_class) cl, 0);
ira_memory_move_cost[mode][cl][1] =
- MEMORY_MOVE_COST (mode, (enum reg_class) cl, 1);
+ MEMORY_MOVE_COST ((enum machine_mode) mode,
+ (enum reg_class) cl, 1);
/* Costs for NO_REGS are used in cost calculation on the
1st pass when the preferred register classes are not
known yet. In this case we take the best scenario. */
static void
setup_cover_and_important_classes (void)
{
- int i, j, n;
+ int i, j, n, cl;
bool set_p, eq_p;
- enum reg_class cl;
const enum reg_class *cover_classes;
HARD_REG_SET temp_hard_regset2;
static enum reg_class classes[LIM_REG_CLASSES + 1];
else
{
for (i = 0; (cl = cover_classes[i]) != LIM_REG_CLASSES; i++)
- classes[i] = cl;
+ classes[i] = (enum reg_class) cl;
classes[i] = LIM_REG_CLASSES;
}
continue;
#ifdef CONSTRAINT__LIMIT
for (j = 0; j < CONSTRAINT__LIMIT; j++)
- if ((int) regclass_for_constraint (j) == i)
+ if ((int) regclass_for_constraint ((enum constraint_num) j) == i)
break;
if (j < CONSTRAINT__LIMIT)
{
break;
}
if (j >= i)
- classes[n++] = i;
+ classes[n++] = (enum reg_class) i;
}
classes[n] = LIM_REG_CLASSES;
}
{
for (j = 0; j < i; j++)
if (flag_ira_algorithm != IRA_ALGORITHM_PRIORITY
- && reg_classes_intersect_p (cl, classes[j]))
+ && reg_classes_intersect_p ((enum reg_class) cl, classes[j]))
gcc_unreachable ();
COPY_HARD_REG_SET (temp_hard_regset, reg_class_contents[cl]);
AND_COMPL_HARD_REG_SET (temp_hard_regset, no_unit_alloc_regs);
if (! hard_reg_set_empty_p (temp_hard_regset))
- ira_reg_class_cover[ira_reg_class_cover_size++] = cl;
+ ira_reg_class_cover[ira_reg_class_cover_size++] = (enum reg_class) cl;
}
ira_important_classes_num = 0;
for (cl = 0; cl < N_REG_CLASSES; cl++)
COPY_HARD_REG_SET (temp_hard_regset2,
reg_class_contents[ira_reg_class_cover[j]]);
AND_COMPL_HARD_REG_SET (temp_hard_regset2, no_unit_alloc_regs);
- if (cl == ira_reg_class_cover[j])
+ if ((enum reg_class) cl == ira_reg_class_cover[j])
{
eq_p = false;
set_p = true;
if (set_p && ! eq_p)
{
ira_important_class_nums[cl] = ira_important_classes_num;
- ira_important_classes[ira_important_classes_num++] = cl;
+ ira_important_classes[ira_important_classes_num++] =
+ (enum reg_class) cl;
}
}
}
static void
setup_class_translate (void)
{
- enum reg_class cl, cover_class, best_class, *cl_ptr;
- enum machine_mode mode;
+ int cl, mode;
+ enum reg_class cover_class, best_class, *cl_ptr;
int i, cost, min_cost, best_cost;
for (cl = 0; cl < N_REG_CLASSES; cl++)
void
ira_init_once (void)
{
- enum machine_mode mode;
+ int mode;
for (mode = 0; mode < MAX_MACHINE_MODE; mode++)
{
static void
free_register_move_costs (void)
{
- enum machine_mode mode;
+ int mode;
for (mode = 0; mode < MAX_MACHINE_MODE; mode++)
{
if (! HARD_REGNO_MODE_OK (j, (enum machine_mode) i))
continue;
SET_REGNO (test_reg1, j);
- PUT_MODE (test_reg1, i);
+ PUT_MODE (test_reg1, (enum machine_mode) i);
SET_REGNO (test_reg2, j);
- PUT_MODE (test_reg2, i);
+ PUT_MODE (test_reg2, (enum machine_mode) i);
INSN_CODE (move_insn) = -1;
recog_memoized (move_insn);
if (INSN_CODE (move_insn) < 0)
+2009-04-24 Ian Lance Taylor <iant@google.com>
+
+ * jcf-parse.c (handle_constant): Add cast to enum type.
+
2009-04-21 Taras Glek <tglek@mozilla.com>
* builtins.c: Update GTY annotations to new syntax
/* Parser for Java(TM) .class files.
Copyright (C) 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
- 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+ 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
This file is part of GCC.
if (! CPOOL_INDEX_IN_RANGE (&jcf->cpool, index))
error ("<constant pool index %d not in range>", index);
- kind = JPOOL_TAG (jcf, index);
+ kind = (enum cpool_tag) JPOOL_TAG (jcf, index);
if ((kind & ~CONSTANT_ResolvedFlag) != purpose)
{
DECL_EXTERNAL (decl) = 1;
DECL_BUILT_IN_CLASS (decl) = cl;
- DECL_FUNCTION_CODE (decl) = -1;
- gcc_assert (DECL_FUNCTION_CODE (decl) >= function_code);
- DECL_FUNCTION_CODE (decl) = function_code;
+ DECL_FUNCTION_CODE (decl) = (enum built_in_function) function_code;
+
+ /* DECL_FUNCTION_CODE is a bitfield; verify that the value fits. */
+ gcc_assert (DECL_FUNCTION_CODE (decl) == function_code);
if (library_name)
{
/* Routines to implement minimum-cost maximal flow algorithm used to smooth
basic block and edge frequency counts.
- Copyright (C) 2008
+ Copyright (C) 2008, 2009
Free Software Foundation, Inc.
Contributed by Paul Yuan (yingbo.com@gmail.com) and
Vinodha Ramasamy (vinodha@google.com).
MAX_CAPACITY to the edge_list in the fixup graph. */
static void
-add_fixup_edge (fixup_graph_type *fixup_graph, int src, int dest, int type,
- gcov_type weight, gcov_type cost, gcov_type max_capacity)
+add_fixup_edge (fixup_graph_type *fixup_graph, int src, int dest,
+ edge_type type, gcov_type weight, gcov_type cost,
+ gcov_type max_capacity)
{
fixup_edge_p curr_edge = add_edge(fixup_graph, src, dest, cost);
curr_edge->type = type;
+2009-04-24 Ian Lance Taylor <iant@google.com>
+
+ * objc-act.c (get_super_receiver): Update calls to
+ build_modify_expr to pass new argument.
+
2009-04-21 Taras Glek <tglek@mozilla.com>
* objc-act.c: Update GTY annotations to new syntax
/* Set receiver to self. */
super_expr = objc_build_component_ref (UOBJC_SUPER_decl, self_id);
- super_expr = build_modify_expr (input_location,
- super_expr, NOP_EXPR, self_decl,
- NULL_TREE);
+ super_expr = build_modify_expr (input_location, super_expr, NULL_TREE,
+ NOP_EXPR, self_decl, NULL_TREE);
super_expr_list = super_expr;
/* Set class to begin searching. */
/* [_cls, __cls]Super are "pre-built" in
synth_forward_declarations. */
- super_expr = build_modify_expr (input_location, super_expr, NOP_EXPR,
+ super_expr = build_modify_expr (input_location, super_expr,
+ NULL_TREE, NOP_EXPR,
((TREE_CODE (objc_method_context)
== INSTANCE_METHOD_DECL)
? ucls_super_ref
}
super_expr
- = build_modify_expr (input_location, super_expr, NOP_EXPR,
+ = build_modify_expr (input_location, super_expr, NULL_TREE,
+ NOP_EXPR,
build_c_cast (TREE_TYPE (super_expr),
super_class),
NULL_TREE);
This code has no license restrictions, and is considered public
domain.
- Changes copyright (C) 2005, 2006, 2007, 2008 Free Software Foundation,
+ Changes copyright (C) 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
Inc.
Contributed by Sebastian Pop <sebastian.pop@inria.fr>
eqn->coef[j] *= a;
k = eqn->coef[i];
eqn->coef[i] = 0;
- eqn->color |= sub->color;
+ if (sub->color == omega_red)
+ eqn->color = omega_red;
for (j = n_vars; j >= 0; j--)
eqn->coef[j] -= sub->coef[j] * k / c;
}
gcc_unreachable ();
}
- icode = (int) optab_handler (shift_optab, mode)->insn_code;
+ icode = optab_handler (shift_optab, mode)->insn_code;
gcc_assert (icode != CODE_FOR_nothing);
mode1 = insn_data[icode].operand[1].mode;
}
/* Handle some compares against zero. */
- icode = (int) optab_handler (tst_optab, optab_mode)->insn_code;
+ icode = optab_handler (tst_optab, optab_mode)->insn_code;
if (y == CONST0_RTX (mode) && icode != CODE_FOR_nothing)
{
x = prepare_operand (icode, x, 0, mode, wider_mode, unsignedp);
/* Handle compares for which there is a directly suitable insn. */
- icode = (int) optab_handler (cmp_optab, optab_mode)->insn_code;
+ icode = optab_handler (cmp_optab, optab_mode)->insn_code;
if (icode != CODE_FOR_nothing)
{
x = prepare_operand (icode, x, 0, mode, wider_mode, unsignedp);
if (*arg == '\0')
{
if (!debug_info_level)
- debug_info_level = 2;
+ debug_info_level = DINFO_LEVEL_NORMAL;
}
else
{
- debug_info_level = integral_argument (arg);
- if (debug_info_level == (unsigned int) -1)
+ int argval = integral_argument (arg);
+ if (argval == -1)
error ("unrecognised debug output level \"%s\"", arg);
- else if (debug_info_level > 3)
+ else if (argval > 3)
error ("debug output level %s is too high", arg);
+ else
+ debug_info_level = (enum debug_info_level) argval;
}
}
changed. */
rtx note = find_reg_note (insn, REG_DEAD, reg);
if (note)
- PUT_MODE (note, REG_UNUSED);
+ PUT_REG_NOTE_KIND (note, REG_UNUSED);
add_reg_note (insn, REG_INC, reg);
sri.icode = CODE_FOR_nothing;
sri.prev_sri = prev_sri;
rclass = targetm.secondary_reload (in_p, x, reload_class, reload_mode, &sri);
- icode = sri.icode;
+ icode = (enum insn_code) sri.icode;
/* If we don't need any secondary registers, done. */
if (rclass == NO_REGS && icode == CODE_FOR_nothing)
sri.icode = CODE_FOR_nothing;
sri.prev_sri = NULL;
rclass = targetm.secondary_reload (in_p, x, rclass, mode, &sri);
- icode = sri.icode;
+ icode = (enum insn_code) sri.icode;
/* If there are no secondary reloads at all, we return NO_REGS.
If an intermediate register is needed, we return its class. */
&& (best_cost < 0 || best_cost >= cost))
|| best_cost > cost)
{
- best_class = rclass;
+ best_class = (enum reg_class) rclass;
best_size = reg_class_size[rclass];
best_cost = REGISTER_MOVE_COST (outer, (enum reg_class) rclass,
dest_class);
if (reload_adjust_reg_for_icode (&second_reload_reg,
third_reload_reg,
(enum insn_code) sri.icode))
- icode = sri.icode, third_reload_reg = 0;
+ {
+ icode = (enum insn_code) sri.icode;
+ third_reload_reg = 0;
+ }
else
- oldequiv = old, real_oldequiv = real_old;
+ {
+ oldequiv = old;
+ real_oldequiv = real_old;
+ }
}
else if (sri.icode != CODE_FOR_nothing)
/* We currently lack a way to express this in reloads. */
if (reload_adjust_reg_for_temp (&second_reload_reg,
third_reload_reg,
new_class, mode))
- third_reload_reg = 0, tertiary_icode = sri2.icode;
+ {
+ third_reload_reg = 0;
+ tertiary_icode = (enum insn_code) sri2.icode;
+ }
else
- oldequiv = old, real_oldequiv = real_old;
+ {
+ oldequiv = old;
+ real_oldequiv = real_old;
+ }
}
else if (new_t_class == NO_REGS && sri2.icode != CODE_FOR_nothing)
{
sri2.icode)))
{
second_reload_reg = intermediate;
- tertiary_icode = sri2.icode;
+ tertiary_icode = (enum insn_code) sri2.icode;
}
else
- oldequiv = old, real_oldequiv = real_old;
+ {
+ oldequiv = old;
+ real_oldequiv = real_old;
+ }
}
else if (new_t_class != NO_REGS && sri2.icode == CODE_FOR_nothing)
{
new_t_class, mode))
{
second_reload_reg = intermediate;
- tertiary_icode = sri2.icode;
+ tertiary_icode = (enum insn_code) sri2.icode;
}
else
- oldequiv = old, real_oldequiv = real_old;
+ {
+ oldequiv = old;
+ real_oldequiv = real_old;
+ }
}
else
- /* This could be handled more intelligently too. */
- oldequiv = old, real_oldequiv = real_old;
+ {
+ /* This could be handled more intelligently too. */
+ oldequiv = old;
+ real_oldequiv = real_old;
+ }
}
}
/* Initialization status of the variable in the location. Status
can be unknown, uninitialized or initialized. See enumeration
type below. */
-#define NOTE_VAR_LOCATION_STATUS(INSN) (XCINT (XCEXP (INSN, 4, NOTE), \
- 2, VAR_LOCATION))
+#define NOTE_VAR_LOCATION_STATUS(INSN) \
+ ((enum var_init_status) (XCINT (XCEXP (INSN, 4, NOTE), 2, VAR_LOCATION)))
/* Possible initialization status of a variable. When requested
by the user, this information is tracked and recorded in the DWARF
/* Instruction scheduling pass. Selective scheduler and pipeliner.
- Copyright (C) 2006, 2007, 2008 Free Software Foundation, Inc.
+ Copyright (C) 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
This file is part of GCC.
&& targetm.sched.skip_rtx_p (x))
{
*nx = XVECEXP (x, 0 ,0);
- *nmode = 0;
+ *nmode = VOIDmode;
return 1;
}
init_hard_regs_data (void)
{
int cur_reg = 0;
- enum machine_mode cur_mode = 0;
+ int cur_mode = 0;
CLEAR_HARD_REG_SET (sel_hrd.regs_ever_used);
for (cur_reg = 0; cur_reg < FIRST_PSEUDO_REGISTER; cur_reg++)
+2009-04-24 Ian Lance Taylor <iant@google.com>
+
+ * gcc.dg/Wcxx-compat-4.c: New testcase.
+
2009-04-24 Daniel Kraft <d@domob.eu>
* gfortran.dg/typebound_generic_1.f03: Change so that no error is
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-Wc++-compat" } */
+enum E1 { A, B, C };
+enum E2 { D, E, F };
+
+enum E1 g1;
+enum E2 g2;
+
+void
+f1 ()
+{
+ int a;
+ int d;
+ enum E1 e1;
+ enum E2 e2;
+ a = A;
+ a = !B;
+ d = E;
+ e1 = A;
+ e1 = D; /* { dg-warning "invalid in C\[+\]\[+\]" } */
+ e1 = 0; /* { dg-warning "invalid in C\[+\]\[+\]" } */
+ e1 = (enum E1) 0;
+ e1 = (enum E2) 0; /* { dg-warning "invalid in C\[+\]\[+\]" } */
+ e1 = e2; /* { dg-warning "invalid in C\[+\]\[+\]" } */
+ e1 = g1;
+ e1 = g2; /* { dg-warning "invalid in C\[+\]\[+\]" } */
+ e2 = A; /* { dg-warning "invalid in C\[+\]\[+\]" } */
+ e2 = D;
+}
+
+struct s { enum E1 e1 : 3; };
+
+void
+f2 (struct s sv)
+{
+ sv.e1 = A;
+ sv.e1 = D; /* { dg-warning "invalid in C\[+\]\[+\]" } */
+ g1 = sv.e1;
+ g2 = sv.e1; /* { dg-warning "invalid in C\[+\]\[+\]" } */
+}
+
+void
+f3 (struct s *pv)
+{
+ pv->e1 = A;
+ pv->e1 = D; /* { dg-warning "invalid in C\[+\]\[+\]" } */
+ g1 = pv->e1;
+ g2 = pv->e1; /* { dg-warning "invalid in C\[+\]\[+\]" } */
+}
out whether a complex number is degenerate in some way, having only real
or only complex parts. */
-typedef enum
+enum
{
UNINITIALIZED = 0,
ONLY_REAL = 1,
ONLY_IMAG = 2,
VARYING = 3
-} complex_lattice_t;
+};
+
+/* The type complex_lattice_t holds combinations of the above
+ constants. */
+typedef int complex_lattice_t;
#define PAIR(a, b) ((a) << 2 | (b))
gcc_assert (GET_MODE_CLASS (mode) == MODE_COMPLEX_FLOAT);
if (code == MULT_EXPR)
- bcode = BUILT_IN_COMPLEX_MUL_MIN + mode - MIN_MODE_COMPLEX_FLOAT;
+ bcode = ((enum built_in_function)
+ (BUILT_IN_COMPLEX_MUL_MIN + mode - MIN_MODE_COMPLEX_FLOAT));
else if (code == RDIV_EXPR)
- bcode = BUILT_IN_COMPLEX_DIV_MIN + mode - MIN_MODE_COMPLEX_FLOAT;
+ bcode = ((enum built_in_function)
+ (BUILT_IN_COMPLEX_DIV_MIN + mode - MIN_MODE_COMPLEX_FLOAT));
else
gcc_unreachable ();
fn = built_in_decls[bcode];
info = VEC_index (ssa_name_info_p, info_for_ssa_name, ver);
if (info->age < current_info_for_ssa_name_age)
{
- info->need_phi_state = 0;
+ info->need_phi_state = NEED_PHI_STATE_UNKNOWN;
info->current_def = NULL_TREE;
info->age = current_info_for_ssa_name_age;
}
if (!nested_in_vect_loop_p (loop, orig_stmt))
{
- if (reduc_code < NUM_TREE_CODES)
+ if (reduc_code != ERROR_MARK)
outer_cost += TARG_VEC_STMT_COST + TARG_VEC_TO_SCALAR_COST;
else
{
/* 2.3 Create the reduction code, using one of the three schemes described
above. */
- if (reduc_code < NUM_TREE_CODES)
+ if (reduc_code != ERROR_MARK)
{
tree tmp;
tree vectype = STMT_VINFO_VECTYPE (stmt_info);
loop_vec_info loop_vinfo = STMT_VINFO_LOOP_VINFO (stmt_info);
struct loop *loop = LOOP_VINFO_LOOP (loop_vinfo);
- enum tree_code code, orig_code, epilog_reduc_code = 0;
+ enum tree_code code, orig_code, epilog_reduc_code;
enum machine_mode vec_mode;
int op_type;
optab optab, reduc_optab;
{
if (vect_print_dump_info (REPORT_DETAILS))
fprintf (vect_dump, "no optab for reduction.");
- epilog_reduc_code = NUM_TREE_CODES;
+ epilog_reduc_code = ERROR_MARK;
}
if (optab_handler (reduc_optab, vec_mode)->insn_code == CODE_FOR_nothing)
{
if (vect_print_dump_info (REPORT_DETAILS))
fprintf (vect_dump, "reduc op not supported by target.");
- epilog_reduc_code = NUM_TREE_CODES;
+ epilog_reduc_code = ERROR_MARK;
}
if (!vec_stmt) /* transformation not required. */
if (loop->inner && vect_print_dump_info (REPORT_VECTORIZED_LOOPS))
fprintf (vect_dump, "OUTER LOOP VECTORIZED.");
}
-
-
-
}
else
{
- enum tree_code vec_mode;
+ enum machine_mode vec_mode;
enum insn_code icode;
optab optab;
STMT_VINFO_TYPE (res) = undef_vec_info_type;
STMT_VINFO_STMT (res) = stmt;
STMT_VINFO_LOOP_VINFO (res) = loop_vinfo;
- STMT_VINFO_RELEVANT (res) = 0;
+ STMT_VINFO_RELEVANT (res) = vect_unused_in_loop;
STMT_VINFO_LIVE_P (res) = false;
STMT_VINFO_VECTYPE (res) = NULL;
STMT_VINFO_VEC_STMT (res) = NULL;
STMT_VINFO_SAME_ALIGN_REFS (res) = VEC_alloc (dr_p, heap, 5);
STMT_VINFO_INSIDE_OF_LOOP_COST (res) = 0;
STMT_VINFO_OUTSIDE_OF_LOOP_COST (res) = 0;
- STMT_SLP_TYPE (res) = 0;
+ STMT_SLP_TYPE (res) = loop_vect;
DR_GROUP_FIRST_DR (res) = NULL;
DR_GROUP_NEXT_DR (res) = NULL;
DR_GROUP_SIZE (res) = 0;
*code1 = c1;
return true;
}
-
-
vl = atoi (val);
if (vl < MAX_VERBOSITY_LEVEL)
- vect_verbosity_level = vl;
+ vect_verbosity_level = (enum verbosity_levels) vl;
else
- vect_verbosity_level = MAX_VERBOSITY_LEVEL - 1;
+ vect_verbosity_level = (enum verbosity_levels) (MAX_VERBOSITY_LEVEL - 1);
}
/* Language-independent node constructors for parse phase of GNU compiler.
Copyright (C) 1987, 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
- 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
+ 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
Free Software Foundation, Inc.
This file is part of GCC.
tmp = tree_cons (NULL_TREE, inner_type, tmp);
ftype = build_function_type (type, tmp);
- mcode = BUILT_IN_COMPLEX_MUL_MIN + mode - MIN_MODE_COMPLEX_FLOAT;
- dcode = BUILT_IN_COMPLEX_DIV_MIN + mode - MIN_MODE_COMPLEX_FLOAT;
+ mcode = ((enum built_in_function)
+ (BUILT_IN_COMPLEX_MUL_MIN + mode - MIN_MODE_COMPLEX_FLOAT));
+ dcode = ((enum built_in_function)
+ (BUILT_IN_COMPLEX_DIV_MIN + mode - MIN_MODE_COMPLEX_FLOAT));
for (p = GET_MODE_NAME (mode), q = mode_name_buf; *p; p++, q++)
*q = TOLOWER (*p);
/* Variable tracking routines for the GNU compiler.
- Copyright (C) 2002, 2003, 2004, 2005, 2007, 2008
+ Copyright (C) 2002, 2003, 2004, 2005, 2007, 2008, 2009
Free Software Foundation, Inc.
This file is part of GCC.
set_variable_part (set, loc, decl, offset, initialized, set_src);
}
-static int
+static enum var_init_status
get_init_value (dataflow_set *set, rtx loc, tree decl)
{
void **slot;
variable var;
int i;
- int ret_val = VAR_INIT_STATUS_UNKNOWN;
+ enum var_init_status ret_val = VAR_INIT_STATUS_UNKNOWN;
if (! flag_var_tracking_uninit)
return VAR_INIT_STATUS_INITIALIZED;
TODO_dump_func | TODO_verify_rtl_sharing/* todo_flags_finish */
}
};
-
/* Vector API for GNU compiler.
- Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation, Inc.
Contributed by Nathan Sidwell <nathan@codesourcery.com>
This file is part of GCC.
} \
else \
{ \
- *ptr = 0; \
+ *ptr = (T) 0; \
return 0; \
} \
} \