OSDN Git Service

(left_shift): Ignore integer overflow.
authorkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 9 Jun 1995 22:01:39 +0000 (22:01 +0000)
committerkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 9 Jun 1995 22:01:39 +0000 (22:01 +0000)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@9915 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/cexp.y

index 6082fec..79282b7 100644 (file)
@@ -898,21 +898,15 @@ left_shift (a, b)
      struct constant *a;
      unsigned long b;
 {
+   /* It's unclear from the C standard whether shifts can overflow.
+      The following code ignores overflow; perhaps a C standard
+      interpretation ruling is needed.  */
   if (b >= HOST_BITS_PER_LONG)
-    {
-      if (! a->unsignedp && a->value != 0)
-       integer_overflow ();
-      return 0;
-    }
+    return 0;
   else if (a->unsignedp)
     return (unsigned long) a->value << b;
   else
-    {
-      long l = a->value << b;
-      if (l >> b != a->value)
-       integer_overflow ();
-      return l;
-    }
+    return a->value << b;
 }
 
 static long