https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80428
Tom Rini <tom.rini at gmail dot com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|WAITING |RESOLVED Resolution|--- |INVALID --- Comment #2 from Tom Rini <tom.rini at gmail dot com> --- OK, digging into this quite hard I found that indeed, during SPL builds for U-Boot, the code in question (or rather, the functions that use it) are never referenced, but only some times do we generate the warning, and in other times we do not. In all cases (again, for U-Boot) we use -fdata-sections/-ffunction-sections/--gc-sections and discard. In sum, there is a bug here in that the compiler should have been issuing this warning in a lot more cases, but I do not have the time / expertise to generate a stand-alone testcase. As I was reporting this as a warning when it shouldn't warn, but it turns out to be warning when it should be warning (and _not_ warning when it _should_ be warning), I'm movinv this to resolved/invalid.