This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

C11 Internal Error with 64-bit integer

The following snippet of code gives me an internal C11 error. I will appreciate any help in this regard. I am using uVision3 for ARM7 (Philips LPC2148 processor). This of course is a very simplified sample from a relatively large project.

-----------------------------
void main(void)
{
unsigned long* ResultValue = 0;
unsigned long DummyValue = 0;

*ResultValue = (unsigned long long)1 - DummyValue;
}
-----------------------------
main.c(6): error C11: internal error: (asmgen - triple=T0023)
-----------------------------

The error goes away if I replace the constant value "1" with a variable, or replace the variable "DummyValue" with a constant.

Thanks,
Akbar.

Parents
  • Same error even if I do 1ULL instead of type casting it. The only workaround to this problem that I have found so far is to use a variable, assign it the value of constant and then use it in the expression. It works fine in that case. It may have something to do with the mixing of 64-bit constant with 32-bit variable. I did run a check on doing the same with 32-bit constant and 16-bit variable but that works fine.

    Andy, I may not have understood your question. Do you mean if I use 64-bit constants in the whole expression? In that case, it also works fine. Even if I replace the constant with variable and do the same typecasting, program compiles without errors.

Reply
  • Same error even if I do 1ULL instead of type casting it. The only workaround to this problem that I have found so far is to use a variable, assign it the value of constant and then use it in the expression. It works fine in that case. It may have something to do with the mixing of 64-bit constant with 32-bit variable. I did run a check on doing the same with 32-bit constant and 16-bit variable but that works fine.

    Andy, I may not have understood your question. Do you mean if I use 64-bit constants in the whole expression? In that case, it also works fine. Even if I replace the constant with variable and do the same typecasting, program compiles without errors.

Children