http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50678
--- Comment #23 from Eric Botcazou <ebotcazou at gcc dot gnu.org> 2011-10-12 18:04:00 UTC --- It turns out that Tom's patch is innocent, you can reproduce the problem at the preceding revision if you compiled at -O1 instead of -O2. This appears to be a problem in the signal unwinder on Darwin. Here's the status of the registers when the probe hits the guard page: Program received signal SIGSEGV, Segmentation fault. 0x0000000100002a44 in _ada_c52104y () at c52104y.adb:31 31 ARRX52 : TABOX52 ; -- BIG ARRAY HERE. (gdb) info reg rax 0x10000010 268435472 rbx 0x7fff5fbffa40 140734799804992 rcx 0x7fff5f3ffa30 140734791416368 rdx 0xf 15 rsi 0x7fff5fbffa30 140734799804976 rdi 0x7fff4fbfca30 140734531357232 rbp 0x7fff5fbffa80 0x7fff5fbffa80 rsp 0x7fff5fbffa30 0x7fff5fbffa30 r8 0x80000002 2147483650 r9 0x10000000 268435456 r10 0x80000002 2147483650 r11 0x10000001 268435457 r12 0xfffffffffffffffa -6 r13 0xd 13 r14 0x0 0 r15 0x1 1 rip 0x100002a44 0x100002a44 <_ada_c52104y+416> And here's the status of the registers when execution resumes: Breakpoint 1, 0x0000000100002aa2 in _ada_c52104y () at c52104y.adb:49 49 END C52104Y; (gdb) info reg rax 0x100100080 4296016000 rbx 0xf 15 rcx 0x7fff5f3ffa30 140734791416368 rdx 0x1 1 rsi 0x7fff5fbffa30 140734799804976 rdi 0x7fff4fbfca30 140734531357232 rbp 0x7fff5fbffa80 0x7fff5fbffa80 rsp 0x7fff5fbffa30 0x7fff5fbffa30 r8 0x80000002 2147483650 r9 0x10000000 268435456 r10 0x80000002 2147483650 r11 0x10000001 268435457 r12 0xfffffffffffffffa -6 r13 0xd 13 r14 0x0 0 r15 0x1 1 rip 0x100002aa2 0x100002aa2 <_ada_c52104y+510> Note how the value of rdx has apparently been moved to rbx; this is the bug, rbx is a call-saved register so its value is supposed to be preserved here.