This is an archive of the discontinued LLVM Phabricator instance.

InferFunctionAttrs: fix test case on aligned_alloc
ClosedPublic

Authored by durin42 on Jan 21 2022, 12:53 PM.

Details

Summary

This appears to have all the same attributes as many other functions
in this file, and I think the use of INACCESSIBLEMEMONLY_NOFREE_NOUNWIND
instead of INACCESSIBLEMEMONLY_NOFREE_NOUNWIND_WILLRETURN was an
oversight that meant aligned_alloc's attributes were just going
unchecked. This patch corrects the test defect and now the attributes
inferred on aligned_alloc are actually validated, and the test still
passes.

Diff Detail

Event Timeline

durin42 requested review of this revision.Jan 21 2022, 12:53 PM
durin42 created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptJan 21 2022, 12:53 PM
durin42 updated this revision to Diff 402905.Jan 25 2022, 7:04 AM
durin42 edited the summary of this revision. (Show Details)
reames requested changes to this revision.Jan 25 2022, 7:27 AM

It seems rather suspect to have a test change to fix an assertion. Either the IR is invalid - in which case the verifier should reject - or it's valid, and the pass can not crash.

Patch rejected.

p.s. Please provide detail on the assertion you're fixing.

This revision now requires changes to proceed.Jan 25 2022, 7:27 AM

It seems rather suspect to have a test change to fix an assertion. Either the IR is invalid - in which case the verifier should reject - or it's valid, and the pass can not crash.

Patch rejected.

p.s. Please provide detail on the assertion you're fixing.

As far as I can tell, this assertion was vacuous and never checked, presumably due to someone having replaced INACCESSIBLEMEMONLY_NOFREE_NOUNWIND with INACCESSIBLEMEMONLY_NOFREE_NOUNWIND_WILLRETURN and having missed one. Without this patch, the next change in the series doesn't notice the new allocalign() attribute that gets added to aligned_alloc (so it "spuriously" passes).

IOW: this was a buggy test before, and nobody noticed. I'm like 95% sure of that diagnosis.

I'm very open to suggestions on how to reword the commit message here, BTW. I thought it was clear, but seems not. :(

I'm very open to suggestions on how to reword the commit message here, BTW. I thought it was clear, but seems not. :(

The miscommunication here is that you meant "Fix a test-case to actually verify the behavior it was supposed to", whereas philip read it as "fixes an assert(...) failure"...by adjusting a test.

durin42 requested review of this revision.Jan 26 2022, 9:14 AM
durin42 updated this revision to Diff 403304.

I'm very open to suggestions on how to reword the commit message here, BTW. I thought it was clear, but seems not. :(

The miscommunication here is that you meant "Fix a test-case to actually verify the behavior it was supposed to", whereas philip read it as "fixes an assert(...) failure"...by adjusting a test.

If you say so. I see no way to get the former from the patch description, but that's probably the problem.

durin42 updated this revision to Diff 404918.Feb 1 2022, 7:00 AM
durin42 retitled this revision from InferFunctionAttrs: fix assertion on aligned_alloc to InferFunctionAttrs: fix test case on aligned_alloc.
durin42 edited the summary of this revision. (Show Details)
jyknight accepted this revision.Feb 2 2022, 9:01 AM

Commit title was fixed, so objection was resolved.

This revision was not accepted when it landed; it landed in state Needs Review.Feb 3 2022, 8:45 AM
This revision was automatically updated to reflect the committed changes.