https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85893
Bug ID: 85893 Summary: [regression] Variables promoted to Gimple registers by aliasing are not getting debug statements (if -flto used). Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: lto Assignee: unassigned at gcc dot gnu.org Reporter: jason.vas.dias at gmail dot com CC: marxin at gcc dot gnu.org Target Milestone: --- After building gcc-5-branch, gcc-6-branch, and gcc-7-branch, on an x86_64 Linux glibc-2.17 + binutils 2.30 (also on a glibc-2.27 + binutils 2.30 system), they all fail the gcc.dg/guality/pr41616-1.C testsuite test with any '-flto' enabling arguments: Without -flto enabled, the tests pass: ../xgcc -B../gcc/ ../gcc.dg/guality/pr41616-1.c ...\ -flto -fno-use-linker-plugin -flto-partition=none \ -O2 -g -fgnu89-inline -lm -o ./pr41616-1.exe spawn [open ...] PASS: b is -1 PASS: b is 1 PASS: 2 PASS, 0 FAIL, 0 UNRESOLVED PASS: gcc.dg/guality/pr41616-1.c -O2 -flto -fno-use-linker-plugin -flto-partition=none execution test ... With -flto enabled, they fail: ../xgcc -B../gcc/ ../gcc.dg/guality/pr41616-1.c ...\ -flto -fuse-linker-plugin -fno-fat-lto-objects \ -O2 -g -fgnu89-inline -lm -o ./pr41616-1.exe spawn [open ...] PASS: b is -1 FAIL: b is -1, not 1 FAIL: 1 PASS, 1 FAIL, 0 UNRESOLVED FAIL: gcc.dg/guality/pr41616-1.c -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects execution test This happens with builds of gcc-5.5.0, gcc-6.4.1, and gcc-7.3.1 . All other -flto testsuite tests of these builds are passing.