[llvm] r179111 - Revert r176408 and r176408 to address PR15540.

Nuno Lopes nunoplopes at sapo.pt
Sat Apr 13 23:43:31 PDT 2013


> On 4/13/13 11:19 PM, Nuno Lopes wrote:
>> Hi,
>>
>> In summary, I would like to reapply r176407, yes.
>> The reason is that it is the correct fix for PR15540. This new function, 
>> getUnderlyingObjectSize(), gives exactly the semantics that BasicAA wants 
>> (which is to get the size of the object pointed by a given pointer).
> To be pedantic, BasicAA need min-size-of-all-potential-object pointed by 
> the pointer in question.

Sure, the precision of the analysis could be improved. The same goes with 
constant folding expressions involving __builtin_object_size().
At this point, the only analysis we have is this one, that compute exact 
object sizes instead of ranges.


>> The function getObjectSize(), on the other hand, gives the size of an 
>> object minus the offset of the given pointer. Using getObjectSize() is 
>> therefore wrong (I wrote that code, but later I realized my mistake).
> Before the r176407, the compiler avoid the problem by *NOT* evaluating the 
> size if the pointer does not points to a object.

Analyzing phi nodes is orthogonal to getUnderlyingObjectSize(). Please don't 
mix the two.
What you can say is that the analysis was improved to be more aggressive by 
analyzing phi nodes, which triggered the *latent* bug in the LTO build.


>> I believe r176407 is the correct fix, and it should be reapplied.
>>
> Then come up an example to prove r176407-1 dose not work.

I believe your patch does work, since you restrict the analysis to pointers 
pointing to a single object.  But that's overly restrictive, and inhibits 
further improvements.

Nuno 




More information about the llvm-commits mailing list