rs6000.c (rs6000_emit_epilogue): Simplify use_backchain_to_restore_sp initialisation.
authorAlan Modra <amodra@gmail.com>
Thu, 4 Aug 2011 03:11:02 +0000 (12:41 +0930)
committerAlan Modra <amodra@gcc.gnu.org>
Thu, 4 Aug 2011 03:11:02 +0000 (12:41 +0930)
* config/rs6000/rs6000.c (rs6000_emit_epilogue): Simplify
use_backchain_to_restore_sp initialisation.
(rs6000_legitimate_offset_address_p): Simplify offset test.

From-SVN: r177309

gcc/ChangeLog
gcc/config/rs6000/rs6000.c

index 60ee93a75e1324e4933ed07d890fe885bc0790eb..923e8c97fd375be39c8f505e9a99c65e6dc0438d 100644 (file)
@@ -1,3 +1,9 @@
+2011-08-04  Alan Modra  <amodra@gmail.com>
+
+       * config/rs6000/rs6000.c (rs6000_emit_epilogue): Simplify
+       use_backchain_to_restore_sp initialisation.
+       (rs6000_legitimate_offset_address_p): Simplify offset test.
+
 2011-08-03  Richard Henderson  <rth@redhat.com>
 
        * config/spu/spu.md: Use define_c_enum instead of define_constants.
index 29965138de6b48c6ca16b1f4eff04f8b31329794..a1141f1416dd70b4e40bef66d4f24b9d65ec7731 100644 (file)
@@ -5392,7 +5392,7 @@ rs6000_legitimate_offset_address_p (enum machine_mode mode, rtx x, int strict)
     }
 
   offset += 0x8000;
-  return (offset < 0x10000) && (offset + extra < 0x10000);
+  return offset < 0x10000 - extra;
 }
 
 bool
@@ -20712,10 +20712,7 @@ rs6000_emit_epilogue (int sibcall)
      here will not trigger at the moment;  We don't actually need a
      frame pointer for alloca, but the generic parts of the compiler
      give us one anyway.  */
-  use_backchain_to_restore_sp = (info->total_size > 32767
-                                || info->total_size
-                                    + (info->lr_save_p ? info->lr_save_offset : 0)
-                                      > 32767
+  use_backchain_to_restore_sp = (info->total_size > 32767 - info->lr_save_offset
                                 || (cfun->calls_alloca
                                     && !frame_pointer_needed));
   restore_lr = (info->lr_save_p