[MinGW-Notify] [mingw] #39715: Two possible C type double division bugs when compiling with gcc -Ofast

Back to archive index
MinGW Notification List mingw****@lists*****
Sat Nov 2 23:49:14 JST 2019


#39715: Two possible C type double division bugs when compiling with gcc -Ofast



  Open Date: 2019-11-02 23:49
Last Update: 2019-11-02 23:49

URL for this Ticket:
    https://osdn.net//projects/mingw/ticket/39715
RSS feed for this Ticket:
    https://osdn.net/ticket/ticket_rss.php?group_id=3917&tid=39715

---------------------------------------------------------------------

Last Changes/Comment on this Ticket:
2019-11-02 23:49 Updated by: colin13on
 * New Ticket "Two possible C type double division bugs when compiling with gcc
-Ofast" created



---------------------------------------------------------------------
Ticket Status:

      Reporter: colin13on
         Owner: (None)
          Type: Issues
        Status: Open
      Priority: 5 - Medium
     MileStone: (None)
     Component: (None)
      Severity: 5 - Medium
    Resolution: None
---------------------------------------------------------------------

Ticket details:

Using: MinGW GCC compiler: gcc (MinGW.org GCC-8.2.0-5) 8.2.0; Microsoft Windows
7 Professional 64 bit operating system; Lenovo Thinkpad T420 laptop 64 bit
computer.

Also tried on: GNU GCC compiler: gcc (Ubuntu 7.2.0-8ubuntu3.2) 7.2.0; Lubuntu
32 bit operating system; Samsung N220 netbook 32 bit computer.

Compiling with gcc: -O0, -O1, -O2, O3, -Os, -Og; the attached code works as
intended.

But compiling with gcc -Ofast, it sometimes calculates the wrong "a" or "x".
This behaviour seems consistent and reproducible on both the above setups,
although the wrong behaviour is slightly different on each setup.

I know essentially nothing about what the "-Ofast" option does, and don't know
whether using the "-Ofast" option might be expected to change the way type
double division sometimes works, or whether this is something that merits
further investigation.

I hope the attached comments and code are reasonably clear, but I am happy to
answer questions.

Colin Bartlett

P.S. I intend to attach a file with the C program code, examples of the wrong
output, and more information. If I can't manage to attach that file then please
let me know of another way of sending it. The file has just under 300 lines, of
which 60 lines are the actual code and C preprocessor directives.



-- 
Ticket information of MinGW - Minimalist GNU for Windows project
MinGW - Minimalist GNU for Windows Project is hosted on OSDN

Project URL: https://osdn.net/projects/mingw/
OSDN: https://osdn.net

URL for this Ticket:
    https://osdn.net/projects/mingw/ticket/39715
RSS feed for this Ticket:
    https://osdn.net/ticket/ticket_rss.php?group_id=3917&tid=39715



More information about the MinGW-Notify mailing list
Back to archive index