------- Comment #7 from sje at cup dot hp dot com 2010-04-15 23:47 ------- Since the failure requires -O1 as well as -fbounds-check I tried turning off various -O1 optimizations. I could turn off everything (and still get the bug) except if I use -fno-tree-dominator-opts or -fno-guess-branch-probability. If I use either of these flags the bug does not happen. I think something is happening related to the fact that _gfortran_runtime_error_at is marked as 'NORETURN' that is causing a bad optimization. It may be related to making registers as REG_DEAD but I haven't found a place where I think this marking is actually wrong yet.
-- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42169