Mercury Bugs - mercury
View Issue Details
0000280mercuryBugpublic2013-04-11 14:062015-07-07 15:23
Reporterjuliensf 
Assigned Tojuliensf 
PrioritynormalSeverityminorReproducibilityalways
StatusresolvedResolutionfixed 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0000280: Parser stack overflow with MSVC
DescriptionAttempting to compile compiler/options.c (from the rote-2012-04-10 srcdist) with MSVC
results in:

    fatal error C1026: parser stack overflow, program too complex

It looks as though the C code we generate for the predicate long_option/2 is too
heavily nested; I'll try to separate it out a bit and see if that avoids the limitation.
TagsNo tags attached.
Attached Files

Notes
(0000505)
juliensf   
2013-04-11 14:09   
Actually, the problem may be that the source distribution is built with --no-smart-indexing.
(The other approaches for string switches shouldn't bump into these sort of limitations.)
(0000506)
juliensf   
2013-04-11 16:34   
It's fine if you rebuild the .c files with --smart-indexing. In the long term, I would like to be able
to compile the MSVC version of Mercury directly from the source distribution. Some options here are:

(1) Work out whether --smart-indexing is still causing problems with the source distribution.

(2) Manually, break long_options/2 into smaller chunks.

(3) If compiling with --no-smart-indexing then change the MLDS code generator so that
it breaks deeply nested if-then-else chains into separate C functions -- i.e. get the code generator
to do (2).
(0000837)
juliensf   
2015-07-07 15:23   
The source distribution C files are now built with --smart-indexing enabled (option 1 above).

Issue History
2013-04-11 14:06juliensfNew Issue
2013-04-11 14:06juliensfStatusnew => assigned
2013-04-11 14:06juliensfAssigned To => juliensf
2013-04-11 14:09juliensfNote Added: 0000505
2013-04-11 16:34juliensfNote Added: 0000506
2015-07-07 15:23juliensfNote Added: 0000837
2015-07-07 15:23juliensfStatusassigned => resolved
2015-07-07 15:23juliensfResolutionopen => fixed