From c276d6055e6d6529746cd75bd1ef495990ff3f29 Mon Sep 17 00:00:00 2001 From: Uros Bizjak Date: Wed, 29 Jul 2015 17:42:03 +0200 Subject: [PATCH] re PR libfortran/66650 (libgfortran: warning: left shift of negative value [-Wshift-negative-value]) PR libgfortran/66650 * libgfortran.h (GFC_DTYPE_SIZE_MASK): Rewrite to avoid "left shift of negative value" warning. From-SVN: r226355 --- libgfortran/ChangeLog | 6 ++++++ libgfortran/libgfortran.h | 3 +-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog index 876b2c92f8a..29efe0ad486 100644 --- a/libgfortran/ChangeLog +++ b/libgfortran/ChangeLog @@ -1,3 +1,9 @@ +2015-07-29 Uros Bizjak + + PR libgfortran/66650 + * libgfortran.h (GFC_DTYPE_SIZE_MASK): Rewrite to avoid + "left shift of negative value" warning. + 2015-07-14 Janne Blomqvist PR libfortran/66861 diff --git a/libgfortran/libgfortran.h b/libgfortran/libgfortran.h index 8962154aae7..39e5e4ae642 100644 --- a/libgfortran/libgfortran.h +++ b/libgfortran/libgfortran.h @@ -404,8 +404,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) -- 2.30.2