blob: 3a96786fefea386fe7723a538e64f358f95793d8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
/* PR optimization/11210 */
/* Originator: Guido Classen <guido@clagi.de> */
/* Reduced testcase by Falk Hueffner <falk@debian.org> */
/* { dg-do compile } */
/* { dg-options "-O" } */
/* Verify that the constant expressions folder doesn't
throw away the cast operation in the comparison. */
struct str {
int head;
signed char data[8];
};
int foo(struct str t)
{
return t.data[0] || (unsigned char) t.data[2] != 130; /* { dg-bogus "comparison is always 1" } */
}
|