* rtlanal.c (nonzero_bits1): Handle CLRSB.
authorJakub Jelinek <jakub@redhat.com>
Fri, 26 Aug 2011 12:15:25 +0000 (14:15 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Fri, 26 Aug 2011 12:15:25 +0000 (14:15 +0200)
From-SVN: r178101

gcc/ChangeLog
gcc/rtlanal.c

index c8d97d83e3bfc6cf100382861f7b94ffe216ffa9..7d32ee1fa36d3c33305727ef2b33f5d613ef951d 100644 (file)
@@ -1,3 +1,7 @@
+2011-08-26  Jakub Jelinek  <jakub@redhat.com>
+
+       * rtlanal.c (nonzero_bits1): Handle CLRSB.
+
 2011-08-26  Richard Guenther  <rguenther@suse.de>
 
        * expr.c (string_constant): Handle &MEM_REF.
index 7fa3ca6f315b166872944055f7ea8489252da7d4..d6e84a22221f9af0542c87b97434a410d0e1df62 100644 (file)
@@ -1,7 +1,7 @@
 /* Analyze RTL for GNU compiler.
    Copyright (C) 1987, 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
-   1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
-   Free Software Foundation, Inc.
+   1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
+   2011 Free Software Foundation, Inc.
 
 This file is part of GCC.
 
@@ -4273,6 +4273,11 @@ nonzero_bits1 (const_rtx x, enum machine_mode mode, const_rtx known_x,
        nonzero = -1;
       break;
 
+    case CLRSB:
+      /* This is at most the number of bits in the mode minus 1.  */
+      nonzero = ((unsigned HOST_WIDE_INT) 1 << (floor_log2 (mode_width))) - 1;
+      break;
+
     case PARITY:
       nonzero = 1;
       break;