Fix PR rtl-optimization/81443

Message ID 4036936.2FtM7nYaUC@polaris
State New
Headers show
Series
  • Fix PR rtl-optimization/81443
Related show

Commit Message

Eric Botcazou Jan. 23, 2018, 8:54 p.m.
This is a combinatorial explosion in the combiner for the num_sign_bit_copies 
mechanism present on the 7 branch and mainline during the bootstrap on MIPS 
n32, i.e. a 64-bit WORD_REGISTER_OPERATIONS SIGN_EXTEND target.  While I'm 
still exploring various approaches to fixing it on the mainline, Richard B. 
agreed to have it fixed on the 7 branch by reverting the problematic bits from 
the PR rtl-optimization/59461 patch that introduced it.

Manually tested on mips64-unknown-linux-gnu, applied on the 7 branch.


2018-01-23  Eric Botcazou  <ebotcazou@adacore.com>

	PR rtl-optimization/81443
	* rtlanal.c (num_sign_bit_copies1) <SUBREG>: Do not propagate results
	from inner REGs to paradoxical SUBREGs.

-- 
Eric Botcazou

Patch

Index: rtlanal.c
===================================================================
--- rtlanal.c	(revision 256841)
+++ rtlanal.c	(working copy)
@@ -4976,7 +4976,7 @@  num_sign_bit_copies1 (const_rtx x, machi
       if (WORD_REGISTER_OPERATIONS
 	  && load_extend_op (inner_mode) == SIGN_EXTEND
 	  && paradoxical_subreg_p (x)
-	  && (MEM_P (SUBREG_REG (x)) || REG_P (SUBREG_REG (x))))
+	  && MEM_P (SUBREG_REG (x)))
 	return cached_num_sign_bit_copies (SUBREG_REG (x), mode,
 					   known_x, known_mode, known_ret);
       break;