[Bug lto/62249] Spurious FORTIFY_SOURCE warning with -flto, poll
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62249 Richard Biener changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolution|--- |DUPLICATE --- Comment #6 from Richard Biener --- Duplicate. *** This bug has been marked as a duplicate of bug 61886 ***
[Bug lto/62249] Spurious FORTIFY_SOURCE warning with -flto, poll
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62249 Cristian RodrÃguez changed: What|Removed |Added CC||crrodriguez at opensuse dot org --- Comment #5 from Cristian RodrÃguez --- This bug also affects building systemd with LTO enabled.
[Bug lto/62249] Spurious FORTIFY_SOURCE warning with -flto, poll
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62249 --- Comment #4 from Zack Weinberg --- The "delta-minimized self-contained test case" should require only `-O2 -flto` to reproduce the problem. The other test case, however, should require `-D_FORTIFY_SOURCE=2` in addition, and to be compiled against recent glibc. Note also that this does not happen with 4.8 or older.
[Bug lto/62249] Spurious FORTIFY_SOURCE warning with -flto, poll
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62249 Ilya Palachev changed: What|Removed |Added CC||i.palachev at samsung dot com --- Comment #3 from Ilya Palachev --- The bug reproduces for me even without -D_FORTIFY_SOURCE=2.
[Bug lto/62249] Spurious FORTIFY_SOURCE warning with -flto, poll
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62249 --- Comment #2 from Zack Weinberg --- Incidentally, yes, the test case is based on a real program.
[Bug lto/62249] Spurious FORTIFY_SOURCE warning with -flto, poll
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62249 --- Comment #1 from Zack Weinberg --- Created attachment 33389 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=33389&action=edit Delta-minimized self-contained test case Requires no headers anymore. Delta-minimization revealed something interesting: int __poll_chk (struct pollfd *, unsigned, int, unsigned); int __poll_chk_warn (struct pollfd *, unsigned, int, unsigned) __asm__ ("__poll_chk") __attribute__ ((__warning__ ("poll called with fds buffer too small"))); The __asm__("__poll_chk") annotation is essential; if it's removed the bug goes away. I don't know anything about the guts of LTO, but to me that suggests a bug in its unification of function decls, rather than a bug in dead-code removal.