[PATCH] PR18165: Fix overflow problem in LSR

Michael Zolotukhin mzolotukhin at apple.com
Tue Feb 18 12:49:08 PST 2014


Hi,

Attached is a fix for PR18165.

This patch fixes the following problem in LSR: when LSR replaces uses of one IV with the other, it needs to adjust the corresponding offsets. Adjusting here means multiplication by the strides ratio (factor). In the test we had one IV of type i8, its offset was 128, and the factor for this IV and the base IV was 2. LSR got the adjusted offset of 128*2=256 which later was truncated to i8, resulting in incorrect comparison result.

The patch adds a check for the validity of such adjustment. Is it ok for trunk?

-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr18165.patch
Type: application/octet-stream
Size: 6024 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140219/fba22d92/attachment.obj>
-------------- next part --------------


Thanks,
Michael


More information about the llvm-commits mailing list