diff options
author | Jakub Jelinek <jakub@redhat.com> | 2002-01-03 18:24:13 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2002-01-03 18:24:13 +0100 |
commit | cb1ac742b7b90852e06830b79ba1e6daa47cecb5 (patch) | |
tree | 7688e1c97e6e18596cf660ee027a1f4b6c653c20 /gcc/simplify-rtx.c | |
parent | 61d951df7bad54499674bbc6e748abb6616b15f8 (diff) | |
download | gcc-cb1ac742b7b90852e06830b79ba1e6daa47cecb5.zip gcc-cb1ac742b7b90852e06830b79ba1e6daa47cecb5.tar.gz gcc-cb1ac742b7b90852e06830b79ba1e6daa47cecb5.tar.bz2 |
simplify-rtx.c (simplify_binary_operation): If gen_lowpart_common fails, use gen_lowpart_SUBREG.
* 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.
From-SVN: r48514
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 49c205c..84209cc 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. */ |