Compiling via C/C++ and compiler bugs/limits -


i'm looking @ possibility of implementing high-level (lisp-like) language compiling via c (or possibly c++ if exceptions turn out useful enough); strategy number of projects have used. of course, generate c code unlike, , perhaps in dimensions exceeding complexity of, write hand.

modern c compilers highly reliable in normal usage, it's hard know bugs might lurking in edge cases under unusual stresses, particularly if go on "well no programmer ever write x bigger y" hidden limit.

it occurs me coincidence of these facts might lead unhappiness.

are there known cases, or there way find cases, of generated code tripping on edge case bugs/limits in reasonably recent versions of major compilers (e.g. gcc, microsoft c++, clang)?

this may not quite answer looking for, quite few years ago, worked on project, parts of system written in higher level language, easy build state machines in processes. language produced c-code compiled. compiler using project gcc (version around 2.95 - don't quote me on that, pre-3.0 sure). did run couple of code generation bugs, was, memory more using not-so-popular processor [revealing processor may reveal shouldn't project, i'd rather not was, if long time ago].

a colleague close me investigating 1 of code generation bugs, in function of around 200k lines, of function big switch-statement, each case in switch statement being around 50-1000 lines each (with several layers of sub-switch statements inside it).

from memory of it, code crashing because produced invalid operation or stored in register occupied else, once hit right bit of code, fail due illegal memory access - , had nothing long size of code, because colleague managed down 30 lines of code (after lot of "lets cut out , see if still goes wrong"), , after few days had new version of compiler fix. nice know many thousands of dollars pay compiler service contract worth having @ least sometimes...

my point here modern compilers tolerate lot of large code. there minimum limits "a compliant compiler must support @ least of ". example, believe (from memory, again), compiler needs support 127 levels of nested statements (that is, combination of 127 if, switch, while , do-while) within function. and, discussion somewhere (which "the compiler should support 127 levels of nested statements" comes from), found msvc , gcc both support whole lot more (enough gave on finding it...)


Comments

Popular posts from this blog

java - Jmockit String final length method mocking Issue -

asp.net - Razor Page Hosted on IIS 6 Fails Every Morning -

c++ - wxwidget compiling on windows command prompt -