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 tree-optimization/56918] New: incorrect auto-vectorization of array initialization


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

             Bug #: 56918
           Summary: incorrect auto-vectorization of array initialization
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: kretz@kde.org


Compile the following testcase with "gcc -m32 -O2 -ftree-vectorize -msse2"

int main() {
    double data[4];
    for (int i = 0; i < 2 * 2; ++i) {
        data[i] = ((i + 2) % 3) + 1;
    }
    if (data[0] != 3.) {
        return 1;
    }
    return 0;
}

The first for-loop calculates the values 6, 7, 8, 9 instead of the expected 3,
1, 2, 3.


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