[arch-general] gcc broken - Arch specific, applying optimization incorrectly - may explain unexplained problems
David C. Rankin
drankinatty at suddenlinkmail.com
Tue Mar 13 06:36:40 UTC 2018
Houston -- we have a problem.
The problem is gcc is mis-applying optimizations, and it seems Arch
specific. See discussion:
[Why does not execute printf inside function?]
The basic issue can be summarized in this short snippet:
printf ("In func\n");
int main (void)
Compile (with or without optimization) and the output on Archlinux (all
packages current as of 1hr ago) and you get:
That is wrong. `func()` has been completely optimized out of the procedure
in main(). The assembly generated omits any call to func. (full assembly
posted as part of the answer on SO)
Debian gcc 7.3 does not exhibit this same behavior. I do not know where to
start looking to find why this is happening, but it does not take much of a
stretch to see how this could be the root cause of some of the "unexplained"
errors I and others have seen in the past few days on Arch.
Let me know if I need to file a bug here. Since it "works on Debian" and not
here, I suspect the bug should start here and so the default optimization we
package with can be eliminated.
What say the devs?
David C. Rankin, J.D.,P.E.
More information about the arch-general