From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: Date: Wed, 15 May 1996 01:46:34 -0500 (CDT) From: Richard Henderson Subject: Re: other gcc problem In-Reply-To: <9605142042.AA08411@nova.tat.physik.uni-tuebingen.de> > with anything but "-O0" takes >800 seconds on a XL266, "-O0" takes only > ~3 seconds and on my i486 "gcc -O2" takes ~9 seconds. There is a bit of over-aggressiveness in the combiner as it tries to simplify the entire function as a set of nested if-then-else expressions to see if the return value is constant. Unfortunately, this creates an expression tree that leads to exponential run-times later on. I would suspect this nastiness to be triggered on any target that supports conditional moves. Which explains why the problem does not show up on the i386 target. Though this is not a particularly good solution, it will let you get on with your work while a more permanent fix is explored. Expect a bit of fuzz on the patch. r~ --- combine.c.orig Tue Apr 16 15:00:58 1996 +++ combine.c Wed May 15 00:50:41 1996 @@ -3049,6 +3086,8 @@ simplify_rtx (x, op0_mode, last, in_dest SUBST (XEXP (x, 0), gen_binary (PLUS, mode, new, temp)); } +#if 0 + /* While logically correct, this can result in exponential run time. */ /* If this is a simple operation applied to an IF_THEN_ELSE, try applying it to the arms of the IF_THEN_ELSE. This often simplifies things. Check for cases where both arms are testing the same @@ -3120,6 +3159,7 @@ simplify_rtx (x, op0_mode, last, in_dest op0_mode = VOIDmode; } } +#endif /* Try to fold this expression in case we have constants that weren't present before. */