Bug 435297 - incorrect results with flag foptimize-sibling-calls
incorrect results with flag foptimize-sibling-calls
Status: CLOSED UPSTREAM
Product: Fedora
Classification: Fedora
Component: gcc (Show other bugs)
rawhide
x86_64 Linux
low Severity high
: ---
: ---
Assigned To: Jakub Jelinek
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2008-02-28 10:31 EST by Josef Leydold
Modified: 2008-04-25 05:02 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-04-25 05:02:53 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
tared and gzip directory with .i files (232.41 KB, application/octet-stream)
2008-02-28 10:31 EST, Josef Leydold
no flags Details
much shorter example that domenstrates bug (only a 20 lines of code in *.c file) (9.81 KB, application/x-gzip)
2008-04-25 04:50 EDT, Josef Leydold
no flags Details


External Trackers
Tracker ID Priority Status Summary Last Updated
GNU Compiler Collection 36017 None None None Never

  None (edit)
Description Josef Leydold 2008-02-28 10:31:43 EST
Description of problem:


Version-Release number of selected component (if applicable):
gcc (GCC) 4.3.0 20080222 (Red Hat 4.3.0-0.11)

How reproducible:
create executable with optimization flag "-O1 -foptimize-sibling-calls"
creates incorrect numerical output.
flag "-O1" works as expected and gives a list nubers:
1.000000
...
100.000000

The error occurs in the routine _unur_stdgen_sample_triangular_inv


Steps to Reproduce:
1.compile and link all files using optimization flags
  "-g -O1 -foptimize-sibling-calls"
2.run executable
3.
  
Actual results:
list of 100 numbers:
29.899561
30.257395
...
100.000000


Expected results:
list of 100 numbers:
1.000000
2.000000
...
100.000000

Additional info:
I have downsized a larger library where the error occurs.
main is located in file example0.i
Comment 1 Josef Leydold 2008-02-28 10:31:43 EST
Created attachment 296226 [details]
tared and gzip directory with .i files
Comment 2 Josef Leydold 2008-04-25 04:50:48 EDT
Created attachment 303760 [details]
much shorter example that domenstrates bug (only a 20 lines of code in *.c file)

I have tried a minimalist example that demonstrates the bug.
I is contained in file 'example0.c'.

The error occurs since a branch of an if clause is never reached
although it should.

There are also a few comments in that file that explains the bug and 
how it disappears.
Interestingly it is enough to declare a function static.

Note You need to log in before you can comment on or make changes to this bug.