aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorg-Johann Lay <avr@gjlay.de>2025-02-16 17:20:39 +0100
committerGeorg-Johann Lay <avr@gjlay.de>2025-02-16 17:32:28 +0100
commit22a0cba3c5a24860205086e98c0dae56f50422c1 (patch)
treeed31f4a3a022c5fe53203abb797a4c4b874228b6
parentd6a09ff8d81d22de2d8a701faa3fffe858638b1b (diff)
downloadgcc-22a0cba3c5a24860205086e98c0dae56f50422c1.zip
gcc-22a0cba3c5a24860205086e98c0dae56f50422c1.tar.gz
gcc-22a0cba3c5a24860205086e98c0dae56f50422c1.tar.bz2
AVR: ad target/118764 - Let -mcvt set built-in macro __AVR_CVT__
gcc/ PR target/118764 * config/avr/avr-c.cc (avr_cpu_cpp_builtins) [TARGET_CVT]: Define __AVR_CVT__. * doc/invoke.texi (AVR Built-in Macros): Document __AVR_CVT__.
-rw-r--r--gcc/config/avr/avr-c.cc3
-rw-r--r--gcc/doc/invoke.texi6
2 files changed, 8 insertions, 1 deletions
diff --git a/gcc/config/avr/avr-c.cc b/gcc/config/avr/avr-c.cc
index 6f49d3f..9176a49 100644
--- a/gcc/config/avr/avr-c.cc
+++ b/gcc/config/avr/avr-c.cc
@@ -420,6 +420,9 @@ avr_cpu_cpp_builtins (cpp_reader *pfile)
if (TARGET_RMW)
cpp_define (pfile, "__AVR_ISA_RMW__");
+ if (TARGET_CVT)
+ cpp_define (pfile, "__AVR_CVT__");
+
cpp_define_formatted (pfile, "__AVR_SFR_OFFSET__=0x%x",
avr_arch->sfr_offset);
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index d1d633b..ca8e468 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -24468,7 +24468,7 @@ XJMP exit
Instead, put @code{main} in section
@w{@uref{https://avrdudes.github.io/avr-libc/avr-libc-user-manual/mem_sections.html#sec_dot_init,@code{.init9}}}
so that no call is required.
-By setting this options the user asserts that @code{main} will not return.
+By setting this option the user asserts that @code{main} will not return.
This option can be used for devices with very limited resources in order
to save a few bytes of code and stack space. It will work as expected since
@@ -24834,6 +24834,10 @@ is defined to @code{atmega8}.
If @var{device} is not a device but only a core architecture like
@samp{avr51}, this macro is not defined.
+@item __AVR_CVT__
+The code is being compiled with option @code{-mcvt} to use a
+@emph{compact vector table}.
+
@item __AVR_XMEGA__
The device / architecture belongs to the XMEGA family of devices.