This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/47947] New: Varibles of type vector double are not copied correctly in gcc-4.5.1 and gcc-4.6.0


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47947

           Summary: Varibles of type vector double are not copied
                    correctly in gcc-4.5.1 and gcc-4.6.0
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: critical
          Priority: P3
         Component: c
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: tkarkha@us.ibm.com
                CC: meissner@linux.vnet.ibm.com


Created attachment 23505
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=23505
Tarfile for recreating the bug

When copying one vector double variable to another vector double variable, for
some variables the lower half of the variable is zeroed out.  The zeroing
results in incorrect computations.  This happens for all -O optimization
levels.

A small testcase is provided to recreate the bug.  In the testcase a simple
vector addition with vec_add() results in an incorrect result due to incorrect
copy.  Here is the ouptut from the testcase:
$ ./gccBugTest_GCC               
DEBUG:: u_in0 = <1.000000,2.000000,3.000000,4.000000>
DEBUG:: u_in1 = <5.000000,6.000000,7.000000,8.000000>
DEBUG::foo:: l_temp0 = <1.000000,2.000000,3.000000,4.000000>
DEBUG::foo:: l_temp1 = <5.000000,6.000000,7.000000,8.000000>
DEBUG::foo:: in0 HI = <1.000000,0.000000>
DEBUG::foo:: in0 LO = <3.000000,0.000000>
DEBUG::foo:: in1 HI = <5.000000,0.000000>
DEBUG::foo:: in1 LO = <7.000000,0.000000>
DEBUG::foo:: l_result HI = <6.000000,0.000000>
DEBUG::foo:: l_result LO = <10.000000,12.000000>
DEBUG::foo:: result:: l_temp2 = <6.000000,0.000000,10.000000,12.000000>
DEBUG:: u_out = <6.000000,0.000000,10.000000,12.000000>
$ 

The last DEBUG line should be DEBUG:: u_out =
<6.000000,8.000000,10.000000,12.000000>
          ^^^^^^^^


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]