https://gcc.gnu.org/bugzilla/show_bug.cgi?id=12454

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|compile-time-hog            |
            Summary|large number of if ();else  |large number of if (); else
                   |if cause                    |if in g++.dg/parse/stack1.C
                   |                            |cause stack exhaustion

--- Comment #11 from Richard Biener <rguenth at gcc dot gnu.org> ---
g++.dg/parse/stack1.C is now optimized quickly by the FE and we enter
gimplification with

;; Function void foo() (null)
;; enabled by -tree-original


(void) 0;

adjusting the testcase to the following reproduces the recursion issue in
gimplify_cond_expr though the problem is hardly that but the generic design
of the gimplifier.

#define ONE     else if (i) { }
#define TEN     ONE ONE ONE ONE ONE ONE ONE ONE ONE ONE
#define HUN     TEN TEN TEN TEN TEN TEN TEN TEN TEN TEN
#define THOU    HUN HUN HUN HUN HUN HUN HUN HUN HUN HUN

void foo(int i)
{
  if (i) { }
  /* 11,000 else if's.  */
  THOU THOU THOU THOU THOU THOU THOU THOU THOU THOU THOU
}

Reply via email to