public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/57663] New: Arithmetic error with -fPIC -O
@ 2013-06-20 16:32 bardeau at iram dot fr
  2013-06-20 16:57 ` [Bug fortran/57663] " mikael at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: bardeau at iram dot fr @ 2013-06-20 16:32 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 57663
           Summary: Arithmetic error with -fPIC -O
           Product: gcc
           Version: 4.6.4
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: bardeau at iram dot fr

Created attachment 30328
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=30328&action=edit
Print is incorrect with gfortran 4.6.4

Dear gfortran developers,

the attached Fortran program fails to make a correct comparison and then prints
an erroneous value if compiled as follows with gfortran 4.6.4:

home/bardeau> gfortran -fPIC -O test.f90 -o test && ./test
 >>>  -5.71989641833856102E-002

This is true for gfortran 4.6.3 and 4.6.4 with options -fPIC and -O. gfortran
4.7.0 and above do not seem affected. Under normal conditions, the printout
should be:

home/bardeau> gfortran test.f90 -o test && ./test
 >>>   0.20000000000000001

I use gfortran 4.6.4 which I compiled myself (see below). However, I was first
reported this bug under Ubuntu 12.04.2 LTS 64 bit with gfortran 4.6.3-1ubuntu5.

It seems that the gcc 4.6 branch is still receiving bug fixes, so could you
have a look?

Thank you,

Sebastien


home/bardeau> uname -a
Linux bardeau 2.6.32-358.2.1.el6.x86_64 #1 SMP Tue Mar 12 14:18:09 CDT 2013
x86_64 x86_64 x86_64 GNU/Linux

home/bardeau> gfortran -v
Using built-in specs.
COLLECT_GCC=gfortran
COLLECT_LTO_WRAPPER=/home/bardeau/Softs/gcc-4.6.4/libexec/gcc/x86_64-unknown-linux-gnu/4.6.4/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ./configure --with-gmp=/home/bardeau/Softs
--prefix=/home/bardeau/Softs/gcc-4.6.4 --enable-languages=c,c++,fortran
Thread model: posix
gcc version 4.6.4 (GCC)


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug fortran/57663] Arithmetic error with -fPIC -O
  2013-06-20 16:32 [Bug fortran/57663] New: Arithmetic error with -fPIC -O bardeau at iram dot fr
@ 2013-06-20 16:57 ` mikael at gcc dot gnu.org
  2013-06-21  7:42 ` bardeau at iram dot fr
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: mikael at gcc dot gnu.org @ 2013-06-20 16:57 UTC (permalink / raw)
  To: gcc-bugs

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

Mikael Morin <mikael at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
                 CC|                            |mikael at gcc dot gnu.org
         Resolution|---                         |WONTFIX

--- Comment #1 from Mikael Morin <mikael at gcc dot gnu.org> ---
(In reply to Sebastien Bardeau from comment #0)
> It seems that the gcc 4.6 branch is still receiving bug fixes, so could you
> have a look?
> 
Unfotunately no; the 4.6 branch has been closed since april.
See http://gcc.gnu.org/ml/gcc/2013-04/msg00132.html


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug fortran/57663] Arithmetic error with -fPIC -O
  2013-06-20 16:32 [Bug fortran/57663] New: Arithmetic error with -fPIC -O bardeau at iram dot fr
  2013-06-20 16:57 ` [Bug fortran/57663] " mikael at gcc dot gnu.org
@ 2013-06-21  7:42 ` bardeau at iram dot fr
  2013-06-21  8:21 ` dominiq at lps dot ens.fr
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: bardeau at iram dot fr @ 2013-06-21  7:42 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Sebastien Bardeau <bardeau at iram dot fr> ---
(In reply to Mikael Morin from comment #1)
> (In reply to Sebastien Bardeau from comment #0)
> > It seems that the gcc 4.6 branch is still receiving bug fixes, so could you
> > have a look?
> > 
> Unfotunately no; the 4.6 branch has been closed since april.
> See http://gcc.gnu.org/ml/gcc/2013-04/msg00132.html

I missed this, it might be good to add this information on this page:
http://gcc.gnu.org/gcc-4.6/

Is there any chance that someone has a look to this bug? I did not test all
gcc/gfortran versions, so I am 100% sure that this a 4.6-only issue.
Furthermore, ideally I would like to know when it appeared and when it was
fixed, in order to warn my users...

Thank you.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug fortran/57663] Arithmetic error with -fPIC -O
  2013-06-20 16:32 [Bug fortran/57663] New: Arithmetic error with -fPIC -O bardeau at iram dot fr
  2013-06-20 16:57 ` [Bug fortran/57663] " mikael at gcc dot gnu.org
  2013-06-21  7:42 ` bardeau at iram dot fr
@ 2013-06-21  8:21 ` dominiq at lps dot ens.fr
  2013-07-04 12:11 ` bardeau at iram dot fr
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: dominiq at lps dot ens.fr @ 2013-06-21  8:21 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
> Is there any chance that someone has a look to this bug? 

No, but you can do it yourself.

> I did not test all gcc/gfortran versions, so I am 100% sure that 
> this a 4.6-only issue. Furthermore, ideally I would like to know 
> when it appeared and when it was fixed, in order to warn my users...

Introduced between revisions 167584 (2010-12-08) and 167992 (2010-12-17), fixed
between revisions 171100 (2011-03-17) and 171653 (2011-03-29).


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug fortran/57663] Arithmetic error with -fPIC -O
  2013-06-20 16:32 [Bug fortran/57663] New: Arithmetic error with -fPIC -O bardeau at iram dot fr
                   ` (2 preceding siblings ...)
  2013-06-21  8:21 ` dominiq at lps dot ens.fr
@ 2013-07-04 12:11 ` bardeau at iram dot fr
  2013-07-04 14:51 ` dominiq at lps dot ens.fr
  2013-07-04 15:16 ` bardeau at iram dot fr
  5 siblings, 0 replies; 7+ messages in thread
From: bardeau at iram dot fr @ 2013-07-04 12:11 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Sebastien Bardeau <bardeau at iram dot fr> ---
(In reply to Dominique d'Humieres from comment #3)
> > Is there any chance that someone has a look to this bug? 
> 
> No, but you can do it yourself.

Well, I am "only" a Fortran programmer, I have no idea of how the GNU compilers
are written...


> > I did not test all gcc/gfortran versions, so I am 100% sure that 
> > this a 4.6-only issue. Furthermore, ideally I would like to know 
> > when it appeared and when it was fixed, in order to warn my users...
> 
> Introduced between revisions 167584 (2010-12-08) and 167992 (2010-12-17),
> fixed between revisions 171100 (2011-03-17) and 171653 (2011-03-29).

This helps. After more tests I could find that:

167778 (4.6.0 20101214): OK
167779 (4.6.0 20101214): NOK <= bug added here
...
171235 (4.7.0 20110321): NOK
171236 (4.7.0 20110321): OK  <= bug fixed here

The bug was fixed in 4.7.0 prerelease, so the 4.7 branch and above are not
affected. Obviously the patch 171236 was not ported to the 4.6 branch since its
latest release has the bug.

On the other hand, the bug was added in 4.6.0 prerelease, which explains why
the 4.6 branch is corrupted. Now I do not know how to check if the revision
167779 was ported to other (e.g. 4.5) branches.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug fortran/57663] Arithmetic error with -fPIC -O
  2013-06-20 16:32 [Bug fortran/57663] New: Arithmetic error with -fPIC -O bardeau at iram dot fr
                   ` (3 preceding siblings ...)
  2013-07-04 12:11 ` bardeau at iram dot fr
@ 2013-07-04 14:51 ` dominiq at lps dot ens.fr
  2013-07-04 15:16 ` bardeau at iram dot fr
  5 siblings, 0 replies; 7+ messages in thread
From: dominiq at lps dot ens.fr @ 2013-07-04 14:51 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
> Well, I am "only" a Fortran programmer, I have no idea of how 
> the GNU compilers are written...

Obviously you know how to build gfortran, so can either try to revert r167779
or apply r171236. However in my opinion you'll do a better use of your time by
building either 4.8.1 or trunk (4.9.0).


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug fortran/57663] Arithmetic error with -fPIC -O
  2013-06-20 16:32 [Bug fortran/57663] New: Arithmetic error with -fPIC -O bardeau at iram dot fr
                   ` (4 preceding siblings ...)
  2013-07-04 14:51 ` dominiq at lps dot ens.fr
@ 2013-07-04 15:16 ` bardeau at iram dot fr
  5 siblings, 0 replies; 7+ messages in thread
From: bardeau at iram dot fr @ 2013-07-04 15:16 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Sebastien Bardeau <bardeau at iram dot fr> ---
(In reply to Dominique d'Humieres from comment #5)
> > Well, I am "only" a Fortran programmer, I have no idea of how 
> > the GNU compilers are written...
> 
> Obviously you know how to build gfortran, so can either try to revert
> r167779 or apply r171236. However in my opinion you'll do a better use of
> your time by building either 4.8.1 or trunk (4.9.0).

Well, I do use the latest(s) gfortran for my own use.

Maybe I should have added the context: I am involved in a scientific software
which is compiled by our users from sources. The problem is that they face a
large variety of compilers and versions, including e.g. gfortran 4.6 on Ubuntu
12 LTS. Since this bug makes our software produce wrong results, I have no
better choice than detect and discard affected gfortran versions at compilation
time. This is why I am searching for the exact range of versions affected.


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2013-07-04 15:16 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-20 16:32 [Bug fortran/57663] New: Arithmetic error with -fPIC -O bardeau at iram dot fr
2013-06-20 16:57 ` [Bug fortran/57663] " mikael at gcc dot gnu.org
2013-06-21  7:42 ` bardeau at iram dot fr
2013-06-21  8:21 ` dominiq at lps dot ens.fr
2013-07-04 12:11 ` bardeau at iram dot fr
2013-07-04 14:51 ` dominiq at lps dot ens.fr
2013-07-04 15:16 ` bardeau at iram dot fr

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).