diff mbox

[testsuite] Make pr64130.c pass for avr

Message ID 87k2e5iy0f.fsf@atmel.com
State New
Headers show

Commit Message

Senthil Kumar Selvaraj Sept. 21, 2016, 6:10 a.m. UTC
Hi,
  
 For the lower vrp bound to be 2/-2, unsigned ints must be 4 bytes wide. This
 isn't true for targets like avr. Explicitly using __UINT32_TYPE__
 behind a typedef makes the testcase pass for all targets.

 Committed to trunk.

Regards
Senthil

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.

 Index: gcc.dg/tree-ssa/pr64130.c
diff mbox

Patch

===================================================================
--- gcc.dg/tree-ssa/pr64130.c   (revision 240299)
+++ gcc.dg/tree-ssa/pr64130.c   (revision 240300)
@@ -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;