This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug target/36241] Executable compiled with -m64 almost three times faster than the one compiled with -m32 on Core2Duo



------- Comment #4 from kargl at gcc dot gnu dot org  2009-06-15 18:44 -------
(In reply to comment #3)
> This is not darwin-specific, I also see it happening on x86_64-linux.
> 
> And what's more, the output changes between -m32 and -m64.

The code is invalid Fortran, so gfortran is not required to give
any sensible output.

> $ cat u.f90
> integer(8), parameter :: l = z'5fe6eb3be0000000'
> integer, parameter :: ni = 3
> integer :: i, j, n
> integer(8) :: k
> real(8) :: a, b, e, m, s
> equivalence (b, k)
> a = 1.0d0
> e = epsilon(1.0)/2.0d0**4
> m = 0.0d0
> s = 0.0d0
> n = 0
> do
>   n = n + 1
>   b = a

When you do the assignment to b, k is/becomes undefined.

>   k = l - ishft(k, -1_8)

When you do the assignment to k, b becomes undefined.
Not to mention, that the RHS uses k, which is undefined.

See Section 14.7.6 (1) and (9).


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36241


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]