[llvm-commits] [patch][pr11029] fix for internal crash due to ExpandUnalignedLoad/Store not handling indexed loads correctly

Kristof Beyls kristof.beyls at arm.com
Wed Oct 26 08:40:29 PDT 2011


The attached patch fixes PR11029 (
http://llvm.org/bugs/show_bug.cgi?id=11029 ).

The root cause of the problem seems to be that ExpandUnalignedLoad and
ExpandUnalignedStore doesn't handle indexed loads or stores correctly.

There seem to be 2 possible ways to fix this:
1. Implement support for indexed loads/stores in the above functions.
2. Don't generate indexed load/stores in cases where these will need to be
expanded.

The attached patch implements the second approach. The reasons for going
with the second approach are:
* The generation of indexed loads/stores seems to be an optimization. The
second approach chooses not to do the optimization when it's not supported.
* There will not be a regression in code generation, since in the cases that
the patch prohibits optimization, the compiler would crash or generate
incorrect code with a high probability.
* It's unclear whether generating indexed loads/stores for unaligned
loads/stores that need expanding would actually result in better quality of
the generated code.

Could someone review the patch and commit it if fine?

Thanks,

Kristof
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr11029_fix.patch
Type: application/octet-stream
Size: 9506 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20111026/651f1731/attachment.obj>


More information about the llvm-commits mailing list