[llvm-commits] [llvm] r164178 - in /llvm/trunk: lib/Transforms/Scalar/SROA.cpp test/Transforms/SROA/basictest.ll

Duncan Sands baldrick at free.fr
Wed Sep 19 06:33:54 PDT 2012


Hi Chandler,

> Fix the last crasher I've gotten a reproduction for in SROA. This one
> from the dragonegg build bots when we turned on the full version of the
> pass. Included a much reduced test case for this pesky bug, despite
> bugpoint's uncooperative behavior.
>
> Also, I audited all the similar code I could find and didn't spot any
> other cases where this mistake cropped up.
>
> Modified:
>      llvm/trunk/lib/Transforms/Scalar/SROA.cpp
>      llvm/trunk/test/Transforms/SROA/basictest.ll
>
> Modified: llvm/trunk/lib/Transforms/Scalar/SROA.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/SROA.cpp?rev=164178&r1=164177&r2=164178&view=diff
> ==============================================================================
> --- llvm/trunk/lib/Transforms/Scalar/SROA.cpp (original)
> +++ llvm/trunk/lib/Transforms/Scalar/SROA.cpp Tue Sep 18 17:37:19 2012
> @@ -1487,6 +1487,8 @@
>       return 0;
>
>     Type *ElementTy = Ty->getElementType();
> +  if (!ElementTy->isSized())
> +    return 0; // We can't GEP through an unsized element.

actually you can, if all the indices are zero.

Ciao, Duncan.



More information about the llvm-commits mailing list