1  /* PR rtl-optimization/52714
       2  
       3     Check that combine manages to remove the "stack == 0" test.
       4     Without ICEing.  */
       5  
       6  /* { dg-do compile } */
       7  /* { dg-options "-O1" } */
       8  
       9  int __re_compile_fastmap(unsigned char *p)
      10  {
      11      unsigned char **stack;
      12      unsigned size;
      13      unsigned avail;
      14  
      15      stack = __builtin_alloca(5 * sizeof(unsigned char*));
      16      if (stack == 0)
      17  	return -2;
      18      size = 5;
      19      avail = 0;
      20  
      21      for (;;) {
      22  	switch (*p++) {
      23  	case 0:
      24  	    if (avail == size)
      25  		return -2;
      26  	    stack[avail++] = p;
      27  	}
      28      }
      29  
      30      return 0;
      31  }
      32  
      33  /* { dg-final { scan-assembler-not {\mtst\.l %sp\M} } } */