See http://gcc.gnu.org/ml/fortran/2008-11/msg00398.html for details.
With some gfortran allocatation patch, the middle end generates invalid GIMPLE at any optimization level (but -O0). The difference between two -fdump-tree-original (-O0 and with optimization) looks as follows: ERRMSG.12 = &"Attempt to deallocate an unallocated object"[1]{lb: 1 sz: 1}; - ERRMSG.12 = stat.11 != 0 ? (void) __builtin_memcpy ((void *) &err, (void *) ERRMSG.12, 30) : (void) 0; + ERRMSG.12 = stat.11 != 0 ? err = *(character(kind=1)[1:30] * {ref-all}) ERRMSG.12 : (void) 0; The invalid GIMPLE later generates an ICE of the kind: a.f90:16: internal compiler error: verify_gimple failed Richard wrote: > (see builtins.c:fold_builtin_memory_op) -- Summary: fold_builtin_memory_op generates invalid GIMPLE Product: gcc Version: 4.4.0 Status: UNCONFIRMED Keywords: ice-on-valid-code Severity: normal Priority: P3 Component: middle-end AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: burnus at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38336