Platform: Linux GCC x86.  I have generated a test case where the code I have 
using a C99 array with variable length causes a segmentation fault.  The thing 
is, if I comment out an unrelated line of code that is impossible to be 
executed and not in the execution pathway (it's in the body of an if statement 
that can not be executed because of the conditional anyway and added to that, I 
put a return 0; in front of the line of code so if it did happen to get in 
there, it would return before executing the line of code) the segmentation 
fault does not happen.  Also, if I don't do that, but I do comment out an 
unused automatic variable defined in the main() function (which calls the test 
function), the segmentation fault does not happen.  The test code is ~40 lines 
long and contains all the temporary files requested, the version information, 
and a more detailed explanation of how to reproduce the segmentation fault.  
This is all in a tar.gz file that you can get from 
http://www.sinistershane.net/~shane/files/testcase.tar.gz

The segv appears in both x86_64 and x86 (32bit) executables.

-- 
           Summary: C99 array of variable length use causes segmentation
                    fault
           Product: gcc
           Version: 3.3.4
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: shane256 at hotmail dot com
                CC: gcc-bugs at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21536

Reply via email to