[cfe-commits] [PATCH] fix shifts that are defined in OpenCL but not in C99, etc

David Tweed David.Tweed at arm.com
Mon Jan 7 03:52:35 PST 2013


Hi, thanks for the review. I'll make the changes requested. With respect to

| Presumably, -fsanitize=shift should be disabled for OpenCL. It's
| included in -fsanitize=undefined, which should only catch undefined
| behavior.

I think the spirit is right. However, what I'll do is add an && !langOpts.OpenCL() to places where langOpts.SanitizeShift is used because

(a) Being certain of definedness of arithmetic ops is pretty tricky (IMO). It's not obvious to me whether every possibility is well-defined in OpenCL (v 1.2), so it's not clear if there are cases in OpenCL one would still want to sanitize, so I don't want to switch the whole thing off in the driver options when using OpenCL.

(b) Putting it nearby in the code makes it clearer this checking isn't done in OpenCL, so it'll be respected when stuff gets refactored.

I'll respin the patch and then commit.

(BTW: my swiss-cheese memory misattributed John McCall instead of Eli Friedman catching the array-size-given-by-constant-shift case.)

Thanks,
Dave

-- IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium.  Thank you.





More information about the cfe-commits mailing list