diff options
author | Richard Sandiford <rdsandiford@googlemail.com> | 2011-01-16 21:52:37 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@gcc.gnu.org> | 2011-01-16 21:52:37 +0000 |
commit | 4377fad9da8478d4683dd7412459fe4d7bbd29fa (patch) | |
tree | f88c32c1c477927a5182cb3961277fa8ded3cd48 /gcc | |
parent | 89a5f4865a2f96fe71e4df7e5782d65b09b107af (diff) | |
download | gcc-4377fad9da8478d4683dd7412459fe4d7bbd29fa.zip gcc-4377fad9da8478d4683dd7412459fe4d7bbd29fa.tar.gz gcc-4377fad9da8478d4683dd7412459fe4d7bbd29fa.tar.bz2 |
mips.c (mips_classify_symbol): Don't return SYMBOL_PC_RELATIVE for nonlocal labels.
gcc/
* config/mips/mips.c (mips_classify_symbol): Don't return
SYMBOL_PC_RELATIVE for nonlocal labels.
From-SVN: r168874
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/config/mips/mips.c | 11 |
2 files changed, 12 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 105d5a4..a3706fb 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2011-01-16 Richard Sandiford <rdsandiford@googlemail.com> + + * config/mips/mips.c (mips_classify_symbol): Don't return + SYMBOL_PC_RELATIVE for nonlocal labels. + 2011-01-15 Eric Botcazou <ebotcazou@adacore.com> * config/sparc/sol2-bi.h (CC1_SPEC): Fix typo. diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c index 3570546..a534638 100644 --- a/gcc/config/mips/mips.c +++ b/gcc/config/mips/mips.c @@ -1669,10 +1669,13 @@ mips_classify_symbol (const_rtx x, enum mips_symbol_context context) if (GET_CODE (x) == LABEL_REF) { - /* LABEL_REFs are used for jump tables as well as text labels. - Only return SYMBOL_PC_RELATIVE if we know the label is in - the text section. */ - if (TARGET_MIPS16_SHORT_JUMP_TABLES) + /* Only return SYMBOL_PC_RELATIVE if we are generating MIPS16 + code and if we know that the label is in the current function's + text section. LABEL_REFs are used for jump tables as well as + text labels, so we must check whether jump tables live in the + text section. */ + if (TARGET_MIPS16_SHORT_JUMP_TABLES + && !LABEL_REF_NONLOCAL_P (x)) return SYMBOL_PC_RELATIVE; if (TARGET_ABICALLS && !TARGET_ABSOLUTE_ABICALLS) |