https://gcc.gnu.org/bugzilla/show_bug.cgi?id=72850
Doug Gilmore <doug.gilmore at imgtec dot com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |doug.gilmore at imgtec dot com --- Comment #5 from Doug Gilmore <doug.gilmore at imgtec dot com> --- Thanks Uri for the test case! In case it wasn't clear, the switch statement should be removed at higher levels of optimization: $ for i in 0 1 2 3 ; do ( set -x ; mips-mti-linux-gnu-gcc test.c -c -O$i -fdump-tree-optimized ; egrep ";; Function|switch" test.c.169t.optimized ) done + mips-mti-linux-gnu-gcc test.c -c -O0 -fdump-tree-optimized + egrep ';; Function|switch' test.c.169t.optimized ;; Function is_digit (is_digit, funcdef_no=0, decl_uid=1406, symbol_order=0) ;; Function FMS (FMS, funcdef_no=1, decl_uid=1410, symbol_order=1) switch (state_11) <default: <L46>, case 0: <L3>, case 2: <L14>, case 3: <L34>, case 4: <L21>, case 5: <L27>, case 6: <L39>, case 7: <L43>> + mips-mti-linux-gnu-gcc test.c -c -O1 -fdump-tree-optimized + egrep ';; Function|switch' test.c.169t.optimized ;; Function FMS (FMS, funcdef_no=1, decl_uid=1410, symbol_order=1) switch (state_98) <default: <L54>, case 0: <L3>, case 2: <L14>, case 3: <L34>, case 4: <L21>, case 5: <L27>, case 6: <L39>, case 7: <L43>> + mips-mti-linux-gnu-gcc test.c -c -O2 -fdump-tree-optimized + egrep ';; Function|switch' test.c.169t.optimized ;; Function FMS (FMS, funcdef_no=1, decl_uid=1410, symbol_order=1) + mips-mti-linux-gnu-gcc test.c -c -O3 -fdump-tree-optimized + egrep ';; Function|switch' test.c.169t.optimized ;; Function FMS (FMS, funcdef_no=1, decl_uid=1410, symbol_order=1)