From: Georg-Johann Lay Date: Sun, 16 Feb 2025 16:20:39 +0000 (+0100) Subject: AVR: ad target/118764 - Let -mcvt set built-in macro __AVR_CVT__ X-Git-Tag: basepoints/gcc-16~1975 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=22a0cba3c5a24860205086e98c0dae56f50422c1;p=thirdparty%2Fgcc.git 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 --git a/gcc/config/avr/avr-c.cc b/gcc/config/avr/avr-c.cc index 6f49d3f98a0..9176a49bc44 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 d1d633beb4b..ca8e468f3f2 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.