https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81569
Bug ID: 81569 Summary: gcc.guality tests fail with -flto option Product: gcc Version: 8.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: debug Assignee: unassigned at gcc dot gnu.org Reporter: sje at gcc dot gnu.org Target Milestone: --- Host: aarch64-*-* Target: aarch64-*-* Build: aarch64-*-* Created attachment 41838 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=41838&action=edit Test case (same as gcc.dg/guality/pr45882.c) A number of gcc.guality tests like gcc.dg/guality/pr45882.c fail on aarch64 when compiled with -flto. The tests work when compiled with -O0 -g or with -O2 -g, but fail with -O2 -flto -g. I have attached the source of gcc.dg/guality/pr45882.c to this test, if you compile it and debug it and give gdb the following commands: break 16 run print e quit gdb will print 142 when debugging a program that was compiled without -flto and 0 when debugging a program compiled with -flto.