Index: common/config/sparc/sparc-common.c =================================================================== --- common/config/sparc/sparc-common.c (revision 242632) +++ common/config/sparc/sparc-common.c (working copy) @@ -28,6 +28,8 @@ along with GCC; see the file COPYING3. static const struct default_options sparc_option_optimization_table[] = { { OPT_LEVELS_1_PLUS, OPT_fomit_frame_pointer, NULL, 1 }, + /* Enable redundant extension instructions removal at -O2 and higher. */ + { OPT_LEVELS_2_PLUS, OPT_free, NULL, 1 }, { OPT_LEVELS_NONE, 0, NULL, 0 } }; Index: config/sparc/sparc.c =================================================================== --- config/sparc/sparc.c (revision 242632) +++ config/sparc/sparc.c (working copy) @@ -1713,6 +1713,11 @@ sparc_option_override (void) pessimizes for double floating-point registers. */ if (!global_options_set.x_flag_ira_share_save_slots) flag_ira_share_save_slots = 0; + + /* Only enable REE by default in 64-bit mode where it helps to eliminate + redundant 32-to-64-bit extensions. */ + if (!global_options_set.x_flag_ree && TARGET_ARCH32) + flag_ree = 0; } /* Miscellaneous utilities. */