[Cygwin] error building llvm-gcc - X86ATTAsmPrinter error in libstdc++

I am now getting an X86ATTAsmPrinter error in compiling libstdc+±v3 right near the end of compiling llvm-gcc in valarray-inst.cc.

assertion "IndexReg.getReg() != X86::ESP && “X86 doesn’t allow scaling by ESP”

Does this build on Linux ?

My remote Linux box has died and not a ble to reset it for a day or two.

/home/ang/build/llvm-gcc/./gcc/xgcc -shared-libgcc -B/home/ang/build/llvm-gcc/./
gcc -nostdinc++ -L/home/ang/build/llvm-gcc/i686-pc-cygwin/libstdc+±v3/src -L/ho
me/ang/build/llvm-gcc/i686-pc-cygwin/libstdc+±v3/src/.libs -B/usr/llvm-gcc/i686
-pc-cygwin/bin/ -B/usr/llvm-gcc/i686-pc-cygwin/lib/ -isystem /usr/llvm-gcc/i686-
pc-cygwin/include -isystem /usr/llvm-gcc/i686-pc-cygwin/sys-include -I/home/ang/
build/llvm-gcc/i686-pc-cygwin/libstdc+±v3/include/i686-pc-cygwin -I/home/ang/bu
ild/llvm-gcc/i686-pc-cygwin/libstdc+±v3/include -I/home/ang/svn/llvm-gcc/libstd
c+±v3/libsupc++ -fno-implicit-templates -Wall -Wextra -Wwrite-strings -Wcast-qu
al -fdiagnostics-show-location=once -ffunction-sections -fdata-sections -g -O2 -
c /home/ang/svn/llvm-gcc/libstdc+±v3/src/valarray-inst.cc -o valarray-inst.o
assertion “IndexReg.getReg() != X86::ESP && “X86 doesn’t allow scaling by ESP””
failed: file “/home/ang/svn/llvm/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp”
, line 496
make[4]: *** [valarray-inst.lo] Error 1
make[4]: Leaving directory /home/ang/build/llvm-gcc/i686-pc-cygwin/libstdc++-v3 /src' make[3]: *** [all-recursive] Error 1 make[3]: Leaving directory /home/ang/build/llvm-gcc/i686-pc-cygwin/libstdc+±v3

make[2]: *** [all] Error 2
make[2]: Leaving directory /home/ang/build/llvm-gcc/i686-pc-cygwin/libstdc++-v3 ' make[1]: *** [all-target-libstdc++-v3] Error 2 make[1]: Leaving directory /home/ang/build/llvm-gcc’
make: *** [all] Error 2
real 202m0.538s
user 23m45.661s
sys 24m39.707s

Any one got any clues,

Aaron

2009/7/26 Aaron Gray <aaronngray.lists@googlemail.com>

2009/7/27 Aaron Gray <aaronngray.lists@googlemail.com>

I am now getting an X86ATTAsmPrinter error in compiling libstdc+±v3 right near the end of compiling llvm-gcc in valarray-inst.cc.

assertion "IndexReg.getReg() != X86::ESP && “X86 doesn’t allow scaling by ESP”

Does this build on Linux ?

My remote Linux box has died and not a ble to reset it for a day or two.

/home/ang/build/llvm-gcc/./gcc/xgcc -shared-libgcc -B/home/ang/build/llvm-gcc/./
gcc -nostdinc++ -L/home/ang/build/llvm-gcc/i686-pc-cygwin/libstdc+±v3/src -L/ho
me/ang/build/llvm-gcc/i686-pc-cygwin/libstdc+±v3/src/.libs -B/usr/llvm-gcc/i686
-pc-cygwin/bin/ -B/usr/llvm-gcc/i686-pc-cygwin/lib/ -isystem /usr/llvm-gcc/i686-
pc-cygwin/include -isystem /usr/llvm-gcc/i686-pc-cygwin/sys-include -I/home/ang/
build/llvm-gcc/i686-pc-cygwin/libstdc+±v3/include/i686-pc-cygwin -I/home/ang/bu
ild/llvm-gcc/i686-pc-cygwin/libstdc+±v3/include -I/home/ang/svn/llvm-gcc/libstd
c+±v3/libsupc++ -fno-implicit-templates -Wall -Wextra -Wwrite-strings -Wcast-qu
al -fdiagnostics-show-location=once -ffunction-sections -fdata-sections -g -O2 -
c /home/ang/svn/llvm-gcc/libstdc+±v3/src/valarray-inst.cc -o valarray-inst.o
assertion “IndexReg.getReg() != X86::ESP && “X86 doesn’t allow scaling by ESP””
failed: file “/home/ang/svn/llvm/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp”
, line 496
make[4]: *** [valarray-inst.lo] Error 1
make[4]: Leaving directory /home/ang/build/llvm-gcc/i686-pc-cygwin/libstdc++-v3 /src' make[3]: *** [all-recursive] Error 1 make[3]: Leaving directory /home/ang/build/llvm-gcc/i686-pc-cygwin/libstdc+±v3

make[2]: *** [all] Error 2
make[2]: Leaving directory /home/ang/build/llvm-gcc/i686-pc-cygwin/libstdc++-v3 ' make[1]: *** [all-target-libstdc++-v3] Error 2 make[1]: Leaving directory /home/ang/build/llvm-gcc’
make: *** [all] Error 2
real 202m0.538s
user 23m45.661s
sys 24m39.707s

I am able to take the last compile line and output a ‘.bc’ file from ‘valarray-inst.cc’, compile the ‘.bc’ file then assemble this file with ‘gas’, then disassemble the file with objdump.

llc -mtriple=i686-pc-cygwin valarray-inst.bc -f
as valarray-inst.s -o valarray-inst.o

This works fine.

I have llvm & llvm-gcc revisions 77165. I have used an optimized build for llvm.

I can only think I did something wrong in building, but cannot think what I could have done ?

Any help welcome,

Aaron

This looks like pr4572.

Evan

2009/7/27 Evan Cheng <evan.cheng@apple.com>

This looks like pr4572.

Right, yes it does !

What gets me if I do the operations separately llvm-gcc to .bc, llc to .s, gas to .o then the bug does not occur. Is there anyway the passes and ordering of llvm-gcc compared to llc account for this ?

I know very little of TableGen and friends so will be of no use here.

Okay, hopefully this will be solved well before the next release :slight_smile:

Thanks,

Aaron