http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47008
Summary: [4.6 Regression] gfortran.dg/extends_2.f03 FAIL with -Os -fschedule-insns Product: gcc Version: 4.6.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: rtl-optimization AssignedTo: unassig...@gcc.gnu.org ReportedBy: zso...@seznam.cz Host: x86_64-pc-linux-gnu Target: x86_64-pc-linux-gnu Created attachment 22814 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=22814 reduced testcase Output: $ gfortran -Os -fno-asynchronous-unwind-tables -fno-inline-functions-called-once -fschedule-insns testcase.f03 $ ./a.out Aborted $ gfortran -Os -fno-asynchronous-unwind-tables -fno-inline-functions-called-once -fschedule-insns extends_2.f03 $ ./a.out Aborted $ gfortran -Os -fno-asynchronous-unwind-tables -fno-inline-functions-called-once -fschedule-insns -fsched-pressure extends_3.f03 $ ./a.out Aborted For testcase.f03, in the assembly, the problem is there: # store 123455 to [rsp+8], &supervisor == rsp+8 mov DWORD PTR [rsp+8], 123455 # person.1.ss, lea rsi, [rsp+8] # tmp64, # rsp -= 8 (parameter for entry() ?) push 0 # # &supervisor == rsp+8+8 == rsp+16 mov eax, 538976288 # tmp67, # loads old value of &supervisor(+4) lea rdx, [rsp+12] # tmp65, lea rbx, [rsp+56] # tmp72, mov rdi, rdx # tmp66, tmp65 mov edx, OFFSET FLAT:.LC3 #, # starts storing 4 bytes under previously used &supervisor, overwrites 123455 rep stosd Tested revisions (for reduced testcase): r168026 - fail r165699 - OK 4.5 r166509 - OK