https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95558
Alexander Monakov <amonakov at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |amonakov at gcc dot gnu.org, | |marxin at gcc dot gnu.org Component|middle-end |ipa Keywords| |wrong-code --- Comment #1 from Alexander Monakov <amonakov at gcc dot gnu.org> --- All functions are incorrectly discovered to be pure, and then the loop that only makes calls to non-weak pure functions is eliminated. Minimal testcase for the root issue, wrong warning with -O2 -Wsuggest-attribute=pure: static void dummy(){} void weak() __attribute__((weak,alias("dummy"))); int foo() { weak(); return 0; }