https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69195
Bug ID: 69195 Summary: [4.9/5/6 Regression] gcc.dg/torture/pr44913.c FAILs with -O3 -fno-dce -fno-forward-propagate Product: gcc Version: 6.0 Status: UNCONFIRMED Keywords: wrong-code Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: zsojka at seznam dot cz Target Milestone: --- Host: x86_64-pc-linux-gnu Target: powerpc64-unknown-linux-gnu Created attachment 37273 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=37273&action=edit reduced testcase (gcc.dg/torture/pr44913.c) Output: (qemu user emulation is used) $ powerpc64-unknown-linux-gnu-gcc -O3 -fno-dce -fno-forward-propagate testcase.c $ ./a.out Invalid data memory access: 0x0000002c00000050 NIP 0000000010000e60 LR 00000000100015e8 CTR 0000000010000e20 XER 0000000000000000 CPU#0 MSR 8000000002806000 HID0 0000000000000000 HF 0000000002806000 idx 0 TB 00142866 613604922925824 GPR00 000000090000000a 00000040007ff3a0 00000000100bea00 0000000000000001 GPR04 000000000000000d 0000000d0000000e 0000000f00000010 0000000100000002 GPR08 0000000600000006 0000002c00000050 0000001000000018 0000000b0000000c GPR12 0000000700000008 00000000100c0750 0000000000000000 0000000000000000 GPR16 0000000000000000 0000000000000000 0000000000000000 0000000000000000 GPR20 0000000000000000 0000000000000000 0000000000000000 0000000000000000 GPR24 0000000000000000 0000000000000000 0000000000000000 0000000000000000 GPR28 00000000100b1b70 00000000100b1b58 00000000100b6e08 00000000100002e8 CR 28000042 [ E L - - - - G E ] RES ffffffffffffffff FPR00 0000000000000000 0000000000000000 0000000000000000 0000000000000000 FPR04 0000000000000000 0000000000000000 0000000000000000 0000000000000000 FPR08 0000000000000000 0000000000000000 0000000000000000 0000000000000000 FPR12 0000000000000000 0000000000000000 0000000000000000 0000000000000000 FPR16 0000000000000000 0000000000000000 0000000000000000 0000000000000000 FPR20 0000000000000000 0000000000000000 0000000000000000 0000000000000000 FPR24 0000000000000000 0000000000000000 0000000000000000 0000000000000000 FPR28 0000000000000000 0000000000000000 0000000000000000 0000000000000000 FPSCR 0000000000000000 qemu: uncaught target signal 11 (Segmentation fault) - core dumped Segmentation fault (gdb) disassemble ... 0x0000000010000e54 <+52>: ld r0,32(r9) 0x0000000010000e58 <+56>: ld r9,88(r9) 0x0000000010000e5c <+60>: stdu r1,-256(r1) => 0x0000000010000e60 <+64>: ld r31,0(r9) 0x0000000010000e64 <+68>: std r31,176(r1) 0x0000000010000e68 <+72>: ld r31,8(r9) 0x0000000010000e6c <+76>: addi r3,r1,184 ... (gdb) info reg ... r9 0x2c00000050 188978561104 ... The load at 0x0000000010000e58 clobbers r9, which is still later used to load values for a[]/r[] initialisation. Only the powerpc64 target seems to be affected. Tested revisions: trunk r232129 - FAIL 5-branch r232044 - FAIL 4_9-branch r232043 - FAIL 4_8-branch r224828 - FAIL 4_7-branch r211571 - FAIL 4_6-branch r197894 - OK 4_5-branch r189152 - OK 4_4-branch r185318 - OK