Make integer size explicit
authorSenthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com>
Wed, 21 Sep 2016 06:03:32 +0000 (06:03 +0000)
committerSenthil Kumar Selvaraj <saaadhu@gcc.gnu.org>
Wed, 21 Sep 2016 06:03:32 +0000 (06:03 +0000)
For the lower vrp bound to be 2/-2, unsigned ints must be 4 bytes wide. This
breaks targets like avr. Explicitly using __UINT32_TYPE__ (behind a typedef)
makes the testcase pass for all targets.

gcc/testsuite/ChangeLog:

2016-09-21  Senthil Kumar Selvaraj  <senthil_kumar.selvaraj@atmel.com>

* gcc.dg/tree-ssa/pr64130.c: Use __UINT32_TYPE__ instead of int.

From-SVN: r240300

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/tree-ssa/pr64130.c

index e05a76e4c18e1c59d0bb30d9eaafc4ada76d4caa..2f5518f53396839fe075c2877c71140287116c8d 100644 (file)
@@ -1,3 +1,7 @@
+2016-09-21  Senthil Kumar Selvaraj  <senthil_kumar.selvaraj@atmel.com>
+
+       * gcc.dg/tree-ssa/pr64130.c: Use __UINT32_TYPE__ instead of int.
+
 2016-09-21  Kugan Vivekanandarajah  <kuganv@linaro.org>
 
        PR tree-optimization/72835
index f39bd179a8c99e29b69610089ef7e80e4a63eebc..e068765e2fca6f05ab39722df58529ae880e11fa 100644 (file)
@@ -2,12 +2,14 @@
 /* { dg-do compile } */
 /* { dg-options "-O2 -fdump-tree-evrp" } */
 
-int funsigned (unsigned a)
+__extension__ typedef __UINT32_TYPE__ uint32_t;
+
+int funsigned (uint32_t a)
 {
   return 0x1ffffffffL / a == 0;
 }
 
-int funsigned2 (unsigned a)
+int funsigned2 (uint32_t a)
 {
   if (a < 1) return 1;
   return (-1 * 0x1ffffffffL) / a == 0;