This is the mail archive of the gcc@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]

Inlining vs the stack


We had a situation come up here where things are like this (simplified, obviously):

c() { char x[1000000]; }
a() { b(); c(); }
b() { a(); c(); }

c() is a leaf. Without inlining, no problem. WIth c() inlined into a() and/or b(),
a few mutually recursive calls to a() and b() blow out the stack. It's not clear
the inliner should try to do anything about this, but I think it's worth discussing.
The inliner can't detect the recursive loop in the general case, since it might
be split across files, so the thing to do would be put some (target-OS-dependent)
limit on local stack usage of the inlinee. Right now there's no such check.



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