[cfe-dev] Targets.cpp in clangDriver MSVC project missing and other issues

Wilhansen Li willi.t1 at gmail.com
Tue Jan 1 17:38:14 PST 2008


After investigating the problem, the main culprit seems to be the
compiler itself. You can't have more than 124~ if/else if chains. It
seems that the compiler translates

if ( /*cond_1*/ ) {
} else if ( /*cond_2*/ ) {
} else if ( /*cond_3*/ ) {
...
}

into

if ( /*cond_1 */ ) {
} else {
 if ( /*cond_2*/ ) {
 } else {
   if ( /*cond_3*/ ) {
   ...
   }
 }
}

Which perfectly explains the 124 limit. The documented limit in the
bug knowledgebase is  about 250. Halve that (due to the way the
conditions are nested) and you get about 125-124 as a limit for
if-else if chains. This bug still exists even in MSVC 2008 by the way.

@Anton: Sorry if this got double-sent, still getting used to mailing lists.

On 1/1/08, Anton Korobeynikov <asl at math.spbu.ru> wrote:
> Hello,
>
> > Moreover, when compiling Intrinsics.gen, msvc 2005 throws the error
> > "fatal error compiler limit : blocks nested too deeply" in line 4804.
> > Any ideas on how to fix this?
> Yes. Patch will land within next 2-3 days. There was some workaround
> submitted by Cedric Venet (sorry, if I misspelled the name) in this
> mailing list mid. December. I'm awfully sorry for not applying it - was
> pretty busy :(
>
> --
> WBR, Anton Korobeynikov
>


-- 
(<_<)(>_>)(>_<)(<.<)(>.>)(>.<)
Life is too short for dial-up.



More information about the cfe-dev mailing list