loop-3.c: Fix undefined behavior.
authorRichard Biener <rguenther@suse.de>
Fri, 4 Oct 2019 11:40:40 +0000 (11:40 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Fri, 4 Oct 2019 11:40:40 +0000 (11:40 +0000)
2019-10-04  Richard Biener  <rguenther@suse.de>

* gcc.c-torture/execute/loop-3.c: Fix undefined behavior.

From-SVN: r276572

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/execute/loop-3.c

index 950c7483ae22243598ae30a6e6e9031ec3ea6a58..3e5a945b092e66ed4630b44a9bef5a41d0ce850c 100644 (file)
@@ -1,3 +1,7 @@
+2019-10-04  Richard Biener  <rguenther@suse.de>
+
+       * gcc.c-torture/execute/loop-3.c: Fix undefined behavior.
+
 2019-10-04  Yuliang Wang  <yuliang.wang@arm.com>
 
        * gcc.target/aarch64/sve2/shracc_1.c: Tighten scan-assembler-nots
index e314a01b1f181a8912e122917de68d9f3690f231..33eb18826fd2409caeed26e86ea5087072c51987 100644 (file)
@@ -13,7 +13,7 @@ f (m)
   i = m;
   do
     {
-      g (i * INT_MAX / 2);
+      g ((int)((unsigned)i * INT_MAX) / 2);
     }
   while (--i > 0);
 }