Bug 53729 - [4.8 regression] PR53636 fix caused bb-slp-16.c to FAIL on sparc64 and powerpc64
Summary: [4.8 regression] PR53636 fix caused bb-slp-16.c to FAIL on sparc64 and powerpc64
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: regression (show other bugs)
Version: 4.8.0
: P3 normal
Target Milestone: 4.8.0
Assignee: Ulrich Weigand
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-06-20 11:26 UTC by Mikael Pettersson
Modified: 2012-06-26 09:09 UTC (History)
3 users (show)

See Also:
Host:
Target: sparc64-linux, powerpc64-linux
Build:
Known to work:
Known to fail: 4.8.0
Last reconfirmed: 2012-06-20 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mikael Pettersson 2012-06-20 11:26:23 UTC
The PR53636 fix caused

FAIL: gcc.dg/vect/bb-slp-16.c scan-tree-dump-times slp "basic block vectorized using SLP" 1

on sparc64-linux.  Comparing the pre and post patch dumps for that file shows

 22: vect_compute_data_ref_alignment:
 22: misalign = 4 bytes of ref MEM[(unsigned int *)pout_90 + 28B]
 22: vect_compute_data_ref_alignment:
-22: force alignment of arr[i_87]
-22: misalign = 0 bytes of ref arr[i_87]
+22: SLP: step doesn't divide the vector-size.
+22: Unknown alignment for access: arr

(lots of stuff that's simply gone)

-22: BASIC BLOCK VECTORIZED
-
-22: basic block vectorized using SLP
+22: not vectorized: unsupported unaligned store.arr[i_87]
+22: not vectorized: unsupported alignment in basic block.

The same new FAIL also appears on powerpc64-linux.
Comment 1 Ulrich Weigand 2012-06-20 15:22:45 UTC
The problem is that SLP tests *all* accesses within the basic block for alignment, even those that aren't actually part of a SLP instance.

This is of course broken, but that bug had been hidden by the PR53636 problem (due to which accesses were considered aligned that actually are not).

The fix for this problem is to only check *relevant* accesses for alignment.  (This requires moving the alignment check until after relevant statements are actually marked ...)

I'm testing a fix.
Comment 2 Ulrich Weigand 2012-06-26 09:05:55 UTC
Author: uweigand
Date: Tue Jun 26 09:05:48 2012
New Revision: 188979

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=188979
Log:
	PR tree-optimization/53729
	PR tree-optimization/53636
	* tree-vect-slp.c (vect_slp_analyze_bb_1): Delay call to
	vect_verify_datarefs_alignment until after statements have
	been marked as relevant/irrelevant.
	* tree-vect-data-refs.c (vect_verify_datarefs_alignment):
	Skip irrelevant statements.
	(vect_enhance_data_refs_alignment): Use STMT_VINFO_RELEVANT_P
	instead of STMT_VINFO_RELEVANT.
	(vect_get_data_access_cost): Do not check for supportable
	alignment before calling vect_get_load_cost/vect_get_store_cost.
	* tree-vect-stmts.c (vect_get_store_cost): Do not abort when
	handling unsupported alignment.
	(vect_get_load_cost): Likewise.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/tree-vect-data-refs.c
    trunk/gcc/tree-vect-slp.c
    trunk/gcc/tree-vect-stmts.c
Comment 3 Ulrich Weigand 2012-06-26 09:09:28 UTC
Fixed.