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 tree-optimization/20216] [4.0/4.1 Regression] Simple loop runs out of stack at -O1


------- Additional Comments From fjahanian at apple dot com  2005-02-27 00:51 -------
(In reply to comment #6)
> The first part of the patch seems fine.
> We should make tree_fold_binomial non-recursive.
You meant tree_fold_factorial? tree_fold_binomial is not recursive as is.

> Note, however, that once you do that, the other part of the patch isn't actually
> doing anything (the change to chrec_apply).
I agree. checking for 1024 is arbitrary and I did not propose it as a final solution.
I think a better solution would be to compute the factorial of the array upper bound,
as currently is done. If it cannot be evaluated, due to overflow, chrec_evaluate 
which depends on computation of tree_fold_binomial returns chrec_dont_know. In other words, we
do this optimization only when factorial can be computed. This prevents
setting an arbitrary limit and will let the implmentation limitations dicides feasibility
of this optimization. What do you think on a patch along this line?

> 
> Then all the memory usage comes from fold (all 600 meg of memory usage, i mean)
> creating new trees.
> It also doesn't recurse int hat case.
> 
> In any case, limiting the input to chrec_apply to <1024 is uh, wrong, as it's
> not really fixing anything.
> 

-- 


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


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