Closed llvmbot closed 14 years ago
An obvious fix is to mark R3 a sub-register of X3, but it's not entirely clear to me if that's semantically correct.
Yep, that's right. R3 is the low 32-bits of X3.
Come to think of it. Aliases is defined as "registers that this register overlaps with". That seems like a mismaatch. It's probably better to rename it "Overlaps" (or something better?)
Sure.
Should this bug be closed, now that your patch has been applied? Please check in a testcase also.
Thanks for taking care of this so quickly Evan!
-Chris
The problem is R3 is marked an alias of X3. But livevariables no longer process aliases, it only deals with sub- and super-registers.
An obvious fix is to mark R3 a sub-register of X3, but it's not entirely clear to me if that's semantically correct.
Come to think of it. Aliases is defined as "registers that this register overlaps with". That seems like a mismaatch. It's probably better to rename it "Overlaps" (or something better?)
Something is wrong upstream. BL8_Macho def / use PPC::X3 (printed as r3), but the move instruction (i.e. OR %r3, %r3) is refering to PPC::R3.
Something is wrong with LiveVariables:
12 %r3 = OR8 %reg1025
BL8_Macho implicit def of r3 is marked dead. But it does have a use.
Evan, can you please look into this? This makes it sound like ppc64 is completely broken (unable to build hello world?). If the fix is straight-forward, we should consider merging it into the llvm 2.0 branch.
-Chris
Extended Description
Compiling the following program, "llvm-gcc -m64 main.c":
include
int main(void) { printf("hello world.\n"); return 0; }
generates the following output:
$ llvm-gcc -m64 -v main.c Using built-in specs. Target: powerpc-apple-darwin8.9.0 Configured with: ../../configure --prefix=/Users/scottm/play/llvm-cfrontend/obj/powerpc-apple-darwin8.8.0/../../powerpc-apple-darwin8.8.0 --enable-llvm=/Users/scottm/play/llvm-cfrontend/obj/powerpc-apple-darwin8.8.0/../../../llvm/trunk/obj/powerpc-apple-darwin8.8.0 --disable-intl --disable-nls --enable-languages=c,c++ : (reconfigured) ../../configure --prefix=/Users/scottm/play/llvm-cfrontend/obj/powerpc-apple-darwin8.8.0/../../powerpc-apple-darwin8.8.0 --enable-llvm=/Users/scottm/play/llvm-cfrontend/obj/powerpc-apple-darwin8.8.0/../../../llvm/trunk/obj/powerpc-apple-darwin8.8.0 --disable-intl --disable-nls --with-gcc-version-trigger=/Users/scottm/play/llvm-cfrontend/gcc/version.c --enable-languages=c,c++ --no-create --no-recursion Thread model: posix gcc version 4.0.1 LLVM (Apple Computer, Inc. build 5449) /Users/scottm/play/llvm-cfrontend/powerpc-apple-darwin8.8.0/bin/../libexec/gcc/powerpc-apple-darwin8.9.0/4.0.1/cc1 -quiet -v -iprefix /Users/scottm/play/llvm-cfrontend/powerpc-apple-darwin8.8.0/bin/../lib/gcc/powerpc-apple-darwin8.9.0/4.0.1/ -DDYNAMIC main.c -fPIC -quiet -dumpbase main.c -mmacosx-version-min=10.4 -m64 -auxbase main -version -o /var/tmp//ccXnbSOF.s ignoring nonexistent directory "/Users/scottm/play/llvm-cfrontend/powerpc-apple-darwin8.8.0/bin/../lib/gcc/powerpc-apple-darwin8.9.0/4.0.1/../../../../powerpc-apple-darwin8.9.0/include" ignoring nonexistent directory "/usr/local/include" ignoring duplicate directory "/Users/scottm/play/llvm-cfrontend/obj/powerpc-apple-darwin8.8.0/../../powerpc-apple-darwin8.8.0/lib/gcc/powerpc-apple-darwin8.9.0/4.0.1/include" ignoring nonexistent directory "/Users/scottm/play/llvm-cfrontend/obj/powerpc-apple-darwin8.8.0/../../powerpc-apple-darwin8.8.0/lib/gcc/powerpc-apple-darwin8.9.0/4.0.1/../../../../powerpc-apple-darwin8.9.0/include"
include "..." search starts here:
include <...> search starts here:
/Users/scottm/play/llvm-cfrontend/powerpc-apple-darwin8.8.0/bin/../lib/gcc/powerpc-apple-darwin8.9.0/4.0.1/include /Users/scottm/play/llvm-cfrontend/obj/powerpc-apple-darwin8.8.0/../../powerpc-apple-darwin8.8.0/include /usr/include /System/Library/Frameworks (framework directory) /Library/Frameworks (framework directory) End of search list. GNU C version 4.0.1 LLVM (Apple Computer, Inc. build 5449) (powerpc-apple-darwin8.9.0) compiled by GNU C version 4.0.1 (Apple Computer, Inc. build 5367). GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 Compiler executable checksum: 3fb6b8555bd4abe30e257ef177238c8e /Users/scottm/play/llvm/trunk/lib/CodeGen/LiveInterval.cpp:224: failed assertion `I != ranges.begin() && "Range is not in interval!"' main.c:4: internal compiler error: Abort trap Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://llvm.org/bugs> for instructions.