When I run the program listed below on an Alpha workstation I get the following output:
ibad1, ibad2, igood1, igood2, loc2, loc1 = -2147483646 -2147483646 2 2 536940884 536940880 On all other platforms the value of ibad1 and ibad2 is 2. Typing gfortran -v produces the following: Using built-in specs. Target: alpha-unknown-linux-gnu Configured with: /home/mrichmon/gcc-4.4-20080704/configure --enable-languages=c,fortran --with-mpfr-include=/home/mrichmon/mpfr-2.3.1 --with-mpfr-lib=/home/mrichmon/mpfr-2.3.1/.libs --prefix=/home/mrichmon/irun --enable-checking=release Thread model: posix gcc version 4.4.0 20080704 (experimental) (GCC) PROGRAM test COMMON /com1/ i1, i2 loc1 = LOC(i1) loc2 = LOC(i2) igood1 = (loc2 - loc1)/2 igood2 = (LOC(i2) - LOC(i1))/2 ibad1 = (LOC(i2) - loc1)/2 ibad2 = (loc2 - LOC(i1))/2 print *, "ibad1, ibad2, igood1, igood2, loc2, loc1 =", ibad1,ibad2,igood1,igood2,loc2,loc1 END PROGRAM test -- Summary: LOC() produces wrong result on Alpha Linux Product: gcc Version: 4.4.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: michael dot a dot richmond at nasa dot gov http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36808