On 11/29/18 4:43 PM, Martin Sebor wrote:
>> The fallout on existing tests is minimal.  What's more concerning is
>> that it doesn't actually pass the new test from Martin's original
>> submission.  We get bogus warnings.
>>
>> At least part of the problem is weakness in maybe_diag_stxncpy_trunc.
>> It can't handle something like this:
>>
>> test_literal (char * d, struct S * s)
>> {
>>    strncpy (d, "1234567890", 3);
>>    _1 = d + 3;
>>    *_1 = 0;
>> }
>>
>>
>> Note the pointer arithmetic between the strncpy and storing the NUL
>> terminator.
> 
> Right.  I'm less concerned about this case because it involves
> a literal that's obviously longer than the destination but it
> would be nice if the suppression worked here as well in case
> the literal comes from macro expansion.  It will require
> another tweak.
OK.  If this isn't at the core of the regression BZ, then xfailing those
particular cases and coming back to them is fine.

> 
> But the test from my patch passes with the changes to calls.c
> from my patch, so that's an improvement.
> 
> I have done the test suite cleanup in the attached patch.  It
> was indeed minimal -- not sure why I saw so many failures with
> my initial approach.
Richi's does the folding as part of gimple lowering.  So it's still
pretty early -- basically it ends up hitting just a few tests that are
looking for folded stuff in the .gimple dump.

I had actually targeted this patch as one to work through and try to get
resolved today.  Kind of funny that we were poking at it at the same time.


> 
> I can submit a patch to handle the literal case above as
> a followup unless you would prefer it done at the same time.
Follow-up is fine by me.

jeff

Reply via email to