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

--- Comment #13 from dhekir at gmail dot com ---
Thank you very much for the work.

Running the attached file with `-O -finline-small-functions` does compile in
under 30 seconds on my computer.

However, when trying to compile the original program (which is about 1 million
lines, and each call passes 2 structures as arguments, instead of just calling
a function without any arguments), it's taking several dozen minutes. I tried
preprocessing it (5s to obtain the .i) file, and then running it with `-O
-finline-small-functions`, or `-O2`, or `-O3`, and without any options at all,
and in all cases, I ended up terminating the program before it finished (after
more than 10 minutes; in some cases I waited up to 30 minutes).

I tried re-simplifying the program. After preprocessing, I tried the following
variants, with options `-O -finline-small-functions`:

- 1M calls, no arguments, function returning a (global) struct: compiles in
30s;
- 1M calls, each with a single argument of type `struct s`, function returns
that same argument (that is, `struct s f(struct s s1) {return s1;}`): compiles
in <2 minutes;
- 1M calls, each with 2 arguments of types `struct s1` and `struct s2`,
returning the second argument (that is, `struct s2 f(struct s1 arg1, struct s2
arg2) {return arg2;}`): >50 minutes (I had to terminate it).

The last version, with -O2, I left it compiling for almost 3h before having to
stop it.

In any case, this bug seems definitely solved for me, and I no longer have the
original stack overflow. However, I am still unable to compile my original
code, so I'll have to try something else. It's possibly not a regression,
however.

I'm attaching it in case you may want to try it, but feel free to ignore it.

Reply via email to