http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49010
--- Comment #4 from Steve Kargl <sgk at troutmask dot apl.washington.edu> 2011-05-16 21:43:57 UTC --- On Mon, May 16, 2011 at 09:31:57PM +0000, sgk at troutmask dot apl.washington.edu wrote: > In F95, one finds "P = 0, the result is processor dependent." > > In F2003 and F2008, one finds "P shall not be zero." > > Consider the code, > > program foo > real, parameter :: b = 0. > real a, p, m1, m2 > a = 2. > p = 0. > m1 = mod(a, p) > m2 = mod(a, b) for the above case, I forgot to also make 'a' a parameter. so simplification did not occur. both mod and modulo is an error if both 'a' and 'b' are constants and b = 0. So, we are only missing a runtime error, which should probably be triggered with -fno-fast-math.