diff mbox

[libgcc] : Avoid "left shift count >= width of type" warnings in soft-fp code

Message ID CAFULd4bcVeoCyds8nzAtqZw+JspV46iRiT1S8Nisho5Yn-oeEw@mail.gmail.com
State New
Headers show

Commit Message

Uros Bizjak Nov. 27, 2013, 10:01 p.m. UTC
On Mon, Nov 25, 2013 at 11:19 PM, Joseph S. Myers
<joseph@codesourcery.com> wrote:

> soft-fp patches go to libc-alpha, with glibc code then being imported
> unmodified into GCC.

Now imported from glibc as:

2013-11-27  Uros Bizjak  <ubizjak@gmail.com>

    * soft-fp/op-4.h: Update from glibc.

Tested on x86_64-pc-linux-gnu multilib build and committed to mainline SVN.

Uros.
diff mbox

Patch

Index: soft-fp/op-4.h
===================================================================
--- soft-fp/op-4.h	(revision 205448)
+++ soft-fp/op-4.h	(working copy)
@@ -709,7 +709,7 @@ 
       else if (rsize <= 2*_FP_W_TYPE_SIZE)				\
 	{								\
 	  r = X##_f[1];							\
-	  r <<= _FP_W_TYPE_SIZE;					\
+	  r = (rsize <= _FP_W_TYPE_SIZE ? 0 : r << _FP_W_TYPE_SIZE);	\
 	  r += X##_f[0];						\
 	}								\
       else								\
@@ -717,11 +717,11 @@ 
 	  /* I'm feeling lazy so we deal with int == 3words (implausible)*/ \
 	  /* and int == 4words as a single case.			 */ \
 	  r = X##_f[3];							\
-	  r <<= _FP_W_TYPE_SIZE;					\
+	  r = (rsize <= _FP_W_TYPE_SIZE ? 0 : r << _FP_W_TYPE_SIZE);	\
 	  r += X##_f[2];						\
-	  r <<= _FP_W_TYPE_SIZE;					\
+	  r = (rsize <= _FP_W_TYPE_SIZE ? 0 : r << _FP_W_TYPE_SIZE);	\
 	  r += X##_f[1];						\
-	  r <<= _FP_W_TYPE_SIZE;					\
+	  r = (rsize <= _FP_W_TYPE_SIZE ? 0 : r << _FP_W_TYPE_SIZE);	\
 	  r += X##_f[0];						\
 	}								\
     }									\