2 bug-3504.c. An expression with an optimized-out cast was handled as if the optimized-out cast had never been there.
7 unsigned int total
= 0;
8 unsigned char prev
= 255;
11 unsigned char now
= 13;
12 total
+= (unsigned char)(now
- prev
); /* Code behaved as if the cast in this line was not there. */
16 unsigned char now
= 13;
17 total
+= (unsigned char)(now
+ prev
); /* Code behaved as if the cast in this line was not there. */
26 ASSERT (total
== 14 + 12);