Commit 4989e88a by Andreas Krebbel Committed by Andreas Krebbel

re PR target/25268 (ICE on lshrdi3_31 pattern)

2005-12-08  Andreas Krebbel  <krebbel1@de.ibm.com>
            Jakub Jelinek  <jakub@redhat.com>

	PR target/25268
	* config/s390/s390.c (s390_decompose_shift_count): Remove BITS
	argument.  Don't drop outer ANDs.
	(s390_extra_constraint_str, print_shift_count_operand): Adjust callers.
	* config/s390/s390-protos.h (s390_decompose_shift_count): Adjust
	prototype.
	* config/s390/predicates.md (setmem_operand): Remove.
	(shift_count_operand): Rename to...
	(shift_count_or_setmem_operand): ... this.  Adjust
	s390_decompose_shift_count caller.
	* config/s390/s390.md (<shift>di3_31_and, <shift>di3_64_and,
	ashrdi3_cc_31_and, ashrdi3_cconly_31_and, ashrdi3_31_and,
	ashrdi3_cc_64_and, ashrdi3_cconly_64_and, ashrdi3_64_and,
	<shift>si3_and, ashrsi3_cc_and, ashrsi3_cconly_and, ashrsi3_and,
	rotl<mode>3_and, setmem_long_and): New insns.
	(<shift>di3_31, <shift>di3_64, ashrdi3_cc_31, ashrdi3_cconly_31,
	ashrdi3_31, ashrdi3_cc_64, ashrdi3_cconly_64, ashrdi3_64,
	<shift>si3, ashrsi3_cc, ashrsi3_cconly, ashrsi3, rotl<mode>3,
	<shift>di3, ashrdi3): Use shift_count_or_setmem_operand instead
	of shift_count_operand.
	(setmem_long): Use shift_count_or_setmem_operand instead of
	setmem_operand.

2005-12-08  Andreas Krebbel  <krebbel1@de.ibm.com>
            Jakub Jelinek  <jakub@redhat.com>

        PR target/25268
	* gcc.c-torture/compile/20051207-1.c: New test.



Co-Authored-By: Jakub Jelinek <jakub@redhat.com>

From-SVN: r108220
parent 820715b8
2005-12-08 Andreas Krebbel <krebbel1@de.ibm.com>
Jakub Jelinek <jakub@redhat.com>
PR target/25268
* config/s390/s390.c (s390_decompose_shift_count): Remove BITS
argument. Don't drop outer ANDs.
(s390_extra_constraint_str, print_shift_count_operand): Adjust callers.
* config/s390/s390-protos.h (s390_decompose_shift_count): Adjust
prototype.
* config/s390/predicates.md (setmem_operand): Remove.
(shift_count_operand): Rename to...
(shift_count_or_setmem_operand): ... this. Adjust
s390_decompose_shift_count caller.
* config/s390/s390.md (<shift>di3_31_and, <shift>di3_64_and,
ashrdi3_cc_31_and, ashrdi3_cconly_31_and, ashrdi3_31_and,
ashrdi3_cc_64_and, ashrdi3_cconly_64_and, ashrdi3_64_and,
<shift>si3_and, ashrsi3_cc_and, ashrsi3_cconly_and, ashrsi3_and,
rotl<mode>3_and, setmem_long_and): New insns.
(<shift>di3_31, <shift>di3_64, ashrdi3_cc_31, ashrdi3_cconly_31,
ashrdi3_31, ashrdi3_cc_64, ashrdi3_cconly_64, ashrdi3_64,
<shift>si3, ashrsi3_cc, ashrsi3_cconly, ashrsi3, rotl<mode>3,
<shift>di3, ashrdi3): Use shift_count_or_setmem_operand instead
of shift_count_operand.
(setmem_long): Use shift_count_or_setmem_operand instead of
setmem_operand.
2005-12-08 Daniel Jacobowitz <dan@codesourcery.com>
Andreas Tobler <a.tobler@schweiz.ch>
......
......@@ -75,42 +75,16 @@
(and (match_test "mode == Pmode")
(match_test "!legitimate_la_operand_p (op)"))))
;; Return true if OP is a valid operand for setmem.
;; Return true if OP is a valid operand as shift count or setmem.
(define_predicate "setmem_operand"
(define_predicate "shift_count_or_setmem_operand"
(match_code "reg, subreg, plus, const_int")
{
HOST_WIDE_INT offset;
rtx base;
/* Extract base register and offset. Use 8 significant bits. */
if (!s390_decompose_shift_count (op, &base, &offset, 8))
return false;
/* Don't allow any non-base hard registers. Doing so without
confusing reload and/or regrename would be tricky, and doesn't
buy us much anyway. */
if (base && REGNO (base) < FIRST_PSEUDO_REGISTER && !ADDR_REG_P (base))
return false;
/* Unfortunately we have to reject constants that are invalid
for an address, or else reload will get confused. */
if (!DISP_IN_RANGE (offset))
return false;
return true;
})
;; Return true if OP is a valid shift count operand.
(define_predicate "shift_count_operand"
(match_code "reg, subreg, plus, const_int, and")
{
HOST_WIDE_INT offset;
rtx base;
/* Extract base register and offset. Use 6 significant bits. */
if (!s390_decompose_shift_count (op, &base, &offset, 6))
/* Extract base register and offset. */
if (!s390_decompose_shift_count (op, &base, &offset))
return false;
/* Don't allow any non-base hard registers. Doing so without
......
......@@ -100,7 +100,7 @@ extern rtx s390_load_got (void);
extern rtx s390_get_thread_pointer (void);
extern void s390_emit_tpf_eh_return (rtx);
extern bool s390_legitimate_address_without_index_p (rtx);
extern bool s390_decompose_shift_count (rtx, rtx *, HOST_WIDE_INT *, int);
extern bool s390_decompose_shift_count (rtx, rtx *, HOST_WIDE_INT *);
extern int s390_branch_condition_mask (rtx);
#endif /* RTX_CODE */
......
......@@ -1729,28 +1729,13 @@ s390_decompose_address (rtx addr, struct s390_address *out)
/* Decompose a RTL expression OP for a shift count into its components,
and return the base register in BASE and the offset in OFFSET.
If BITS is non-zero, the expression is used in a context where only
that number to low-order bits is significant. We then allow OP to
contain and outer AND that does not affect significant bits. If BITS
is zero, we allow OP to contain any outer AND with a constant.
Return true if OP is a valid shift count, false if not. */
bool
s390_decompose_shift_count (rtx op, rtx *base, HOST_WIDE_INT *offset, int bits)
s390_decompose_shift_count (rtx op, rtx *base, HOST_WIDE_INT *offset)
{
HOST_WIDE_INT off = 0;
/* Drop outer ANDs. */
if (GET_CODE (op) == AND && GET_CODE (XEXP (op, 1)) == CONST_INT)
{
HOST_WIDE_INT mask = ((HOST_WIDE_INT)1 << bits) - 1;
if ((INTVAL (XEXP (op, 1)) & mask) != mask)
return false;
op = XEXP (op, 0);
}
/* We can have an integer constant, an address register,
or a sum of the two. */
if (GET_CODE (op) == CONST_INT)
......@@ -1910,7 +1895,7 @@ s390_extra_constraint_str (rtx op, int c, const char * str)
case 'Y':
/* Simply check for the basic form of a shift count. Reload will
take care of making sure we have a proper base register. */
if (!s390_decompose_shift_count (op, NULL, NULL, 0))
if (!s390_decompose_shift_count (op, NULL, NULL))
return 0;
break;
......@@ -4284,7 +4269,7 @@ print_shift_count_operand (FILE *file, rtx op)
rtx base;
/* Extract base register and offset. */
if (!s390_decompose_shift_count (op, &base, &offset, 0))
if (!s390_decompose_shift_count (op, &base, &offset))
gcc_unreachable ();
/* Sanity check. */
......
2005-12-08 Andreas Krebbel <krebbel1@de.ibm.com>
Jakub Jelinek <jakub@redhat.com>
PR target/25268
* gcc.c-torture/compile/20051207-1.c: New test.
2005-12-07 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* g++.dg/other/i386-1.C, gcc.c-torture/execute/990413-2.x,
/* PR target/25268 */
long long
foo (long long x, int y)
{
return x << ((y + 1) & 63);
}
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