diff options
author | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-01-03 17:24:13 +0000 |
---|---|---|
committer | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-01-03 17:24:13 +0000 |
commit | 89558e8804fada5635e277c3f721f3430e285974 (patch) | |
tree | 7688e1c97e6e18596cf660ee027a1f4b6c653c20 /gcc/simplify-rtx.c | |
parent | f24da1e190edbac03c43d9bef48c8d4a81d6541f (diff) | |
download | gcc-89558e8804fada5635e277c3f721f3430e285974.tar.gz |
* simplify-rtx.c (simplify_binary_operation) [DIV]: If
gen_lowpart_common fails, use gen_lowpart_SUBREG.
* gcc.c-torture/compile/20020103-1.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@48514 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/simplify-rtx.c')
-rw-r--r-- | gcc/simplify-rtx.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c index 49c205c5aaa..84209cc0d3d 100644 --- a/gcc/simplify-rtx.c +++ b/gcc/simplify-rtx.c @@ -1413,8 +1413,15 @@ simplify_binary_operation (code, mode, op0, op1) case DIV: if (trueop1 == CONST1_RTX (mode)) { + /* On some platforms DIV uses narrower mode than its + operands. */ rtx x = gen_lowpart_common (mode, op0); - return x ? x : op0; + if (x) + return x; + else if (mode != GET_MODE (op0) && GET_MODE (op0) != VOIDmode) + return gen_lowpart_SUBREG (mode, op0); + else + return op0; } /* In IEEE floating point, 0/x is not always 0. */ |