Overlapping Allocas

Dear All,

Is there an optimization in the x86 back-end that could cause two alloca's to use overlapping memory?

-- John T.

It's theoretically possible, but IIRC there isn't any such
optimization implemented at the moment.

-Eli

Dear All,

Is there an optimization in the x86 back-end that could cause two
alloca's to use overlapping memory?

It's theoretically possible, but IIRC there isn't any such
optimization implemented at the moment.

Could the tail call optimization cause something like this? If there's an alloca in a function and the function is called recursively, could tail call optimization cause all dynamic instances of the alloca to be allocated in the same place on the stack?

-- John T.

Yes, that's possible (although I would expect it to be rare).

-Eli

Dear All,

Is there an optimization in the x86 back-end that could cause two
alloca's to use overlapping memory?

It's theoretically possible, but IIRC there isn't any such
optimization implemented at the moment.

Could the tail call optimization cause something like this? If there's an
alloca in a function and the function is called recursively, could tail call
optimization cause all dynamic instances of the alloca to be allocated in
the same place on the stack?

Yes, that's possible (although I would expect it to be rare).

Thanks.

Is there any way to turn tail call optimization off from the clang command line?

-- John T.

I don't think there is... please file a bug.

-Eli