1 /* PR optimization/12640
2 
3    We used to get into an infinite loop while trying to
4    figure out `strlen (resultString)'.  This showed up as
5    a stack overflow while compiling tk.  */
6 
7 /* { dg-do compile } */
8 /* { dg-options "-O1" } */
9 
10 extern __SIZE_TYPE__ strlen (const char *);
11 
12 int i;
13 
14 static void
SendEventProc(char * resultString)15 SendEventProc (char *resultString)
16 {
17   char *p;
18 
19   resultString = "";
20   while (*p == '-')
21     {
22       if (p[2] == ' ')
23 	{
24 	  resultString = p + 3;
25 	}
26     }
27   for (;;)
28     {
29       i = strlen (resultString) + 1;
30     }
31 }
32 
33