fixed a bunch of icc warnings
authorMatthias Braun <matze@braunis.de>
Fri, 7 Dec 2007 17:08:57 +0000 (17:08 +0000)
committerMatthias Braun <matze@braunis.de>
Fri, 7 Dec 2007 17:08:57 +0000 (17:08 +0000)
[r18642]

driver/firm_cmdline.c
driver/firm_codegen.c
driver/firm_opt.c
driver/gen_firm_asm.c

index 4195c6f..df0527e 100644 (file)
@@ -104,7 +104,7 @@ static const struct params {
   const char *option;      /**< name of the option */
   int        opt_len;      /**< length of the option string */
   a_byte     *flag;        /**< address of variable to set/reset */
-  int        set;          /**< iff true, variable will be set, else reset */
+  a_byte     set;          /**< iff true, variable will be set, else reset */
   const char *description; /**< description of this option */
 } firm_options[] = {
   /* this must be first */
@@ -358,7 +358,7 @@ int firm_option(const char *opt)
       }
       /* statistic options do accumulate */
       if (firm_options[i].flag == &firm_dump.statistic)
-        *firm_options[i].flag |= firm_options[i].set;
+        *firm_options[i].flag = (a_byte) (*firm_options[i].flag | firm_options[i].set);
       else
         *firm_options[i].flag = firm_options[i].set;
 
@@ -409,7 +409,7 @@ void print_firm_version(FILE *f) {
 
   firm_get_version(&version);
 
-  fprintf(f, "Firm C-Compiler using libFirm (%d.%d", version.major, version.minor);
+  fprintf(f, "Firm C-Compiler using libFirm (%u.%u", version.major, version.minor);
   if(version.revision[0] != 0) {
        fputc(' ', f);
     fputs(version.revision, f);
index 57f52b3..941f559 100644 (file)
@@ -23,8 +23,6 @@
 #include "firm_opt.h"
 #include "firm_timing.h"
 
-extern void be_main(FILE *f, const char *asm_file_name);
-
 /**
  * Substitutes '.c' for '.s'.
  */
index 5844b1d..e402614 100644 (file)
 #define CHECK_ALL(cond)                                 \
   do {                                                  \
     if (cond) {                                         \
-      int i                                           \
+      int ii;                                           \
       timer_push(TV_VERIFY);                            \
-      for (i = get_irp_n_irgs() - 1; i >= 0; --i)       \
-        irg_verify(get_irp_irg(i), VRFY_ENFORCE_SSA);   \
+      for (ii = get_irp_n_irgs() - 1; ii >= 0; --ii)    \
+        irg_verify(get_irp_irg(ii), VRFY_ENFORCE_SSA);  \
       timer_pop();                                      \
     }                                                   \
   } while (0)
@@ -107,7 +107,6 @@ static const ir_settings_arch_dep_t *ad_param = NULL;
 static create_intrinsic_fkt *arch_create_intrinsic = NULL;
 static void *create_intrinsic_ctx = NULL;
 static const ir_settings_if_conv_t *if_conv_info = NULL;
-static unsigned char be_support_inline_asm = FALSE;
 
 /* entities of runtime functions */
 ir_entity_ptr rts_entities[rts_max];
@@ -285,8 +284,7 @@ static void dump_all_count(const char *const suffix)
  */
 static void do_firm_optimizations(const char *input_filename, int firm_const_exists)
 {
-  ir_entity **keep_methods;
-  int i, arr_len;
+  int      i;
   ir_graph *irg;
   unsigned aa_opt;
 
@@ -308,6 +306,9 @@ static void do_firm_optimizations(const char *input_filename, int firm_const_exi
   timer_start(TV_ALL_OPT);
 
   if (firm_opt.remove_unused) {
+       ir_entity **keep_methods;
+       int         arr_len;
+
     /* Analysis that finds the free methods,
        i.e. methods that are dereferenced.
        Optimizes polymorphic calls :-). */
@@ -664,6 +665,7 @@ static int compute_type_size(ir_type *ty)
       ir_node *upper   = get_array_upper_bound(ty, i);
       ir_graph *rem    = current_ir_graph;
       tarval  *tv_lower, *tv_upper;
+      long     val_lower, val_upper;
 
       current_ir_graph = get_const_code_irg();
       local_optimize_node(lower);
@@ -682,7 +684,9 @@ static int compute_type_size(ir_type *ty)
         return 0;
       }
 
-      size *= get_tarval_long(tv_upper) - get_tarval_long(tv_lower);
+      val_upper = get_tarval_long(tv_upper);
+      val_lower = get_tarval_long(tv_lower);
+      size     *= val_upper - val_lower;
     }
     restore_optimization_state(&state);
 
@@ -914,9 +918,7 @@ void gen_firm_init(void)
   if (firm_be_opt.selection == BE_FIRM_BE) {
     const backend_params *be_params = be_init();
 
-    be_support_inline_asm   = be_params->support_inline_asm;
-
-    firm_opt.lower_ll       = be_params->do_dw_lowering;
+    firm_opt.lower_ll       = (a_byte) be_params->do_dw_lowering;
     params.arch_op_settings = be_params->arch_op_settings;
 
     arch_create_intrinsic   = be_params->arch_create_intrinsic_fkt;
@@ -950,7 +952,7 @@ void gen_firm_init(void)
   /* do not run architecture dependent optimizations in building phase */
   arch_dep_set_opts(arch_dep_none);
 
-  do_node_verification(firm_opt.vrfy);
+  do_node_verification((firm_verification_t) firm_opt.vrfy);
   if (firm_dump.filter)
     only_dump_method_with_name(new_id_from_str(firm_dump.filter));
 
@@ -995,7 +997,8 @@ void gen_firm_finish(FILE *out, const char *input_filename, int c_mode, int firm
   int i;
 
   /* the general for dumping option must be set, or the others will not work */
-  firm_dump.ir_graph |= firm_dump.all_phases | firm_dump.extbb;
+  firm_dump.ir_graph
+      = (a_byte) (firm_dump.ir_graph | firm_dump.all_phases | firm_dump.extbb);
 
   dump_keepalive_edges(1);
   dump_consts_local(1);
@@ -1078,9 +1081,10 @@ void gen_firm_finish(FILE *out, const char *input_filename, int c_mode, int firm
 #endif
 
   /* enable architecture dependent optimizations */
-  arch_dep_set_opts((firm_opt.muls ? arch_dep_mul_to_shift : arch_dep_none) |
+  arch_dep_set_opts((arch_dep_opts_t)
+                    ((firm_opt.muls ? arch_dep_mul_to_shift : arch_dep_none) |
                     (firm_opt.divs ? arch_dep_div_by_const : arch_dep_none) |
-                    (firm_opt.mods ? arch_dep_mod_by_const : arch_dep_none) );
+                    (firm_opt.mods ? arch_dep_mod_by_const : arch_dep_none) ));
 
 
   if (firm_dump.statistic & STAT_FINAL_IR)
index 88f20b5..40da346 100644 (file)
@@ -39,11 +39,14 @@ typedef struct fix_ctx {
  */
 static void name(FILE *f, const char *prefix, ir_node *n, const char *suffix)
 {
-  fprintf(f, "%s%s_%u%s",
-    prefix ? prefix : "",
-    get_op_name(get_irn_op(n)),
-    get_irn_idx(n),
-    suffix ? suffix : "");
+  const char *op_name = get_op_name(get_irn_op(n));
+  unsigned    index   = get_irn_idx(n);
+  if(prefix == NULL)
+    prefix = "";
+  if(suffix == NULL)
+    suffix = "";
+
+  fprintf(f, "%s%s_%u%s", prefix, op_name, index, suffix);
 }
 
 /**
@@ -507,7 +510,7 @@ static void generate_code_Const(FILE *f, ir_node *n)
     else {
 def_mode:
       tarval_snprintf(buf, sizeof(buf), tv);
-      fprintf(f, "new_tarval_from_str(\"%s\", %d, ", buf, strlen(buf));
+      fprintf(f, "new_tarval_from_str(\"%s\", %u, ", buf, strlen(buf));
       fprintf(f, "mode_%s)", get_mode_name(mode));
     }
   }
@@ -531,6 +534,7 @@ static void generate_code_SymConst(FILE *f, ir_node *n)
   ir_label_t label;
   symconst_kind kind = get_SymConst_kind(n);
   const char *k_name = "NULL";
+  const char *str;
 
   switch (kind) {
   case symconst_addr_ent:
@@ -539,7 +543,8 @@ static void generate_code_SymConst(FILE *f, ir_node *n)
     break;
   case symconst_addr_name:
     id = get_SymConst_name(n);
-    fprintf(f, "  sym.ident_p = new_id_from_chars(\"%s\", %d);\n", get_id_str(id), get_id_strlen(id));
+    str = get_id_str(id);
+    fprintf(f, "  sym.ident_p = new_id_from_chars(\"%s\", %d);\n", str, get_id_strlen(id));
     k_name = "symconst_addr_name";
     break;
   case symconst_type_size:
@@ -564,7 +569,8 @@ static void generate_code_SymConst(FILE *f, ir_node *n)
     break;
   case symconst_enum_const:
     id = get_SymConst_name(n);
-    fprintf(f, "  sym.ident_p = new_id_from_chars(\"%s\", %d);\n", get_id_str(id), get_id_strlen(id));
+    str = get_id_str(id);
+    fprintf(f, "  sym.ident_p = new_id_from_chars(\"%s\", %d);\n", str, get_id_strlen(id));
     k_name = "symconst_enum_const";
     break;
   case symconst_label:
@@ -965,11 +971,13 @@ static void generate_code_Proj(FILE *f, ir_node *n)
   case iro_Cond:
     generate_code_Proj_Cond(f, n);
     break;
-  default:
+  default: {
+    const char *mode_name = get_mode_name(get_irn_mode(n));
     name(f, "  ", n, " = new_r_Proj(irg, ");
     name(f, NULL, get_nodes_block(n), ", ");
     name(f, NULL, get_Proj_pred(n), ", ");
-    fprintf(f, "mode_%s, %ld);\n", get_mode_name(get_irn_mode(n)), get_Proj_proj(n));
+    fprintf(f, "mode_%s, %ld);\n", mode_name, get_Proj_proj(n));
+  }
   }
 }