https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78562

            Bug ID: 78562
           Summary: Wrong warning for built-in functions with -flto
           Product: gcc
           Version: 7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: lto
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gjl at gcc dot gnu.org
  Target Milestone: ---

Created attachment 40175
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=40175&action=edit
lto.c: C test case

The attaches test case throws an incorrect warning when compiled with -flto

$ avr-gcc -mmcu=atmega8 lto.c -Os -flto

<built-in>: warning: type of '__builtin_avr_absr' does not match original
declaration [-Wlto-type-mismatch]
<built-in>: note: return value type mismatch
<built-in>: note: '__builtin_avr_abshk' was previously declared here
<built-in>: note: code may be misoptimized unless -fno-strict-aliasing is used

Using GCC from v7 trunk

Last Changed Rev: 242822
Last Changed Date: 2016-11-24 10:45:01 +0100 (Do, 24 Nov 2016)

GCC configured as

$ ../../gcc.gnu.org/trunk/configure --target=avr
--prefix=/local/gnu/install/gcc-7 --disable-shared --disable-nls --with-dwarf2
--enable-target-optspace=yes --with-gnu-as --with-gnu-ld
--enable-checking=release --enable-languages=c,c++

Reply via email to