This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug optimization/12640] [tree-ssa] strlen builtin causes stack overflow building tk


------- Additional Comments From steven at gcc dot gnu dot org  2003-11-12 17:57 -------
Just an infinite loop in tree-ssa-ccp.c:get_strlen() 
 
Smaller test case: 
 
typedef struct PendingCommand 
{ 
  char *result; 
  struct PendingCommand *nextPtr; 
} PendingCommand; 
 
static void 
SendEventProc (char *resultString) 
{ 
  char *p; 
  PendingCommand *pc, *pcPtr; 
 
  resultString = ""; 
  while (*p == '-') 
    { 
      if (p[2] == ' ') 
        { 
          resultString = p + 3; 
        } 
    } 
  for (pcPtr = pc; pcPtr != ((void *) 0); pcPtr = pcPtr->nextPtr) 
    { 
      pcPtr->result = malloc (strlen (resultString) + 1); 
      strcpy (pcPtr->result, resultString); 
    } 
} 
 
Diego, your patch/function cause this, perhaps you can have a look? 

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2003-11-12 17:57:58
               date|                            |


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]