1/* PR tree-optimization/28632 */ 2/* { dg-do compile } */ 3/* { dg-options "-O2 -ftree-vrp -fno-tree-ccp" } */ 4/* { dg-require-effective-target int32plus } */ 5 6void 7v4 (unsigned a, unsigned b) 8{ 9 if (a < 0x1000) return; 10 if (a > 0x1000) return; 11 if (b < 0x0110) return; 12 /* constant true. */ 13 if (!__builtin_constant_p ((a|b) >= 0x01000)) 14 __asm__("vrp.bug.always.true"); 15 /* VRP must not think that this is constant. */ 16 if (__builtin_constant_p ((a|b) >= 0x10000)) 17 __asm__("vrp.bug.not.always.true"); 18} 19 20void 21u4 (unsigned n) 22{ 23 if (n > 0x10111) return; 24 if (n < 0x10101) return; 25 /* always true. */ 26 if (!__builtin_constant_p (n & 0x00100)) 27 __asm__("vrp.bug.always.true"); 28 /* VRP must not think that this is constant true. */ 29 if (__builtin_constant_p (n & 0x00001)) 30 __asm__("vrp.bug.not.always.true"); 31 /* Out of range, always evaluates to constant false. */ 32 if (!__builtin_constant_p (n & 0x01000)) 33 __asm__("vrp.bug.always.false"); 34} 35 36void 37u5 (unsigned n) 38{ 39 struct s {unsigned exp:8;} x; 40 x.exp = n; 41 if (__builtin_constant_p(((n + 1) & 255) > 1)) 42 __asm__("vrp.bug.not.always.true"); 43} 44 45void 46v5 (int a, int b) 47{ 48 if (a < 0x1000) return; 49 if (a > 0x1000) return; 50 if (b < 0x0110) return; 51 /* constant true. */ 52 if (!__builtin_constant_p ((a|b) >= 0x01000)) 53 __asm__("vrp.bug.always.true"); 54 /* VRP must not think that this is always true. */ 55 if (__builtin_constant_p ((a|b) >= 0x10000)) 56 __asm__("vrp.bug.not.always.true"); 57} 58 59/* { dg-final { scan-assembler-not "vrp\\\.bug\\\." } } */ 60