Hi,
   We have problems using gcc 4.1.1. we are trying to compile a code in file
case17.cpp (see attached in testcase area). The problem is that compiler
forgets to call malloc and forgets to check the return value (see case17.s) and
it also forgets to initialize pointer called color. That is we do not see the
following lines reflected in the assembly output:

char **const colorTable = (char **)std::malloc(ncolors*sizeof*colorTable),
**volatile color=colorTable;
if(colorTable); else { return *oldct = 0; }


-- 
           Summary: G++ 4.1.1 forgets to allocate memory (skips part of user
                    code)
           Product: gcc
           Version: 4.1.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: satyaakam at yahoo dot co dot in


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

Reply via email to