Commit 986e29bc by Dominik Vogt Committed by Andreas Krebbel

Fix broken handling of LABEL_REF in genrecog + genpreds.

gcc/ChangeLog

	* config/s390/predicates.md ("larl_operand"): Remove now superfluous
	const_int and const_double.
	* genrecog.c (safe_predicate_mode): Return false for VOIDmode
	LABEL_REFs even if the predicate does not handle const_int,
	const_double or const_wide_int.
	* genpreds.c (add_mode_tests): Treat LABEL_REF like CONST_INT.

From-SVN: r231927
parent c7b48c8a
2015-12-23 Dominik Vogt <vogt@linux.vnet.ibm.com>
* config/s390/predicates.md ("larl_operand"): Remove now superfluous
const_int and const_double.
* genrecog.c (safe_predicate_mode): Return false for VOIDmode
LABEL_REFs even if the predicate does not handle const_int,
const_double or const_wide_int.
* genpreds.c (add_mode_tests): Treat LABEL_REF like CONST_INT.
2015-12-23 Thomas Schwinge <thomas@codesourcery.com> 2015-12-23 Thomas Schwinge <thomas@codesourcery.com>
* tree-core.h (enum omp_clause_code): Merge OMP_CLAUSE_USE_DEVICE * tree-core.h (enum omp_clause_code): Merge OMP_CLAUSE_USE_DEVICE
...@@ -122,10 +122,7 @@ ...@@ -122,10 +122,7 @@
;; Return true if OP a valid operand for the LARL instruction. ;; Return true if OP a valid operand for the LARL instruction.
(define_predicate "larl_operand" (define_predicate "larl_operand"
; Note: Although CONST_INT and CONST_DOUBLE are not handled in this predicate, (match_code "label_ref, symbol_ref, const")
; at least one of them needs to appear or otherwise safe_predicate_mode will
; assume that a VOIDmode LABEL_REF is not accepted either (see genrecog.c).
(match_code "label_ref, symbol_ref, const, const_int, const_double")
{ {
/* Allow labels and local symbols. */ /* Allow labels and local symbols. */
if (GET_CODE (op) == LABEL_REF) if (GET_CODE (op) == LABEL_REF)
......
...@@ -320,6 +320,8 @@ add_mode_tests (struct pred_data *p) ...@@ -320,6 +320,8 @@ add_mode_tests (struct pred_data *p)
{ {
case CONST_INT: case CONST_INT:
case CONST_WIDE_INT: case CONST_WIDE_INT:
/* Special handling for (VOIDmode) LABEL_REFs. */
case LABEL_REF:
matches_const_scalar_int_p = true; matches_const_scalar_int_p = true;
break; break;
......
...@@ -3382,7 +3382,8 @@ safe_predicate_mode (const struct pred_data *pred, machine_mode mode) ...@@ -3382,7 +3382,8 @@ safe_predicate_mode (const struct pred_data *pred, machine_mode mode)
if (GET_MODE_CLASS (mode) == MODE_INT if (GET_MODE_CLASS (mode) == MODE_INT
&& (pred->codes[CONST_INT] && (pred->codes[CONST_INT]
|| pred->codes[CONST_DOUBLE] || pred->codes[CONST_DOUBLE]
|| pred->codes[CONST_WIDE_INT])) || pred->codes[CONST_WIDE_INT]
|| pred->codes[LABEL_REF]))
return false; return false;
return !pred->special && mode != VOIDmode; return !pred->special && mode != VOIDmode;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment