Please review writeup for fixing PR 78809 (inline strcmp for small constant strings)
Qing Zhao
qing.zhao@oracle.com
Mon Nov 20 15:54:00 GMT 2017
> On Nov 17, 2017, at 7:39 PM, Jeff Law <law@redhat.com> wrote:
>
>>>
>>
>> thanks for the info, Martin.
>>
>> In my case, it’s the size of “100” cannot be collected in the
>> MINMAXLEN[1] for the string “s”.
>>
>> I need to make sure that the size of variable string s is larger than
>> the size of constant string “abc” to guarantee the safety of the
>> transformation.
>>
>> currently, “get_range_strlen” cannot identify the simple VAR_DECL with
>> array_type to determine the maximum size of the string.
> It sounds more like you want the object_size interfaces. See
> tree-object-size.[ch]
As I mentioned in the other email, I tried the interface of object_size, i.e, “compute_builtin_object_size” to see whether it
can provide me good info on several simple examples, at that time, I didn’t see that it can provide good info for
very simple cases, so I switched to use “get_range_strlen” and modified it to serve my purpose.
I will double check on this.
Qing
> Jeff
More information about the Gcc
mailing list