gcc.dg/vect/* test regressions

Bug #602287 reported by Andrew Stubbs
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Linaro GCC
Won't Fix
Low
Unassigned
4.4
Won't Fix
Low
Unassigned
4.5
Won't Fix
Low
Unassigned

Bug Description

Linaro GCC has some test regressions vs. FSF GCC:

+FAIL: gcc.dg/vect/vect-align-2.c scan-tree-dump-times vect "vectorized 1 loops" 1
+FAIL: gcc.dg/vect/vect-outer-4c.c scan-tree-dump-times vect "OUTER LOOP VECTORIZED" 1
+FAIL: gcc.dg/vect/vect-outer-5.c scan-tree-dump-times vect "OUTER LOOP VECTORIZED" 1
+FAIL: gcc.dg/vect/vect-outer-5.c scan-tree-dump-times vect "zero step in outer loop." 1
+FAIL: gcc.dg/vect/slp-3.c scan-tree-dump-times vect "vectorized 3 loops" 1
+FAIL: gcc.dg/vect/slp-3.c scan-tree-dump-times vect "vectorizing stmts using SLP" 3
+FAIL: gcc.dg/vect/no-vfa-pr29145.c scan-tree-dump-times vect "vectorized 0 loops" 2
+FAIL: gcc.dg/vect/no-vfa-pr29145.c scan-tree-dump-times vect "vectorized 1 loops" 1

Many of these are fixed upstream, and the patches can probably be backported.

Revision history for this message
Andrew Stubbs (ams-codesourcery) wrote :

This affects ARMel toolchain only

Revision history for this message
Andrew Stubbs (ams-codesourcery) wrote :

Julian, I believe we agreed you would backport these patches.

Changed in gcc-linaro:
assignee: nobody → Julian Brown (julian-codesourcery)
Revision history for this message
Loïc Minier (lool) wrote :

Joseph Myers from CodeSourcery commented:
a lot of this kind of thing may be fixed upstream
http://gcc.gnu.org/ml/gcc-patches/2010-05/msg01315.html

Changed in gcc-linaro:
milestone: none → 4.4.2010.07
importance: Undecided → Medium
Changed in gcc-linaro:
assignee: Julian Brown (julian-codesourcery) → Ulrich Weigand (uweigand)
Revision history for this message
Michael Hope (michaelh1) wrote :

I get the following with r93532:

FAIL: gcc.dg/vect/vect-align-2.c scan-tree-dump-times vect "vectorized 1 loops" 1
FAIL: gcc.dg/vect/vect-outer-4c.c scan-tree-dump-times vect "OUTER LOOP VECTORIZED" 1
FAIL: gcc.dg/vect/vect-outer-5.c scan-tree-dump-times vect "OUTER LOOP VECTORIZED" 1
FAIL: gcc.dg/vect/vect-outer-5.c scan-tree-dump-times vect "zero step in outer loop." 1
FAIL: gcc.dg/vect/slp-3.c scan-tree-dump-times vect "vectorized 3 loops" 1
FAIL: gcc.dg/vect/slp-3.c scan-tree-dump-times vect "vectorizing stmts using SLP" 3
FAIL: gcc.dg/vect/no-vfa-pr29145.c scan-tree-dump-times vect "vectorized 0 loops" 2
FAIL: gcc.dg/vect/no-vfa-pr29145.c scan-tree-dump-times vect "vectorized 1 loops" 1
XPASS: gcc.dg/vect/no-scevccp-outer-8.c scan-tree-dump-times vect "OUTER LOOP VECTORIZED." 1

Changed in gcc-linaro:
status: New → Confirmed
Revision history for this message
Ulrich Weigand (uweigand) wrote :

I've confirmed the same results. With current GCC 4.4, there are no FAILs in the gcc.dg/vect/ test suite.

However, the good news is that none of these FAILs represent any code generation problems (wrong-code bugs); this is simply a matter of the vectorizer being unable to apply some particular optimizations that the test case expects.

In fact, all of those FAILs except the vect-align-2.c failure do not even represent a difference in vectorizer capabilities between FSF 4.4 and Linaro 4.4 -- neither compiler is able to perform the optimization in question. The difference in results is simply that the FSF 4.4 *expects* those optimizations to fail, while the Linaro 4.4 expects them to succeed.

The underlying reason for this is the handling of mis-aligned vector data accesses. FSF 4.4 does not support mis-aligned vector accesses, and the test suite scripts take this into account and expect all test cases that rely on this capability to fail. In Linaro 4.4, a patch was added that provides the capability for certain mis-aligned accesses to be handled; this patch also changes the test suite to now expect those cases to succeed -- and most of them do. However, those listed above still fail, for additional reasons unrelated to mis-aligned accesses (vector short multiply capability; supported vector size).

The one real regression is vect-align-2.c. Here FSF 4.4 handles mis-aligned accesses via versioning: the compiler generates two versions of assembler code, one that is vectorized and works only if the data happens to be aligned correctly, and one that is not vectorized and always works. A run-time check for the actual alignment then decides which of the two to call. In Linaro 4.4 this mechanism is not used because the patch adding (certain) mis-aligned vector support also forces versioning to be disabled. (But then the partial mis-alignment support isn't sufficient to handle this particular loop either, so it remains fully unvectorized.)

This can be done better in mainline or 4.5, where new infrastructure was added to the vectorizer to allow the target to make those decisions more precisely. And in fact Julian's patch refered to in comment #3 (against mainline, not yet applied) will solve this. However, this does not seem feasible to backport on short notice: we'd have to revert the Linaro branch hack, back-port the core vectorizer improvements, and then back-port Julian's mainline patch on top.

For the current release, my recommendation would be to do nothing.

Loïc Minier (lool)
Changed in gcc-linaro:
importance: Medium → Low
Revision history for this message
Loïc Minier (lool) wrote :

Closing the 4.4 task, per Ulrich's comments. Most of the testsuite regressions are due to the testsuite having higher expectations now that the backend claims to support unaligned accesses. I understand the only real 4.4 regression generates safe code, and that backporting the fixes proposed for 4.5 to 4.4 is too hard for the short development time of Linaro 4.4.

I'm keeping the 4.5 task open where Julian's patch will solve this but is not yet merged in mainline/4.5.

Michael Hope (michaelh1)
tags: added: testsuite
Revision history for this message
Julian Brown (julian-codesourcery) wrote :

FWIW, the misalignment-support patch has been backported to GCC 4.5, and will make its way to this branch in due course.

Michael Hope (michaelh1)
tags: added: regression
Revision history for this message
Viktor (vchong) wrote :

GCC version no longer supported.

Changed in gcc-linaro:
status: Confirmed → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.