rs6000: Fix PR87604

Message ID
State New
Headers show
  • rs6000: Fix PR87604
Related show

Commit Message

Bill Schmidt Jan. 22, 2019, 11:46 p.m.
A libgomp test demonstrated a problem with reduction code in the Power back end
( for little-endian code.  The 
define_insn_and_split at the heart of the problem depends on big-endian data layout, 
and should have been disabled when little-endian support was added around 2012.
We missed that.  The pattern in question was used for V2DF mode; there is a similar
pattern for V4SF mode that should also have been disabled.  This patch disables
both patterns.  Thanks to Jakub for analyzing the problem!

Bootstrapped and tested on powerpc64le-unknown-linux-gnu with no regressions.
The failing testcase now passes.  Is this okay for trunk, and eventually for
backports to all supported releases?


2019-01-22  Jakub Jelinek  <>
	    Bill Schmidt  <>

	* config/rs6000/ (*vsx_reduc_<VEC_reduc_name>_v2df_scalar):
	Disable for little endian.
	(*vsx_reduc_<VEC_reduc_name>_v4sf_scalar): Likewise.


Index: gcc/config/rs6000/
--- gcc/config/rs6000/	(revision 268115)
+++ gcc/config/rs6000/	(working copy)
@@ -4351,7 +4351,7 @@ 
 	  (match_dup 1))
 	 (parallel [(const_int 1)])))
    (clobber (match_scratch:DF 2 "=0,0,&wd,&wa"))]
   [(const_int 0)]
@@ -4378,7 +4378,7 @@ 
    (clobber (match_scratch:V4SF 2 "=&wf,&wa"))
    (clobber (match_scratch:V4SF 3 "=&wf,&wa"))
    (clobber (match_scratch:V4SF 4 "=0,0"))]
   [(const_int 0)]