]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR libfortran/66650 (libgfortran: warning: left shift of negative value [-Wshift...
authorUros Bizjak <ubizjak@gmail.com>
Wed, 29 Jul 2015 17:45:07 +0000 (19:45 +0200)
committerUros Bizjak <uros@gcc.gnu.org>
Wed, 29 Jul 2015 17:45:07 +0000 (19:45 +0200)
PR libgfortran/66650
* libgfortran.h (GFC_DTYPE_SIZE_MASK): Rewrite to avoid
"left shift of negative value" warning.

From-SVN: r226360

libgfortran/ChangeLog
libgfortran/libgfortran.h

index 7493f84ea5be792adae5f1f22f916efe6427e290..3f2ef6806deb65f7b96e36093b53a41093c63a55 100644 (file)
@@ -1,3 +1,9 @@
+2015-07-29  Uros Bizjak  <ubizjak@gmail.com>
+
+       PR libgfortran/66650
+       * libgfortran.h (GFC_DTYPE_SIZE_MASK): Rewrite to avoid
+       "left shift of negative value" warning.
+
 2015-06-26  Release Manager
 
        * GCC 4.9.3 released.
index e01d215ddd82f3675d941021eec257b5cb4a0510..0d2e6488df281cda6cc652c1b0709ad8f53e9984 100644 (file)
@@ -415,8 +415,7 @@ typedef GFC_ARRAY_DESCRIPTOR (GFC_MAX_DIMENSIONS, GFC_LOGICAL_16) gfc_array_l16;
 
 /* Macros to get both the size and the type with a single masking operation  */
 
-#define GFC_DTYPE_SIZE_MASK \
-  ((~((index_type) 0) >> GFC_DTYPE_SIZE_SHIFT) << GFC_DTYPE_SIZE_SHIFT)
+#define GFC_DTYPE_SIZE_MASK (-((index_type) 1 << GFC_DTYPE_SIZE_SHIFT))
 #define GFC_DTYPE_TYPE_SIZE_MASK (GFC_DTYPE_SIZE_MASK | GFC_DTYPE_TYPE_MASK)
 
 #define GFC_DTYPE_TYPE_SIZE(desc) ((desc)->dtype & GFC_DTYPE_TYPE_SIZE_MASK)