https://gcc.gnu.org/g:22a0cba3c5a24860205086e98c0dae56f50422c1

commit r15-7578-g22a0cba3c5a24860205086e98c0dae56f50422c1
Author: Georg-Johann Lay <a...@gjlay.de>
Date:   Sun Feb 16 17:20:39 2025 +0100

    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__.

Diff:
---
 gcc/config/avr/avr-c.cc | 3 +++
 gcc/doc/invoke.texi     | 6 +++++-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/gcc/config/avr/avr-c.cc b/gcc/config/avr/avr-c.cc
index 6f49d3f98a0b..9176a49bc44e 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 d1d633beb4bb..ca8e468f3f2d 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.

Reply via email to