Bug 21423

Summary: gcc 2.96 optimization bug
Product: [Retired] Red Hat Linux Reporter: Plummer, Martyn <plummer>
Component: gccAssignee: Jakub Jelinek <jakub>
Status: CLOSED RAWHIDE QA Contact: David Lawrence <dkl>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.0   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2000-11-30 18:58:45 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 21424    
Attachments:
Description Flags
Example program to show bug none

Description Plummer, Martyn 2000-11-28 14:16:14 UTC
This could be the same bug as #20580, but I am not really qualified to say,
so I'm submitting a separate report.

This bug came to light in the R language (see http://www.r-project.org and
R-base on Red Hat Powertools), causing the random number generator for the
Poisson distribution to misbehave.  The bug manifests itself only when the
code is optimized.

I am attaching a small example program - abstracted from the R source code
- that reproduces the bug.

When compiled with gcc -lm, the output is
9
10

When compiled with gcc -lm -O2, the output is
9
nan

If this works for you, a larger program is available that is much closer to
the original source.

Comment 1 Plummer, Martyn 2000-11-28 14:17:13 UTC
Created attachment 5789 [details]
Example program to show bug

Comment 2 Jakub Jelinek 2000-11-28 16:39:07 UTC
Actually, this is not related to #20580, but #21376 and seems to be fixed
by that patch as well. So if the patch gets accepted into CVS gcc, it will
be part of gcc-2.96-65 soon.