Bug 172117 - Incorrect code using vector types
Incorrect code using vector types
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: gcc (Show other bugs)
ia64 Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
Depends On:
Blocks: 181409
  Show dependency treegraph
Reported: 2005-10-31 12:05 EST by Hakon Bugge
Modified: 2007-11-30 17:07 EST (History)
2 users (show)

See Also:
Fixed In Version: RHBA-2006-0509
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2006-08-10 17:28:48 EDT
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 12:07 EST, Hakon Bugge
no flags Details
Patch that fixes the bug (1.36 KB, patch)
2005-12-18 15:48 EST, Alexandre Oliva
no flags Details | Diff

  None (edit)
Description Hakon Bugge 2005-10-31 12:05:40 EST
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 12:07:06 EST
Created attachment 120577 [details]
C source
Comment 2 Alexandre Oliva 2005-12-18 15:48:20 EST
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 13:19:19 EDT
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 17:28:56 EDT
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.