Bug 172117 - Incorrect code using vector types
Summary: Incorrect code using vector types
Alias: None
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: gcc   
(Show other bugs)
Version: 4.0
Hardware: ia64
OS: Linux
Target Milestone: ---
: ---
Assignee: Jakub Jelinek
QA Contact:
Depends On:
Blocks: 181409
TreeView+ depends on / blocked
Reported: 2005-10-31 17:05 UTC by Hakon Bugge
Modified: 2007-11-30 22:07 UTC (History)
2 users (show)

Fixed In Version: RHBA-2006-0509
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2006-08-10 21:28:48 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
C source (4.22 KB, text/plain)
2005-10-31 17:07 UTC, Hakon Bugge
no flags Details
Patch that fixes the bug (1.36 KB, patch)
2005-12-18 20:48 UTC, Alexandre Oliva
no flags Details | Diff

External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2006:0509 normal SHIPPED_LIVE gcc bug fix update 2006-08-10 04:00:00 UTC

Description Hakon Bugge 2005-10-31 17:05:40 UTC
From Bugzilla Helper:
User-Agent: Opera/8.50 (Windows NT 5.1; U; en)

Description of problem:
Using (or attempting to use) vector instructions generates incorrect code on 
ia64. In the sample program, every second element of the sum misses one of the 

Version-Release number of selected component (if applicable):
gcc version 3.4.3 20050227 (Red Hat 3.4.3-22.1)  

How reproducible:

Steps to Reproduce:
1.gcc -O1 gcc_vector_ia64_bug.c

Actual Results:  testing scalar version
testing vector version
dst[  1] a: 1.020000 e: 2.030000
dst[  3] a: 3.060000 e: 6.090000
dst[  5] a: 5.100000 e: 10.150000
dst[  7] a: 7.140000 e: 14.210000
dst[  9] a: 9.180000 e: 18.270000
dst[ 11] a: 11.220000 e: 22.330000
dst[ 13] a: 13.260000 e: 26.389999
dst[ 15] a: 15.300000 e: 30.450001

Expected Results:  testing scalar version
testing vector version

Additional info:

Works on other tested architectures (ia32, x86_64)

Comment 1 Hakon Bugge 2005-10-31 17:07:06 UTC
Created attachment 120577 [details]
C source

Comment 2 Alexandre Oliva 2005-12-18 20:48:20 UTC
Created attachment 122387 [details]
Patch that fixes the bug

The bug is in the way we open-code the vector addition.  When we see code such

tmp0 += some_vector;

we emit code that writes to the first element of tmp0 with a subreg.  Since on
IA64 two floats fit in a word, the subreg has the effect of clobbering the
second element of the vector.  Oops.

The attached patch makes sure we do not use such a subreg as the output of the
open-coded instruction if the output matches any of the inputs.

This code is not present in mainline any more, as the open-coding was all moved
to the tree level, so this patch is not going upstream unless people tell me
it's a good idea to get it into upstream 3.4 or so.

Comment 6 Bob Johnson 2006-04-11 17:19:19 UTC
This issue is on Red Hat Engineering's list of planned work items 
for the upcoming Red Hat Enterprise Linux 4.4 release.  Engineering 
resources have been assigned and barring unforeseen circumstances, Red 
Hat intends to include this item in the 4.4 release.

Comment 11 Red Hat Bugzilla 2006-08-10 21:28:56 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.


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