diff mbox

[i386] : Enable flag_ree also on 32bit targets

Message ID CAFULd4Z+-=0vuk-R-BFdvF=5QMehi5zVyw54K4_b0S9pfrbp-Q@mail.gmail.com
State New
Headers show

Commit Message

Uros Bizjak Dec. 21, 2011, 8:13 p.m. UTC
Hello!

As shown by pr50038.c testcase, recent redundant extension insns
improvements also benefit 32bit targets.  Attached patch enables this
pass for all x86 targets. The patch also moves the testcase to better
place.

2011-12-21  Uros Bizjak  <ubizjak@gmail.com>

	* config/i386/i386.c (ix86_option_override_internal): Enable flag_ree
	also for 32bit targets.

testsuite/ChangeLog:

2011-12-21  Uros Bizjak  <ubizjak@gmail.com>

	* gcc.dg/pr50038.c: Move to ...
	* gcc.target/i386/pr50038.c: ... here.  Test on all targets.

Tested on x86_64-pc-linux-gnu {,-m32}, committed to mainline SVN.

Uros.
diff mbox

Patch

Index: i386.c
===================================================================
--- i386.c	(revision 182601)
+++ i386.c	(working copy)
@@ -3445,12 +3445,14 @@  ix86_option_override_internal (bool main_args_p)
 #define USE_X86_64_FRAME_POINTER 0
 #endif
 
+  /* Enable redundant extension instructions removal at -O2 and higher.  */
+  if (optimize >= 2 && !global_options_set.x_flag_ree)
+    flag_ree = 1;
+
   /* Set the default values for switches whose default depends on TARGET_64BIT
      in case they weren't overwritten by command line options.  */
   if (TARGET_64BIT)
     {
-      if (optimize > 1 && !global_options_set.x_flag_ree)
-	flag_ree = 1;
       if (optimize >= 1 && !global_options_set.x_flag_omit_frame_pointer)
 	flag_omit_frame_pointer = !USE_X86_64_FRAME_POINTER;
       if (flag_asynchronous_unwind_tables == 2)