diff options
author | Richard Henderson <rth@redhat.com> | 2004-12-05 11:52:24 -0800 |
---|---|---|
committer | Richard Henderson <rth@gcc.gnu.org> | 2004-12-05 11:52:24 -0800 |
commit | cbb16d8ef60e88aaed225bd13e4f79eef55c64e1 (patch) | |
tree | dbb5946016e7ffe496f9a7644d5730988c053965 | |
parent | 82f4593a97f20deebb71cc7d624727cfe01f8c2c (diff) | |
download | gcc-cbb16d8ef60e88aaed225bd13e4f79eef55c64e1.zip gcc-cbb16d8ef60e88aaed225bd13e4f79eef55c64e1.tar.gz gcc-cbb16d8ef60e88aaed225bd13e4f79eef55c64e1.tar.bz2 |
re PR target/18841 (setjmp and eh receivers can mis-schedule)
PR target/18841
* config/alpha/alpha.md (UNSPECV_SETJMPR_ER): New.
(builtin_setjmp_receiver_er_sl_1): Use it.
(builtin_setjmp_receiver_er_1): Likewise.
(builtin_setjmp_receiver_er, exception_receiver_er): Remove.
(builtin_setjmp_receiver): Don't split for explicit relocs until
after reload.
(exception_receiver): Likewise.
From-SVN: r91753
-rw-r--r-- | gcc/ChangeLog | 11 | ||||
-rw-r--r-- | gcc/config/alpha/alpha.md | 119 |
2 files changed, 64 insertions, 66 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 2eceb2cb..80f8776 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,14 @@ +2004-12-05 Richard Henderson <rth@redhat.com> + + PR target/18841 + * config/alpha/alpha.md (UNSPECV_SETJMPR_ER): New. + (builtin_setjmp_receiver_er_sl_1): Use it. + (builtin_setjmp_receiver_er_1): Likewise. + (builtin_setjmp_receiver_er, exception_receiver_er): Remove. + (builtin_setjmp_receiver): Don't split for explicit relocs until + after reload. + (exception_receiver): Likewise. + 2004-12-05 Andrew Pinski <pinskia@physics.uc.edu> * mklibgcc.in (vis_hide): Add the prototype for the test. diff --git a/gcc/config/alpha/alpha.md b/gcc/config/alpha/alpha.md index 3f72427..21bf64b 100644 --- a/gcc/config/alpha/alpha.md +++ b/gcc/config/alpha/alpha.md @@ -77,6 +77,7 @@ (UNSPECV_PLDGP2 11) ; prologue ldgp (UNSPECV_SET_TP 12) (UNSPECV_RPCC 13) + (UNSPECV_SETJMPR_ER 14) ; builtin_setjmp_receiver fragment ]) ;; Where necessary, the suffixes _le and _be are used to distinguish between @@ -6780,70 +6781,46 @@ "jmp $31,(%0),0" [(set_attr "type" "ibr")]) -(define_insn "*builtin_setjmp_receiver_er_sl_1" - [(unspec_volatile [(label_ref (match_operand 0 "" ""))] UNSPECV_SETJMPR)] - "TARGET_EXPLICIT_RELOCS && TARGET_ABI_OSF && TARGET_AS_CAN_SUBTRACT_LABELS" - "lda $27,$LSJ%=-%l0($27)\n$LSJ%=:") - -(define_insn "*builtin_setjmp_receiver_er_1" - [(unspec_volatile [(label_ref (match_operand 0 "" ""))] UNSPECV_SETJMPR)] - "TARGET_EXPLICIT_RELOCS && TARGET_ABI_OSF" - "br $27,$LSJ%=\n$LSJ%=:" - [(set_attr "type" "ibr")]) - -(define_split - [(unspec_volatile [(label_ref (match_operand 0 "" ""))] UNSPECV_SETJMPR)] - "TARGET_EXPLICIT_RELOCS && TARGET_ABI_OSF - && prev_nonnote_insn (insn) == operands[0]" - [(const_int 0)] - " -{ - emit_note (NOTE_INSN_DELETED); - DONE; -}") - -(define_insn "*builtin_setjmp_receiver_1" +(define_expand "builtin_setjmp_receiver" [(unspec_volatile [(label_ref (match_operand 0 "" ""))] UNSPECV_SETJMPR)] "TARGET_ABI_OSF" - "br $27,$LSJ%=\n$LSJ%=:\;ldgp $29,0($27)" - [(set_attr "length" "12") - (set_attr "type" "multi")]) + "") -(define_expand "builtin_setjmp_receiver_er" - [(unspec_volatile [(label_ref (match_operand 0 "" ""))] UNSPECV_SETJMPR) - (set (match_dup 1) +(define_insn_and_split "*builtin_setjmp_receiver_1" + [(unspec_volatile [(match_operand 0 "" "")] UNSPECV_SETJMPR)] + "TARGET_ABI_OSF" +{ + if (TARGET_EXPLICIT_RELOCS) + return "#"; + else + return "br $27,$LSJ%=\n$LSJ%=:\;ldgp $29,0($27)"; +} + "&& TARGET_EXPLICIT_RELOCS && reload_completed" + [(set (match_dup 1) (unspec_volatile:DI [(match_dup 2) (match_dup 3)] UNSPECV_LDGP1)) (set (match_dup 1) (unspec:DI [(match_dup 1) (match_dup 3)] UNSPEC_LDGP2))] - "" { + if (prev_nonnote_insn (curr_insn) != XEXP (operands[0], 0)) + emit_insn (gen_rtx_UNSPEC_VOLATILE (VOIDmode, gen_rtvec (1, operands[0]), + UNSPECV_SETJMPR_ER)); operands[1] = pic_offset_table_rtx; operands[2] = gen_rtx_REG (Pmode, 27); operands[3] = GEN_INT (alpha_next_sequence_number++); -}) - -(define_expand "builtin_setjmp_receiver" - [(unspec_volatile [(label_ref (match_operand 0 "" ""))] UNSPECV_SETJMPR)] - "TARGET_ABI_OSF" -{ - if (TARGET_EXPLICIT_RELOCS) - { - emit_insn (gen_builtin_setjmp_receiver_er (operands[0])); - DONE; - } -}) +} + [(set_attr "length" "12") + (set_attr "type" "multi")]) -(define_expand "exception_receiver_er" - [(set (match_dup 0) - (unspec_volatile:DI [(match_dup 1) (match_dup 2)] UNSPECV_LDGP1)) - (set (match_dup 0) - (unspec:DI [(match_dup 0) (match_dup 2)] UNSPEC_LDGP2))] - "" -{ - operands[0] = pic_offset_table_rtx; - operands[1] = gen_rtx_REG (Pmode, 26); - operands[2] = GEN_INT (alpha_next_sequence_number++); -}) +(define_insn "*builtin_setjmp_receiver_er_sl_1" + [(unspec_volatile [(match_operand 0 "" "")] UNSPECV_SETJMPR_ER)] + "TARGET_ABI_OSF && TARGET_EXPLICIT_RELOCS && TARGET_AS_CAN_SUBTRACT_LABELS" + "lda $27,$LSJ%=-%l0($27)\n$LSJ%=:") + +(define_insn "*builtin_setjmp_receiver_er_1" + [(unspec_volatile [(match_operand 0 "" "")] UNSPECV_SETJMPR_ER)] + "TARGET_ABI_OSF && TARGET_EXPLICIT_RELOCS" + "br $27,$LSJ%=\n$LSJ%=:" + [(set_attr "type" "ibr")]) (define_expand "exception_receiver" [(unspec_volatile [(match_dup 0)] UNSPECV_EHR)] @@ -6851,28 +6828,38 @@ { if (TARGET_LD_BUGGY_LDGP) operands[0] = alpha_gp_save_rtx (); - else if (TARGET_EXPLICIT_RELOCS) - { - emit_insn (gen_exception_receiver_er ()); - DONE; - } else operands[0] = const0_rtx; }) -(define_insn "*exception_receiver_1" - [(unspec_volatile [(const_int 0)] UNSPECV_EHR)] - "! TARGET_LD_BUGGY_LDGP" - "ldgp $29,0($26)" - [(set_attr "length" "8") - (set_attr "type" "multi")]) - (define_insn "*exception_receiver_2" [(unspec_volatile [(match_operand:DI 0 "memory_operand" "m")] UNSPECV_EHR)] - "TARGET_LD_BUGGY_LDGP" + "TARGET_ABI_OSF && TARGET_LD_BUGGY_LDGP" "ldq $29,%0" [(set_attr "type" "ild")]) +(define_insn_and_split "*exception_receiver_1" + [(unspec_volatile [(const_int 0)] UNSPECV_EHR)] + "TARGET_ABI_OSF" +{ + if (TARGET_EXPLICIT_RELOCS) + return "ldah $29,0($26)\t\t!gpdisp!%*\;lda $29,0($29)\t\t!gpdisp!%*"; + else + return "ldgp $29,0($26)"; +} + "&& TARGET_EXPLICIT_RELOCS && reload_completed" + [(set (match_dup 0) + (unspec_volatile:DI [(match_dup 1) (match_dup 2)] UNSPECV_LDGP1)) + (set (match_dup 0) + (unspec:DI [(match_dup 0) (match_dup 2)] UNSPEC_LDGP2))] +{ + operands[0] = pic_offset_table_rtx; + operands[1] = gen_rtx_REG (Pmode, 26); + operands[2] = GEN_INT (alpha_next_sequence_number++); +} + [(set_attr "length" "8") + (set_attr "type" "multi")]) + (define_expand "nonlocal_goto_receiver" [(unspec_volatile [(const_int 0)] UNSPECV_BLOCKAGE) (set (reg:DI 27) (mem:DI (reg:DI 29))) |