Re: builtins-error.c test fails for avr

Georg-Johann Lay <[email protected]>
Newsgroups gmane.comp.hardware.avr.gcc
Message-ID <[email protected]>
Am 04/21/2015 um 09:17 AM schrieb Sivanupandi, Pitchumani:
> Hi,
>
> Test gcc.target/avr/torture/builtins-error.c is failed in gcc-4.9 and trunk for -Os -flto options.
> This test expects error for compile time constant. Option flto delays the builtin expand
> (to link time??) and there is no error. Can this test be skipped for above option?
>
> If -ffat-lto-objects option used then avr-gcc gives the error.
>
> Regards,
> Pitchumani

Without fat LTO objects, the compiler just puts gimple IR into the objects, 
there is no asm code.  Built-in functions are represented by their decls as 
provided by targetm.builtin_decl().  This means there is no expansion of tree 
to rtl.
That expansion is as late as possible (in principle it could even be in some 
rtl pass; the assumption is that if the respective value has not been resolved 
to integer_cst then the same applies to later passes.

A fix could be to add a trivial main and run the program, maybe also add used 
attributes to the functions.

Or simply adding -ffat-lto-objects or switching from do-assemble to do-link.

Johann
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.