1 /* PR tree-optimization/48022 */ 2 /* { dg-do compile } */ 3 /* { dg-options "-O2 -Wstrict-overflow" } */ 4 5 int foo(const char * x)6foo (const char *x) 7 { 8 unsigned long l = 1; 9 const unsigned char *s = (const unsigned char *) (const char *) (x); 10 int r = s[0] - ((const unsigned char *) (const char *) ("/"))[0]; 11 if (l > 0 && r == 0) 12 r = (s[1] - ((const unsigned char *) (const char *) ("/"))[1]); 13 return r; 14 } 15