aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorGeorg-Johann Lay <avr@gjlay.de>2024-12-07 19:54:02 +0100
committerGeorg-Johann Lay <avr@gjlay.de>2024-12-07 19:54:02 +0100
commit68e64c45380e42657ece999c9fe5b68044847e49 (patch)
treeb379f812a33d1f181b0eec4c9dc04d4bcd868f84 /gcc
parent41800372146f5ad15a8796b37f54965f78cc14fb (diff)
downloadgcc-68e64c45380e42657ece999c9fe5b68044847e49.zip
gcc-68e64c45380e42657ece999c9fe5b68044847e49.tar.gz
gcc-68e64c45380e42657ece999c9fe5b68044847e49.tar.bz2
AVR: Better location for late (during final) diagnostic.
gcc/ * config/avr/avr.cc (avr_print_operand_address): Use avr_insn_location as location for late (during final) diagnostic.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/config/avr/avr.cc16
1 files changed, 11 insertions, 5 deletions
diff --git a/gcc/config/avr/avr.cc b/gcc/config/avr/avr.cc
index 3544571..7c77367 100644
--- a/gcc/config/avr/avr.cc
+++ b/gcc/config/avr/avr.cc
@@ -2538,11 +2538,17 @@ avr_print_operand_address (FILE *file, machine_mode /*mode*/, rtx addr)
fprintf (file, "+" HOST_WIDE_INT_PRINT_DEC ")",
2 * INTVAL (XEXP (x, 1)));
if (AVR_3_BYTE_PC)
- if (warning (0, "pointer offset from symbol maybe incorrect"))
- {
- output_addr_const (stderr, addr);
- fprintf (stderr, "\n");
- }
+ {
+ location_t loc = avr_insn_location != UNKNOWN_LOCATION
+ ? avr_insn_location
+ : input_location;
+ if (warning_at (loc, 0, "pointer offset from symbol may be"
+ " incorrect"))
+ {
+ output_addr_const (stderr, addr);
+ fprintf (stderr, "\n");
+ }
+ }
}
else
{