This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH/RFC] SH64 EH with pic (2/4)
Joern Rennecke <joern.rennecke@superh.com> wrote:
> I understand that, what I am asking is why not use sdata4/8 for data
> labels, and use plain absptr/pcrel for text?
Ugh. I misunderstood. How does the patch below look?
It's regtested for x86 cross sh64-unknown-linux-gnu without new
failures on c and c++ testsuite.
Regards,
kaz
--
* config/sh/sh.h (ASM_PREFERRED_EH_DATA_FORMAT): Use
DW_EH_PE_sdata* for data.
(ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX): Likewise.
--- ORIG/gcc/gcc/config/sh/sh.h Thu Aug 19 12:21:08 2004
+++ LOCAL/gcc/gcc/config/sh/sh.h Fri Sep 17 18:41:50 2004
@@ -3521,19 +3521,19 @@ extern int rtx_equal_function_value_matt
#define EH_RETURN_STACKADJ_RTX gen_rtx_REG (Pmode, EH_RETURN_STACKADJ_REGNO)
/* We have to distinguish between code and data, so that we apply
- datalabel where and only where appropriate. Use textrel for code. */
+ datalabel where and only where appropriate. Use sdataN for data. */
#define ASM_PREFERRED_EH_DATA_FORMAT(CODE, GLOBAL) \
((flag_pic && (GLOBAL) ? DW_EH_PE_indirect : 0) \
- | ((CODE) ? DW_EH_PE_textrel : flag_pic ? DW_EH_PE_pcrel : DW_EH_PE_absptr))
+ | (flag_pic ? DW_EH_PE_pcrel : DW_EH_PE_absptr) \
+ | ((CODE) ? 0 : (TARGET_SHMEDIA64 ? DW_EH_PE_sdata8 : DW_EH_PE_sdata4)))
/* Handle special EH pointer encodings. Absolute, pc-relative, and
indirect are handled automatically. */
#define ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX(FILE, ENCODING, SIZE, ADDR, DONE) \
do { \
- if (((ENCODING) & 0x70) == DW_EH_PE_textrel) \
+ if (((ENCODING) & 0xf) != DW_EH_PE_sdata4 \
+ && ((ENCODING) & 0xf) != DW_EH_PE_sdata8) \
{ \
- encoding &= ~DW_EH_PE_textrel; \
- encoding |= flag_pic ? DW_EH_PE_pcrel : DW_EH_PE_absptr; \
if (GET_CODE (ADDR) != SYMBOL_REF) \
abort (); \
SYMBOL_REF_FLAGS (ADDR) |= SYMBOL_FLAG_FUNCTION; \