(num_sign_bit_copies, case SUBREG): Properly compute the number of
authorRichard Kenner <kenner@gcc.gnu.org>
Wed, 5 May 1993 21:32:10 +0000 (17:32 -0400)
committerRichard Kenner <kenner@gcc.gnu.org>
Wed, 5 May 1993 21:32:10 +0000 (17:32 -0400)
sign bit copies of SUBREGs of promoted objects.

From-SVN: r4341

gcc/combine.c

index 9e14ea694d14bf514cc7db0501489f107efd53bd..cd5936d1e9b500a3bee0ef1824b5039692a5b309 100644 (file)
@@ -1,5 +1,5 @@
 /* Optimize by combining instructions for GNU compiler.
-   Copyright (C) 1987, 1988, 1992 Free Software Foundation, Inc.
+   Copyright (C) 1987, 1988, 1992, 1993 Free Software Foundation, Inc.
 
 This file is part of GNU CC.
 
@@ -6519,8 +6519,8 @@ num_sign_bit_copies (x, mode)
         high-order bits are known to be sign bit copies.  */
 
       if (SUBREG_PROMOTED_VAR_P (x) && ! SUBREG_PROMOTED_UNSIGNED_P (x))
-       return (GET_MODE_BITSIZE (mode) - GET_MODE_BITSIZE (GET_MODE (x))
-               + num_sign_bit_copies (SUBREG_REG (x), GET_MODE (x)));
+       return MAX (bitwidth - GET_MODE_BITSIZE (GET_MODE (x)) + 1,
+                   num_sign_bit_copies (SUBREG_REG (x), mode));
 
       /* For a smaller object, just ignore the high bits. */
       if (bitwidth <= GET_MODE_BITSIZE (GET_MODE (SUBREG_REG (x))))