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

Compiling something like this:

typedef char near * SWITCHES_LIST[];
typedef SWITCHES_LIST near * SWITCHES_LIST_POINTER;

typedef struct
{
void near *switches;
} PISTON;

int sub (PISTON *p)
{
int index;

...
if (*((*((SWITCHES_LIST_POINTER) p->switches))[index]))
...

}

I get: "error C11: internal error: (asmgen - triple=t0322)" on "if" row.
These rows has been extracted from a large project. Lowering the "code optmimization level" to 0 does not change anything. But I am not able to reproduce the error in a sample project.
All the project has been "linted" succesfully, so I am quite sure that there are not syntax errors.
I have been able to compile only breaking down the "if" in 2 rows, like:

switches = (SWITCHES_LIST *) piston->forward_switches;
if (*((*switches)[index]))
...

Did somebody have already seen something like this ???

  • "I get: "error C11: internal error: (asmgen - triple=t0322)" on "if" row."

    Congratulations! You've broken the compiler. Clearly it doesn't like typedef any more than I do.

    Seriously though, you need to report this to Keil. Either you've exceeded the expected limits of the compiler (unlikely) or you've found a bug, albeit one that is handled gracefully.

  • I have been able to compile only breaking down the "if" in 2 rows, like:

    switches = (SWITCHES_LIST *) piston->forward_switches;
    if (*((*switches)[index]))
    With such a horrendously complicated expression as that, it is certainly a good idea to break it down - probably even further than you have already!

    Can you honestly say that you can just look at a line like
    if (*((*((SWITCHES_LIST_POINTER) p->switches))[index]))
    and say for sure that you know precisely what it does?