[LLVMdev] llvm-as regression

Eli Friedman eli.friedman at gmail.com
Fri Jul 24 15:00:52 PDT 2009


On Fri, Jul 24, 2009 at 1:21 PM, Bagel<bagel99 at gmail.com> wrote:
> The following causes an assertion in recent svn pulls, but not in 2.5.
>
> The assertion:
>
> llvm-as: /home/bgl/work/llvm-work/include/llvm/ADT/SmallVector.h:125: T&
> llvm::SmallVectorImpl<T>::operator[](unsigned int) [with T = llvm::Constant*]:
> Assertion `Begin + idx < End' failed.

Fixed in r77005.

> The .ll code:
>
> target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:32"
> target triple = "x86-unknown-unknown"
> @foo = constant [4 x [0 x i8]*] [
> [0 x i8]* bitcast( [5 x i8]* getelementptr( [5 x i8]* @.str1 )  to [0 x i8]* ),

You're using getelementptr in a slightly strange way here; it isn't
illegal, but LLVM would never generate it because of the constant
folder.

> I'm not sure how to proceed on tracking down the cause.

gdb is your friend; a backtrace made the issue pretty obvious.

-Eli




More information about the llvm-dev mailing list