Hmm ... the transformation might be correcti(?), but how should libsigsegv catch the first segmentation fault (and only this), if the check is moved in the resulting assembler instructions out of the way? Would the volatile attribute for handler_called help here? Btw: IMHO we need an HOWTO for debugging link time optimized programs within gdb. This because with LTO the core dumps from users/customers become rather useless (IMHO).