Remove dead assignment and the stale assert, which checked for the dead value, with it.
[cparser] / driver / firm_opt.c
index 2ea1dec..defb7aa 100644 (file)
@@ -170,7 +170,7 @@ static void dump_all(const char *suffix)
 }
 
 /* entities of runtime functions */
-ir_entity_ptr rts_entities[rts_max];
+ir_entity *rts_entities[rts_max];
 
 /**
  * Map runtime functions.
@@ -178,7 +178,7 @@ ir_entity_ptr rts_entities[rts_max];
 static void rts_map(void)
 {
        static const struct {
-               ir_entity_ptr *ent; /**< address of the rts entity */
+               ir_entity   **ent; /**< address of the rts entity */
                i_mapper_func func; /**< mapper function. */
        } mapper[] = {
                /* integer */
@@ -756,12 +756,9 @@ void generate_code(FILE *out, const char *input_filename)
 {
        int i;
 
-       set_optimize(1);
-       set_opt_constant_folding(firm_opt.const_folding);
-       set_opt_algebraic_simplification(firm_opt.const_folding);
-       set_opt_cse(firm_opt.cse);
-       set_opt_global_cse(0);
-
+       /* initialize implicit opts, just to be sure because really the frontend
+        * should have called it already before starting graph construction */
+       init_implicit_optimizations();
        init_statistics();
 
        do_node_verification((firm_verification_t) firm_opt.verify);
@@ -833,6 +830,7 @@ static void disable_all_opts(void)
        firm_opt.alias_analysis  = false;
        firm_opt.strict_alias    = false;
        firm_opt.no_alias        = false;
+       firm_opt.const_folding   = false;
 
        FOR_EACH_OPT(config) {
                if (config->flags & OPT_FLAG_ESSENTIAL) {
@@ -859,8 +857,6 @@ static bool firm_opt_option(const char *opt)
 
 void firm_option_help(print_option_help_func print_option_help)
 {
-       print_option_help(firm_options[0].option, firm_options[0].description);
-
        FOR_EACH_OPT(config) {
                char buf[1024];
                char buf2[1024];
@@ -967,3 +963,12 @@ void choose_optimization_pack(int level)
                break;
        }
 }
+
+void init_implicit_optimizations(void)
+{
+       set_optimize(1);
+       set_opt_constant_folding(firm_opt.const_folding);
+       set_opt_algebraic_simplification(firm_opt.const_folding);
+       set_opt_cse(firm_opt.cse);
+       set_opt_global_cse(0);
+}