[LLVMdev] Overlapping Allocas

Eli Friedman eli.friedman at gmail.com
Fri Dec 2 15:10:47 PST 2011


On Fri, Dec 2, 2011 at 2:33 PM, John Criswell <criswell at illinois.edu> wrote:
> On 12/2/11 4:27 PM, Eli Friedman wrote:
>>
>> On Fri, Dec 2, 2011 at 2:23 PM, John Criswell<criswell at illinois.edu>
>>  wrote:
>>>
>>> On 12/2/11 3:24 PM, Eli Friedman wrote:
>>>>
>>>> On Fri, Dec 2, 2011 at 1:04 PM, John Criswell<criswell at illinois.edu>
>>>>  wrote:
>>>>>
>>>>> 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?

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

-Eli




More information about the llvm-dev mailing list