From: Richard Stallman Date: Thu, 2 Jul 1992 19:24:17 +0000 (+0000) Subject: *** empty log message *** X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=44e577003a1eb72211cb667c9536360a0ef47060;p=gcc.git *** empty log message *** From-SVN: r1386 --- 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; }