Error:E010:Irreducible ControlFlow Detected - Intimidating But Easy to Fix

Discussion created by aj_guillon on Oct 3, 2010
Latest reply on Oct 3, 2010 by himanshu.gautam

I had a kernel which failed to compile with a very intimidating message: Error:E010:Irreducible ControlFlow Detected

I spent a lot of time trying to understand what irreducible control flow really is... seeking out friends who work on compilers, talking with others, and looking at lecture notes online, searching for some deep conceptual error.  In reality... the problem was something anyone could have spotted:

for(int i = min_xy.s0; x<= max_xy.s0; ++i)

Of course... this is wrong... x is declared and in scope, but I meant i there.  I'm posting this not to brag about how long it took me to find a silly error, but to ask if the developers can give slightly simpler error messages... if the error message had also said: "Is there a simple typo?" or something like "This could mean X or Y or Z..." I would have quickly spotted an ordinary typo very quickly.  Intimidating messages make people think there is a huge problem, when there is really a simple one :-)