-
Notifications
You must be signed in to change notification settings - Fork 472
Add back test case for #5333 #5351
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Signed-off-by: Kyle Cripps <[email protected]>
ChrisDodd
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like this testcase shows there's still room for improving the warning message
| @@ -0,0 +1,3 @@ | |||
| issue5331_srcinfo.p4(4): [--Wwarn=overflow] warning: x << 18: shifting value with 16 bits by 18 | |||
| __e(y); | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't the clearest warning, but it is not clear what should in it -- the 18 comes from inlining and constant folding a call, so there are multiple places in the code that are relevant. At the very least, though, it should identify the point in the code that has the shift (line 8)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is definitely better, so maybe #5333 should be doing less. The source info on the shift operation itself should not be changing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe #5333 should only copy the source info if it is not already set to something else?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@asl Please comment
testdata/p4_16_samples_outputs/issue5331_srcinfo.p4 got removed in #5334 (the explicit cast warning got removed and I didn't have another test case for #5333 at that time). Now I've found a new slightly different test case for #5333, so I'm adding it back.