diff options
| author | aoliva <aoliva@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-09-18 16:41:22 +0000 |
|---|---|---|
| committer | aoliva <aoliva@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-09-18 16:41:22 +0000 |
| commit | 55e0f12fea66eea1047d497484d9f9d11bb077cf (patch) | |
| tree | 24e526e16ac8ebdabe381548e319d25e5f261567 | |
| parent | 447eb4ce876f3f417435f6fb86e8bb88319063d1 (diff) | |
| download | ppe42-gcc-55e0f12fea66eea1047d497484d9f9d11bb077cf.tar.gz ppe42-gcc-55e0f12fea66eea1047d497484d9f9d11bb077cf.zip | |
* config/sh/sh.c (nonpic_symbol_mentioned_p): Check LABEL_REFs.
* config/sh/sh.md (sym_label2reg, symPLT_label2reg): Protect
LABEL_REFs with a PIC-safe unspec.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@36495 138bc75d-0d04-0410-961f-82ee72b054a4
| -rw-r--r-- | gcc/ChangeLog | 6 | ||||
| -rw-r--r-- | gcc/config/sh/sh.c | 6 | ||||
| -rw-r--r-- | gcc/config/sh/sh.md | 11 |
3 files changed, 16 insertions, 7 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 45f82e026c6..368cab3efe0 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2000-09-18 Alexandre Oliva <aoliva@redhat.com> + + * config/sh/sh.c (nonpic_symbol_mentioned_p): Check LABEL_REFs. + * config/sh/sh.md (sym_label2reg, symPLT_label2reg): Protect + LABEL_REFs with a PIC-safe unspec. + 2000-09-18 Will Cohen <wcohen@redhat.com> * extend.texi (Zero Length): State that static initializers for diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c index 158e66f3177..903f1c542f8 100644 --- a/gcc/config/sh/sh.c +++ b/gcc/config/sh/sh.c @@ -5277,8 +5277,8 @@ sh_insn_length_adjustment (insn) return 0; } -/* Return TRUE if X references a SYMBOL_REF whose symbol doesn't have - @GOT or @GOTOFF. */ +/* Return TRUE if X references a SYMBOL_REF or LABEL_REF whose symbol + isn't protected by a PIC unspec. */ int nonpic_symbol_mentioned_p (x) rtx x; @@ -5286,7 +5286,7 @@ nonpic_symbol_mentioned_p (x) register const char *fmt; register int i; - if (GET_CODE (x) == SYMBOL_REF) + if (GET_CODE (x) == SYMBOL_REF || GET_CODE (x) == LABEL_REF) return 1; if (GET_CODE (x) == UNSPEC diff --git a/gcc/config/sh/sh.md b/gcc/config/sh/sh.md index a4f17d686f0..2930b7ce377 100644 --- a/gcc/config/sh/sh.md +++ b/gcc/config/sh/sh.md @@ -3482,8 +3482,9 @@ else [(set (match_operand:SI 0 "" "") (const (minus:SI (unspec [(match_operand:SI 1 "" "")] 6) - (const (plus:SI (label_ref (match_operand:SI 2 "" "")) - (const_int 2))))))] + (const (plus:SI + (unspec [(label_ref (match_operand:SI 2 "" ""))] 6) + (const_int 2))))))] "" "") (define_expand "symGOT2reg" @@ -3514,8 +3515,10 @@ else (const (minus:SI (plus:SI (pc) (unspec [(match_operand:SI 1 "" "")] 9)) - (const (plus:SI (label_ref (match_operand:SI 2 "" "")) - (const_int 2)))))) + (const + (plus:SI + (unspec [(label_ref (match_operand:SI 2 "" ""))] 6) + (const_int 2)))))) (use (match_dup 3))] ;; Even though the PIC register is not really used by the call ;; sequence in which this is expanded, the PLT code assumes the PIC |

