[llvm-dev] [Clang] memory allocation

Mohammad Norouzi via llvm-dev llvm-dev at lists.llvm.org
Tue Nov 26 05:37:25 PST 2019


I see it now.

But, why do they have different memory addresses when compiled with -O1?

Is there a specific optimization that prevents using/reusing the same stack
space?

Tnx!

On Tue, Nov 26, 2019 at 1:21 PM Tim Northover <t.p.northover at gmail.com>
wrote:

> On Tue, 26 Nov 2019 at 12:05, Mohammad Norouzi via llvm-dev
> <llvm-dev at lists.llvm.org> wrote:
> > However, OK is called inside nqueens. So, the same stack space cannot be
> used/reused for both of them.
>
> nqueens is also called inside nqueens because it's a recursive
> implementation, and it's those two calls within nqueens that reuse the
> stack space. Notice that the reuse is *after* ok gets called.
>
> Cheers.
>
> Tim.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20191126/2c389d2a/attachment-0001.html>


More information about the llvm-dev mailing list