A patch making GCC with -O0 to run combiner and RA. After applying the patch all other otimization levels -On (n >= 1) still work as the same before. Index: combine.c =================================================================== --- combine.c (revision 254608) +++ combine.c (working copy) @@ -14841,7 +14841,7 @@ {} /* opt_pass methods: */ - virtual bool gate (function *) { return (optimize > 0); } + virtual bool gate (function *) { return (1||optimize > 0); } virtual unsigned int execute (function *) { return rest_of_handle_combine (); Index: df-core.c =================================================================== --- df-core.c (revision 254608) +++ df-core.c (working copy) @@ -741,7 +741,7 @@ {} /* opt_pass methods: */ - virtual bool gate (function *) { return optimize > 0; } + virtual bool gate (function *) { return 1||optimize > 0; } virtual unsigned int execute (function *) { return rest_of_handle_df_initialize (); @@ -781,7 +781,7 @@ {} /* opt_pass methods: */ - virtual bool gate (function *) { return optimize == 0; } + virtual bool gate (function *) { return 0&&optimize == 0; } virtual unsigned int execute (function *) { return rest_of_handle_df_initialize (); Index: function.c =================================================================== --- function.c (revision 254608) +++ function.c (working copy) @@ -2214,7 +2214,7 @@ if (DECL_IGNORED_P (decl)) return true; - if (optimize) + if (1||optimize) return true; if (!DECL_REGISTER (decl)) Index: init-regs.c =================================================================== --- init-regs.c (revision 254608) +++ init-regs.c (working copy) @@ -50,7 +50,7 @@ basic_block bb; auto_bitmap already_genned; - if (optimize == 1) + if (1||optimize == 1) { df_live_add_problem (); df_live_set_all_dirty (); @@ -119,7 +119,7 @@ } } - if (optimize == 1) + if (1||optimize == 1) { if (dump_file) df_dump (dump_file); @@ -150,7 +150,7 @@ {} /* opt_pass methods: */ - virtual bool gate (function *) { return optimize > 0; } + virtual bool gate (function *) { return 1||optimize > 0; } virtual unsigned int execute (function *) { initialize_uninitialized_regs (); Index: ira.c =================================================================== --- ira.c (revision 254608) +++ ira.c (working copy) @@ -5141,7 +5141,7 @@ /* Perform target specific PIC register initialization. */ targetm.init_pic_reg (); - ira_conflicts_p = optimize > 0; + ira_conflicts_p = 1||optimize > 0; /* If there are too many pseudos and/or basic blocks (e.g. 10K pseudos and 10K blocks or 100K pseudos and 1K blocks), we will