http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47037
Changpeng Fang <changpeng.fang at amd dot com> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|465.tonto Segmentation |465.tonto Segmentation |Fault in memset |Fault in memset with | |-fcaller-saves (default at | |-O2 or higher) --- Comment #3 from Changpeng Fang <changpeng.fang at amd dot com> 2010-12-23 18:05:02 UTC --- .LBB633: .loc 1 967 0 discriminator 2 movq %r13, %rdx movq %rbx, %rsi movq %rsp, %rdi call memcpy movl $128, %edx leaq (%rsp,%r13), %rdi ## <---- bad address movl $32, %esi subq %r13, %rdx movq %rsp, %r12 call memset jmp .L707 .LVL646: .p2align 4,,10 .p2align 3 Actually, the segfault is in copying label to symbol at line 967: character(128) :: symbol symbol = label(1:lensym) The memset is to set the remainder of the 128 bytes to ZEROs. The local code seems good to me. It might be that the %rsp is not appropriately set. Anyway, it is not likely to be a fortran bug because it only occurs at -O2 or higher when -fcaller-saves is turned on,