http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50790
Tobias Burnus <burnus at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |burnus at gcc dot gnu.org Component|fortran |middle-end --- Comment #1 from Tobias Burnus <burnus at gcc dot gnu.org> 2011-10-19 15:23:55 UTC --- -fdump-tree-original: static integer(kind=4) C.1534 = 3 / 0; _gfortran_transfer_integer_write (&dt_parm.0, &C.1534, 4); It gives with 4.7 the ICE: internal compiler error: in copy_constant, at varasm.c:3031 I think it is - at least in general - not be detectable in the front end but only in the ME. A similar C test case works (cf. below for a simpler version); I think there is no compiler option to print a warning -- at least -Wall -Wextra don't. int main () { int i = 3; printf ("%d\n", 3/(i-i)); return 0; }