bad definition/use of variable error
In revision 108d60c0 on x86-64
#include <stdint.h>
void a() { uint64_t b = 0 & 0 ? 0 * 0 && 0 : b; }
produces
error: In function a: bad definition/use of variable 60
I'm actually unsure if this program has a meaning according to the C standard, gcc does compile it without warning though.
Interesting. One can reduce the input it a little bit:
void a() { long long b = 0 & 0 ? 0 * 0 && 0 : b; }
The error seems to be triggered, when e.g. the Cminor representation contains code like this:
'$59' = longofint '$59';
Any modification of the input simplifies the code and such assignments don't happen anymore.
Yes, a temporary is being used with two different types (32- and 64-bit int), which is rejected by the Cminor and RTL type-checkers. A similar issue with conditional expressions was fixed a long time ago in https://github.com/AbsInt/CompCert/commit/0d27eae0b07c7c46cb7d4e6d7b0b1145dbdab0c3. Here it comes back as a bad interaction between conditional expressions and the &&/|| operators.