Quuxplusone / LLVMBugzillaTest

0 stars 0 forks source link

Internal compiler error: Assertion `Ty && "GEP indices invalid!"' failed #4853

Closed Quuxplusone closed 14 years ago

Quuxplusone commented 15 years ago
Bugzilla Link PR4349
Status RESOLVED FIXED
Importance P normal
Reported by Maurus Cuelenaere (mcuelenaere@gmail.com)
Reported on 2009-06-08 17:23:28 -0700
Last modified on 2009-10-30 07:04:20 -0700
Version 2.5
Hardware PC Linux
CC baldrick@free.fr, dalej@apple.com, llvm-bugs@lists.llvm.org, nicholas@mxc.ca
Fixed by commit(s)
Attachments save.i (145957 bytes, application/octet-stream)
x.c (188 bytes, text/plain)
Blocks
Blocked by
See also
Created attachment 3072
Preprocessed source

When compiling the Rockbox source code as simulator, I encountered the
following bug:

cc1: /build/buildd/llvm-2.2/lib/VMCore/Constants.cpp:1862: static
llvm::Constant* llvm::ConstantExpr::getGetElementPtr(llvm::Constant*,
llvm::Value* const*, unsigned int): Assertion `Ty && "GEP indices invalid!"'
failed.
/home/mcuelenaere/rockbox/apps/plugins/rockboy/save.c:155: internal compiler
error: Aborted
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://developer.apple.com/bugreporter> for instructions.

I attached the preprocessed source as requested.
Quuxplusone commented 15 years ago

Forgot to mention:

the preprocessed source was generated with this command:

/usr/bin/ccache /usr/bin/llvm-gcc -I/home/mcuelenaere/rockbox/apps/plugins/rockboy/ -I/home/mcuelenaere/rockbox/apps/plugins -DPLUGIN -I/home/mcuelenaere/rockbox/build-llvm -I/home/mcuelenaere/rockbox/build-llvm/lang -I/home/mcuelenaere/rockbox/firmware/target/mips/ingenic_jz47xx/onda_vx747 -I/home/mcuelenaere/rockbox/firmware/target/mips/ingenic_jz47xx -I/home/mcuelenaere/rockbox/firmware/target/mips -I/home/mcuelenaere/rockbox/firmware -I/home/mcuelenaere/rockbox/firmware/include -I/home/mcuelenaere/rockbox/firmware/export -I/home/mcuelenaere/rockbox/firmware/common -I/home/mcuelenaere/rockbox/firmware/drivers -I/home/mcuelenaere/rockbox/build-llvm/bitmaps -I/home/mcuelenaere/rockbox/apps -I/home/mcuelenaere/rockbox/apps/recorder -I/home/mcuelenaere/rockbox/apps/gui -I/home/mcuelenaere/rockbox/uisimulator/sdl -I/home/mcuelenaere/rockbox/uisimulator/common -DROCKBOX -DMEMORYSIZE=16 -DMEM=16 -DONDA_VX747 -DTARGET_ID=44 -DTARGET_NAME=\"ondavx747\" -DAPPSVERSION=\"r21226M-090608\" -DYEAR=2009 -DMONTH=06 -DDAY=08 -DSIMULATOR -W -Wall -g -fno-builtin -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -I/home/mcuelenaere/rockbox/uisimulator/sdl -Wno-pointer-sign -fno-strict-aliasing -Wno-override-init -E /home/mcuelenaere/rockbox/apps/plugins/rockboy/save.c > save.i

Quuxplusone commented 15 years ago

Attached save.i (145957 bytes, application/octet-stream): Preprocessed source

Quuxplusone commented 15 years ago

Attached x.c (188 bytes, text/plain): reduced .c testcase

Quuxplusone commented 15 years ago
Same thing on Darwin.
Maurus, llvm-2.2 is quite old at this point, you should get a later version.
Not that it will be bug free (obviously) but will be better.
Quuxplusone commented 15 years ago
Dale,

I tried LLVM 2.5 but now I'm getting lots of undefined references to
`__compound_literal.*' in an other file.
Quuxplusone commented 15 years ago
Forgot mentioning the specific versions:

mcuelenaere@wim2160:~/rockbox/build-llvm$ llvm-gcc -v
Using built-in specs.
Target: i486-linux-gnu
Configured with: ../llvm-gcc-4.2-2.5/configure --host=i486-linux-gnu --
build=i486-linux-gnu --prefix=/usr/lib/llvm/gcc-4.2 --enable-languages=c,c++ --
program-prefix=llvm- --enable-llvm=/usr/lib/llvm --enable-threads --disable-nls
--disable-shared --disable-multilib
Thread model: posix
gcc version 4.2.1 (Based on Apple Inc. build 5636) (LLVM build)
mcuelenaere@wim2160:~/rockbox/build-llvm$ llvmc --version
Low Level Virtual Machine (http://llvm.org/):
  llvm version 2.5 (Debian 2.5-0ubuntu1)
  Optimized build with assertions.
  Built Mar  6 2009(17:11:47).
Quuxplusone commented 15 years ago
(In reply to comment #4)
> I tried LLVM 2.5 but now I'm getting lots of undefined references to
> `__compound_literal.*' in an other file.

That would be PR 3518.  I thought that had been fixed but apparently not.
Quuxplusone commented 15 years ago
(In reply to comment #2)
> Created an attachment (id=3073) [details]
> reduced .c testcase
>
> With current LLVM, this causes a very different error:
>
> $ llvm-gcc x.c
> cc1: ../../src/gcc/llvm-convert.cpp:7318: static llvm::Constant*
> TreeConstantToLLVM::EmitLV(tree_node*): Assertion `((((enum tree_code)
> (((exp)->common.type))->common.code) == VOID_TYPE) || LV->getType() ==
> ConvertType(((exp)->common.type))->getPointerTo()) && "LValue of constant has
> wrong type!"' failed.

This is fixed:
http://llvm.org/viewvc/llvm-project?view=rev&revision=73205
http://llvm.org/viewvc/llvm-project?view=rev&revision=73206

I realize Rockbox doesn't compile yet, but I'd like to close this one and track
the other problem under its existing report, PR 3518.
Quuxplusone commented 15 years ago

PR 3518 has been fixed so Rockbox may work now, does it?

Quuxplusone commented 15 years ago
(In reply to comment #8)
> PR 3518 has been fixed so Rockbox may work now, does it?
>

I tried to compile the current LLVM SVN version, but failed and didn't really
look into it; I'll try again.

IIUC both bugs manifested in LLVM-GCC and so I only need to build that one,
right?
Quuxplusone commented 15 years ago

That's probably true. Of course other things have changed. It sometimes happens that you need to update llvm as well because the interface between llvm and llvm-gcc has changed; I don't know that that's happened recently, but if you get compile-time errors or something, that's probably why.

Quuxplusone commented 14 years ago
Hi,

Update on this:

I just tested LLVM 2.6 and this compiles the Rockbox simulator just fine!

Thanks,
Maurus Cuelenaere