diff options
author | geoffk <geoffk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-02-27 20:27:38 +0000 |
---|---|---|
committer | geoffk <geoffk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-02-27 20:27:38 +0000 |
commit | 80cf4c7521a04819b7028446509f974047b9dbe7 (patch) | |
tree | b762982ce5c2a3b044bdf03acbf6d58443a01429 | |
parent | a8ef833a8a490084f1d0f250b50dbdc95a06ba30 (diff) | |
download | gcc-80cf4c7521a04819b7028446509f974047b9dbe7.tar.gz |
Index: ChangeLog
* expmed.c (expand_shift): Correctly test for low part of a
subreg.
Index: testsuite/ChangeLog
* gcc.c-torture/execute/20020225-2.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@50114 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/expmed.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/testsuite/gcc.c-torture/execute/20020225-2.c | 19 |
4 files changed, 29 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 7722a6d3332..42fd508ba72 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2002-02-27 Geoffrey Keating <geoffk@redhat.com> + + * expmed.c (expand_shift): Correctly test for low part of a + subreg. + 2002-02-27 Ulrich Weigand <uweigand@de.ibm.com> * config/s390/s390.c (s390_chunkify_pool): Do not confuse diff --git a/gcc/expmed.c b/gcc/expmed.c index b3d94c2376f..46007a30330 100644 --- a/gcc/expmed.c +++ b/gcc/expmed.c @@ -1913,7 +1913,7 @@ expand_shift (code, mode, shifted, amount, target, unsignedp) op1 = GEN_INT ((unsigned HOST_WIDE_INT) INTVAL (op1) % GET_MODE_BITSIZE (mode)); else if (GET_CODE (op1) == SUBREG - && SUBREG_BYTE (op1) == 0) + && subreg_lowpart_p (op1)) op1 = SUBREG_REG (op1); } #endif diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index b2820d62bab..d6b70d39409 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2002-02-27 Geoffrey Keating <geoffk@redhat.com> + + * gcc.c-torture/execute/20020225-2.c: New test. + 2002-02-27 Zack Weinberg <zack@codesourcery.com> * gcc.c-torture/execute/920730-1t.c, diff --git a/gcc/testsuite/gcc.c-torture/execute/20020225-2.c b/gcc/testsuite/gcc.c-torture/execute/20020225-2.c new file mode 100644 index 00000000000..5c91596096b --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/20020225-2.c @@ -0,0 +1,19 @@ +static int +test(int x) +{ + union + { + int i; + double d; + } a; + a.d = 0; + a.i = 1; + return x >> a.i; +} + +int main(void) +{ + if (test (5) != 2) + abort (); + exit (0); +} |