diff options
author | rms <rms@138bc75d-0d04-0410-961f-82ee72b054a4> | 1992-07-02 19:24:17 +0000 |
---|---|---|
committer | rms <rms@138bc75d-0d04-0410-961f-82ee72b054a4> | 1992-07-02 19:24:17 +0000 |
commit | 376f76318a998fa7097fa43b94b2fcd6dba5569b (patch) | |
tree | 4b597b8eaecccff83cc8bffd92f8e2284fc3dd94 /gcc/halfpic.c | |
parent | 394e0b09d52c333dd6a91753f05458021abf4ca4 (diff) | |
download | gcc-376f76318a998fa7097fa43b94b2fcd6dba5569b.tar.gz |
*** empty log message ***
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@1386 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/halfpic.c')
-rw-r--r-- | gcc/halfpic.c | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/gcc/halfpic.c b/gcc/halfpic.c index fdbaccd2ee0..4e165fdaf47 100644 --- a/gcc/halfpic.c +++ b/gcc/halfpic.c @@ -209,14 +209,26 @@ half_pic_encode (decl) if (code != VAR_DECL && code != FUNCTION_DECL) return; - /* If this is not an external reference, it can't be half-pic. */ - if (!TREE_EXTERNAL (decl)) - return; - asm_name = DECL_ASSEMBLER_NAME (decl); + if (!asm_name) return; +#ifdef HALF_PIC_DEBUG + if (HALF_PIC_DEBUG) + { + if (HALF_PIC_DEBUG) + fprintf (stderr, "\n========== Half_pic_encode %.*s\n", + IDENTIFIER_LENGTH (asm_name), + IDENTIFIER_POINTER (asm_name)); + debug_tree (decl); + } +#endif + + /* If this is not an external reference, it can't be half-pic. */ + if (!TREE_EXTERNAL (decl) && (code != VAR_DECL || !TREE_PUBLIC (decl))) + return; + ptr = half_pic_hash (IDENTIFIER_POINTER (asm_name), IDENTIFIER_LENGTH (asm_name), TRUE); @@ -225,7 +237,7 @@ half_pic_encode (decl) #ifdef HALF_PIC_DEBUG if (HALF_PIC_DEBUG) - fprintf (stderr, "\n========== Half_pic_encode %.*s\n", + fprintf (stderr, "\n%.*s is half-pic\n", IDENTIFIER_LENGTH (asm_name), IDENTIFIER_POINTER (asm_name)); #endif @@ -277,7 +289,7 @@ half_pic_address_p (addr) case CONST: { rtx offset = const0_rtx; - addr = eliminate_constant_term (addr, &offset); + addr = eliminate_constant_term (XEXP (addr, 0), &offset); if (GET_CODE (addr) != SYMBOL_REF) return FALSE; } |