OSDN Git Service

* config/alpha/alpha.md (exception_receiver): Emit alternative
authoruros <uros@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 21 Aug 2009 06:01:23 +0000 (06:01 +0000)
committeruros <uros@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 21 Aug 2009 06:01:23 +0000 (06:01 +0000)
GP load sequence if flag_reorder_blocks_and_partition is set.
(*exception_receiver_2): Also enable when
flag_reorder_blocks_and_partition is set.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@150984 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config/alpha/alpha.md

index c0d98c1..225e96e 100644 (file)
@@ -1,3 +1,10 @@
+2009-08-21 Uros Bizjak <ubizjak@gmail.com>
+
+       * config/alpha/alpha.md (exception_receiver): Emit alternative
+       GP load sequence if flag_reorder_blocks_and_partition is set.
+       (*exception_receiver_2): Also enable when
+       flag_reorder_blocks_and_partition is set.
+
 2009-08-20  Matt Rice  <ratmice@gmail.com>
            Diego Novillo  <dnovillo@google.com>
 
 2009-08-20  Matt Rice  <ratmice@gmail.com>
            Diego Novillo  <dnovillo@google.com>
 
index 18817c8..67ccff5 100644 (file)
   "br $27,$LSJ%=\n$LSJ%=:"
   [(set_attr "type" "ibr")])
 
   "br $27,$LSJ%=\n$LSJ%=:"
   [(set_attr "type" "ibr")])
 
+;; When flag_reorder_blocks_and_partition is in effect, compiler puts
+;; exception landing pads in a cold section.  To prevent inter-section offset
+;; calculation, a jump to original landing pad is emitted in the place of the
+;; original landing pad.  Since landing pad is moved, RA-relative GP
+;; calculation in the prologue of landing pad breaks.  To solve this problem,
+;; we use alternative GP load approach, as in the case of TARGET_LD_BUGGY_LDGP.
+
 (define_expand "exception_receiver"
   [(unspec_volatile [(match_dup 0)] UNSPECV_EHR)]
   "TARGET_ABI_OSF"
 {
 (define_expand "exception_receiver"
   [(unspec_volatile [(match_dup 0)] UNSPECV_EHR)]
   "TARGET_ABI_OSF"
 {
-  if (TARGET_LD_BUGGY_LDGP)
+  if (TARGET_LD_BUGGY_LDGP || flag_reorder_blocks_and_partition)
     operands[0] = alpha_gp_save_rtx ();
   else
     operands[0] = const0_rtx;
     operands[0] = alpha_gp_save_rtx ();
   else
     operands[0] = const0_rtx;
 
 (define_insn "*exception_receiver_2"
   [(unspec_volatile [(match_operand:DI 0 "memory_operand" "m")] UNSPECV_EHR)]
 
 (define_insn "*exception_receiver_2"
   [(unspec_volatile [(match_operand:DI 0 "memory_operand" "m")] UNSPECV_EHR)]
-  "TARGET_ABI_OSF && TARGET_LD_BUGGY_LDGP"
+  "TARGET_ABI_OSF 
+   && (TARGET_LD_BUGGY_LDGP || flag_reorder_blocks_and_partition)"
   "ldq $29,%0"
   [(set_attr "type" "ild")])
 
   "ldq $29,%0"
   [(set_attr "type" "ild")])