Bug 707505 - Optimiser produces incorrect code
Summary: Optimiser produces incorrect code
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora
Classification: Fedora
Component: gcc
Version: 15
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-05-25 09:28 UTC by Tom Hughes
Modified: 2011-05-25 14:14 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-05-25 14:14:42 UTC
Type: ---


Attachments (Terms of Use)
Test case (944 bytes, text/x-csrc)
2011-05-25 09:28 UTC, Tom Hughes
no flags Details


Links
System ID Private Priority Status Summary Last Updated
GNU Compiler Collection 49161 0 None None None Never

Description Tom Hughes 2011-05-25 09:28:00 UTC
Created attachment 500766 [details]
Test case

Description of problem:

When the attached file is compiled with -ftree-vrp enabled, either manually or via -O2 or higher, the generated code produces incorrect results.

Version-Release number of selected component (if applicable):

gcc-4.6.0-7.fc15.x86_64

How reproducible:

Every time.

Steps to Reproduce:

1. Compile code with "cc -Wall -O3 -o fail fail.c"
2. Run "./fail 3", "./fail 4" and "./fail 6"
3. Compile code with "cc -Wall -O3 -fno-tree-vrp -o fail fail.c"
4. Run "./fail 3", "./fail 4" and "./fail 6" again
5. Compare results

Actual results:

for ./fail 3 - g i j k m
for ./fail 4 - g i j k m
for ./fail 6 - d g h i j k m

Expected results:

for ./fail 3 - g h j k m
for ./fail 4 - g i j k m
for ./fail 6 - d g h i j k m

Additional info:

This appears to go wrong in gcc 4.4.4 (from F12), 4.5.1 (from F14) and 4.6.0 (from F15) but not in 4.3.0 (from F9).

Comment 1 Jakub Jelinek 2011-05-25 14:14:42 UTC
Tracking this upstream as http://gcc.gnu.org/PR49161.


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