From 94331892c35dcef7d097578e8b166c5feded9358 Mon Sep 17 00:00:00 2001 From: Eric Botcazou Date: Thu, 24 Nov 2016 15:30:17 +0000 Subject: [PATCH] sparc-common.c (sparc_option_optimization_table): Enable REE at -O2 and higher. * common/config/sparc/sparc-common.c (sparc_option_optimization_table): Enable REE at -O2 and higher. * config/sparc/sparc.c (sparc_option_override): Disable it by default in 32-bit mode. From-SVN: r242841 --- gcc/ChangeLog | 7 +++++++ gcc/common/config/sparc/sparc-common.c | 2 ++ gcc/config/sparc/sparc.c | 5 +++++ 3 files changed, 14 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a6641c1653b..c1469f53ff3 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2016-11-24 Eric Botcazou + + * common/config/sparc/sparc-common.c (sparc_option_optimization_table): + Enable REE at -O2 and higher. + * config/sparc/sparc.c (sparc_option_override): Disable it by default + in 32-bit mode. + 2016-11-24 Kyrylo Tkachov PR target/48863 diff --git a/gcc/common/config/sparc/sparc-common.c b/gcc/common/config/sparc/sparc-common.c index 3958b7ec5e8..721c8b355c2 100644 --- a/gcc/common/config/sparc/sparc-common.c +++ b/gcc/common/config/sparc/sparc-common.c @@ -28,6 +28,8 @@ along with GCC; see the file COPYING3. If not see 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 } }; diff --git a/gcc/config/sparc/sparc.c b/gcc/config/sparc/sparc.c index 2d1f598434b..a70a0ad7b02 100644 --- a/gcc/config/sparc/sparc.c +++ b/gcc/config/sparc/sparc.c @@ -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. */ -- 2.30.2