From d6083c7d69ace6293905f43dc3f182b1e5a9c7fc Mon Sep 17 00:00:00 2001 From: Ulrich Weigand Date: Fri, 18 Feb 2005 21:11:06 +0000 Subject: [PATCH] re PR target/20054 (ICE in change_address_1) ChangeLog: PR target/20054 * config/s390/s390.md ("*llgt_sidi", "*llgt_sidi_split"): Move to before the "*llgt_didi" pattern. testsuite/ChangeLog: PR target/20054 * gcc.dg/pr20054.c: New test. From-SVN: r95233 --- gcc/ChangeLog | 6 +++++ gcc/config/s390/s390.md | 42 +++++++++++++++++----------------- gcc/testsuite/ChangeLog | 5 ++++ gcc/testsuite/gcc.dg/pr20054.c | 23 +++++++++++++++++++ 4 files changed, 55 insertions(+), 21 deletions(-) create mode 100644 gcc/testsuite/gcc.dg/pr20054.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index f448cc195b8..8271af27056 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2005-02-18 Ulrich Weigand + + PR target/20054 + * config/s390/s390.md ("*llgt_sidi", "*llgt_sidi_split"): Move to + before the "*llgt_didi" pattern. + 2005-02-18 Jason Merrill * gimplify.c (gimplify_modify_expr_rhs) [CALL_EXPR]: Revert again. diff --git a/gcc/config/s390/s390.md b/gcc/config/s390/s390.md index 752d2944cda..a0b9a3143a0 100644 --- a/gcc/config/s390/s390.md +++ b/gcc/config/s390/s390.md @@ -2660,6 +2660,27 @@ ; LLGT-type instructions (zero-extend from 31 bit to 64 bit). ; +(define_insn "*llgt_sidi" + [(set (match_operand:DI 0 "register_operand" "=d") + (and:DI (subreg:DI (match_operand:SI 1 "memory_operand" "m") 0) + (const_int 2147483647)))] + "TARGET_64BIT" + "llgt\t%0,%1" + [(set_attr "op_type" "RXE")]) + +(define_insn_and_split "*llgt_sidi_split" + [(set (match_operand:DI 0 "register_operand" "=d") + (and:DI (subreg:DI (match_operand:SI 1 "memory_operand" "m") 0) + (const_int 2147483647))) + (clobber (reg:CC 33))] + "TARGET_64BIT" + "#" + "&& reload_completed" + [(set (match_dup 0) + (and:DI (subreg:DI (match_dup 1) 0) + (const_int 2147483647)))] + "") + (define_insn "*llgt_sisi" [(set (match_operand:SI 0 "register_operand" "=d,d") (and:SI (match_operand:SI 1 "nonimmediate_operand" "d,m") @@ -2702,27 +2723,6 @@ (const_int 2147483647)))] "") -(define_insn "*llgt_sidi" - [(set (match_operand:DI 0 "register_operand" "=d") - (and:DI (subreg:DI (match_operand:SI 1 "memory_operand" "m") 0) - (const_int 2147483647)))] - "TARGET_64BIT" - "llgt\t%0,%1" - [(set_attr "op_type" "RXE")]) - -(define_insn_and_split "*llgt_sidi_split" - [(set (match_operand:DI 0 "register_operand" "=d") - (and:DI (subreg:DI (match_operand:SI 1 "memory_operand" "m") 0) - (const_int 2147483647))) - (clobber (reg:CC 33))] - "TARGET_64BIT" - "#" - "&& reload_completed" - [(set (match_dup 0) - (and:DI (subreg:DI (match_dup 1) 0) - (const_int 2147483647)))] - "") - ; ; zero_extendqidi2 instruction pattern(s) ; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 5eb642ece86..ecdc105c735 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2005-02-18 Ulrich Weigand + + PR target/20054 + * gcc.dg/pr20054.c: New test. + 2005-01-20 Giovanni Bajo PR c++/19508 diff --git a/gcc/testsuite/gcc.dg/pr20054.c b/gcc/testsuite/gcc.dg/pr20054.c new file mode 100644 index 00000000000..292b856d014 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr20054.c @@ -0,0 +1,23 @@ + +/* { dg-do compile } */ +/* { dg-options "-O2 -fno-strict-aliasing" } */ + + +unsigned int *foo (void); + +char * +bar (double *d) +{ + return (char *) (d + 1) - sizeof (unsigned int); +} + +char +baz (double x) +{ + unsigned int h = *foo (); + unsigned int l = *(unsigned int *) bar (&x); + + return (h & ~0x80000000L) == 0x7FF00000 && l == 0; +} + +