PR tree-optimization/81303
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / pr20739.c
blobc1e7b58e38543532f4d200193dc1767f9a654dd7
1 /* PR middle-end/20739 */
3 /* dg-do compile */
4 /* dg-options "-O" */
6 /* We used to fail to compile this because gimplification dropped the
7 conversion that added the const qualifier to the sub-expression
8 involving baz, and then immediately noticed and reported its
9 absence. */
11 typedef struct
13 char chars[5];
15 baz_t;
17 extern baz_t * baz;
19 extern void foo (baz_t);
20 int
21 bar (const baz_t * ls)
23 foo (ls == 0 ? *(&baz[0]) : *ls);