diff options
author | Geoff Keating <geoffk@cygnus.com> | 2000-08-27 21:54:56 +0000 |
---|---|---|
committer | Geoffrey Keating <geoffk@gcc.gnu.org> | 2000-08-27 21:54:56 +0000 |
commit | e53ca51f94aea5a90e6326d634c2286982359166 (patch) | |
tree | 3380d3c43229668c919a48d461e9ee9a8a1b1b82 /gcc | |
parent | cb0112489477f3f20e6c257638acbfa2a1d8f7a4 (diff) | |
download | gcc-e53ca51f94aea5a90e6326d634c2286982359166.zip gcc-e53ca51f94aea5a90e6326d634c2286982359166.tar.gz gcc-e53ca51f94aea5a90e6326d634c2286982359166.tar.bz2 |
In gcc: 2000-08-27 Geoff Keating <geoffk@cygnus.com>
In gcc:
2000-08-27 Geoff Keating <geoffk@cygnus.com>
* config/rs6000/rs6000.md (movdi_internal64+5): Make SUBREG-safe
by using gen_lowpart_common.
(movdi_internal64+6): Likewise.
In gcc/testsuite:
2000-08-27 Geoff Keating <geoffk@cygnus.com>
* gcc.c-torture/compile/20000825-1.c: New test.
From-SVN: r36005
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/config/rs6000/rs6000.md | 12 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/testsuite/gcc.c-torture/compile/20000825-1.c | 31 |
4 files changed, 49 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 9384f5c..62d0ebf 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2000-08-27 Geoff Keating <geoffk@cygnus.com> + + * config/rs6000/rs6000.md (movdi_internal64+5): Make SUBREG-safe + by using gen_lowpart_common. + (movdi_internal64+6): Likewise. + 2000-08-26 Alexandre Oliva <aoliva@redhat.com> * tm.texi (FINI_SECTION_ASM_OP, CRT_CALL_STATIC_FUNCTION): diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md index 5005f73..5ea5bc8 100644 --- a/gcc/config/rs6000/rs6000.md +++ b/gcc/config/rs6000/rs6000.md @@ -8087,9 +8087,12 @@ [(set (match_dup 0) (match_dup 2)) (set (match_dup 0) - (zero_extend:DI (subreg:SI (match_dup 0) 0)))] + (zero_extend:DI (match_dup 3)))] " -{ operands[2] = GEN_INT (CONST_DOUBLE_LOW (operands[1])); }") +{ + operands[2] = GEN_INT (CONST_DOUBLE_LOW (operands[1])); + operands[3] = gen_lowpart_common (SImode, operands[0]); +}") (define_split [(set (match_operand:DI 0 "gpc_reg_operand" "") @@ -8102,12 +8105,13 @@ [(set (match_dup 0) (match_dup 2)) (set (match_dup 0) - (zero_extend:DI (subreg:SI (match_dup 0) 0)))] + (zero_extend:DI (match_dup 3)))] " { #if HOST_BITS_PER_WIDE_INT != 32 -operands[2] = GEN_INT ((INTVAL (operands[1]) << 32) >> 32); + operands[2] = GEN_INT ((INTVAL (operands[1]) << 32) >> 32); #endif + operands[3] = gen_lowpart_common (SImode, operands[0]); }") ;; 32-bit value in upper half of doubleword diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 392f268..5f478db 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2000-08-27 Geoff Keating <geoffk@cygnus.com> + + * gcc.c-torture/compile/20000825-1.c: New test. + 2000-08-26 Alexandre Oliva <aoliva@redhat.com> * gcc.dg/dwarf2-2.c: New test. diff --git a/gcc/testsuite/gcc.c-torture/compile/20000825-1.c b/gcc/testsuite/gcc.c-torture/compile/20000825-1.c new file mode 100644 index 0000000..3c2e5bd --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/20000825-1.c @@ -0,0 +1,31 @@ +typedef signed int s32; +typedef signed long s64; +typedef unsigned int u32; +typedef unsigned long u64; + +extern __inline__ u32 foobar(int logmask) +{ + u32 ret = ~(1 << logmask); // fails + // s32 ret = ~(1 << logmask); // ok + // u64 ret = ~(1 << logmask); // ok + // s64 ret = ~(1 << logmask); // ok + return ret; +} + +// This procedure compiles fine... +u32 good(u32 var) +{ + var = foobar(0); + return var; +} + +// This procedure does not compile... +// Same as above, but formal parameter is a pointer +// Both good() and fails() compile ok if we choose +// a different type for "ret" in foobar(). +u32 fails(u32 *var) +{ + *var = foobar(0); + return *var; +} + |