diff options
author | Georg-Johann Lay <avr@gjlay.de> | 2012-05-14 15:47:52 +0000 |
---|---|---|
committer | Georg-Johann Lay <gjl@gcc.gnu.org> | 2012-05-14 15:47:52 +0000 |
commit | 5bb53d1a1dc6cfa55cbca53cf72a8bdf017da834 (patch) | |
tree | dba3368294d8e75054d91571daa64b9c209138fb /gcc/config/avr/avr.c | |
parent | 6ba840107af2f446cc76dcfc1496eb1932c6351d (diff) | |
download | gcc-5bb53d1a1dc6cfa55cbca53cf72a8bdf017da834.zip gcc-5bb53d1a1dc6cfa55cbca53cf72a8bdf017da834.tar.gz gcc-5bb53d1a1dc6cfa55cbca53cf72a8bdf017da834.tar.bz2 |
re PR target/53344 (Dont' emit an assembler warning when assembling 3-byte symbols)
PR target/53344
* config/avr/avr.c (avr_const_address_lo16): Remove.
(avr_assemble_integer): Print ".byte lo8(x)",
".byte hi8(x)", ".byte hh8(x)" instead of emit an assembler
.warning if 3-byte address is assembled.
* doc/extend.texi (AVR Named Address Spaces): Document that
binutils 2.23 is needed to assemble 3-byte addresses.
From-SVN: r187470
Diffstat (limited to 'gcc/config/avr/avr.c')
-rw-r--r-- | gcc/config/avr/avr.c | 60 |
1 files changed, 10 insertions, 50 deletions
diff --git a/gcc/config/avr/avr.c b/gcc/config/avr/avr.c index 5b28096..38afc7a 100644 --- a/gcc/config/avr/avr.c +++ b/gcc/config/avr/avr.c @@ -6639,48 +6639,6 @@ _reg_unused_after (rtx insn, rtx reg) } -/* Return RTX that represents the lower 16 bits of a constant address. - Unfortunately, simplify_gen_subreg does not handle this case. */ - -static rtx -avr_const_address_lo16 (rtx x) -{ - rtx lo16; - - switch (GET_CODE (x)) - { - default: - break; - - case CONST: - if (PLUS == GET_CODE (XEXP (x, 0)) - && SYMBOL_REF == GET_CODE (XEXP (XEXP (x, 0), 0)) - && CONST_INT_P (XEXP (XEXP (x, 0), 1))) - { - HOST_WIDE_INT offset = INTVAL (XEXP (XEXP (x, 0), 1)); - const char *name = XSTR (XEXP (XEXP (x, 0), 0), 0); - - lo16 = gen_rtx_SYMBOL_REF (Pmode, ggc_strdup (name)); - lo16 = gen_rtx_CONST (Pmode, plus_constant (Pmode, lo16, offset)); - - return lo16; - } - - break; - - case SYMBOL_REF: - { - const char *name = XSTR (x, 0); - - return gen_rtx_SYMBOL_REF (Pmode, ggc_strdup (name)); - } - } - - avr_edump ("\n%?: %r\n", x); - gcc_unreachable(); -} - - /* Target hook for assembling integer objects. The AVR version needs special handling for references to certain labels. */ @@ -6688,7 +6646,7 @@ static bool avr_assemble_integer (rtx x, unsigned int size, int aligned_p) { if (size == POINTER_SIZE / BITS_PER_UNIT && aligned_p - && text_segment_operand (x, VOIDmode) ) + && text_segment_operand (x, VOIDmode)) { fputs ("\t.word\tgs(", asm_out_file); output_addr_const (asm_out_file, x); @@ -6698,17 +6656,19 @@ avr_assemble_integer (rtx x, unsigned int size, int aligned_p) } else if (GET_MODE (x) == PSImode) { - default_assemble_integer (avr_const_address_lo16 (x), - GET_MODE_SIZE (HImode), aligned_p); + /* This needs binutils 2.23+, see PR binutils/13503 */ + + fputs ("\t.byte\tlo8(", asm_out_file); + output_addr_const (asm_out_file, x); + fputs (")" ASM_COMMENT_START "need binutils PR13503\n", asm_out_file); - fputs ("\t.warning\t\"assembling 24-bit address needs binutils" - " extension for hh8(", asm_out_file); + fputs ("\t.byte\thi8(", asm_out_file); output_addr_const (asm_out_file, x); - fputs (")\"\n", asm_out_file); + fputs (")" ASM_COMMENT_START "need binutils PR13503\n", asm_out_file); - fputs ("\t.byte\t0\t" ASM_COMMENT_START " hh8(", asm_out_file); + fputs ("\t.byte\thh8(", asm_out_file); output_addr_const (asm_out_file, x); - fputs (")\n", asm_out_file); + fputs (")" ASM_COMMENT_START "need binutils PR13503\n", asm_out_file); return true; } |