gcc: Internal error: Segmentation fault (program as) Please submit a full bug report. See <URL:http://gcc.gnu.org/bugs.html> for instructions. For Debian GNU/Linux specific bug reporting instructions, see <URL:file:///usr/share/doc/gcc-3.3/README.Bugs>. This is waht gcc gives me when I compile with clear; gcc asciiFractal3.c -masm=intel -o asciiFractal3 -O3 -save-temps This is asciiFractal3.i: # 1 "asciiFractal3.c" # 1 "<built-in>" # 1 "<command line>" # 1 "asciiFractal3.c" char buffer[24*80 +1]; const float fhwid = 80/2, fhheg = 24/2, four = 4; double zre,zim,cre,cim; char *intens = " .;*|#|*;. "; int x=80,y=24; int main (void) { asm(".intel_syntax noprefix\n" "\n finit" ); asm( "\n mov eax, 0x41414141" "\n lea edi, buffer" "\n mov ecx, 80*24/2" "\n rep stosw" "\n " "\n " "\n lea edi, buffer" "\n xLoop:" "\n yLoop:" "\n xor ecx,ecx" "\n fild [y]" "\n fld [fhheg]" "\n fdivp " "\n fld1" "\n faddp " "\n fadd st(0), st(0)" "\n fst [cim]" "\n fst [zim]" "\n fild [x]" "\n fld [fhwid]" "\n fdivp " "\n fld1" "\n faddp " "\n fadd st(0), st(0)" "\n fst [cre]" "\n fst [zre]" "\n fld st(1)" "\n fld st(1)" ); asm( "\n cLoop:" "\n fld st(1)" "\n fmul st(0),st(0)" "\n fld st(1)" "\n fmul st(0),st(0)" "\n faddp " "\n ficomp [four]" "\n fstsw ax" "\n fwait" "\n sahf" "\n ja cLoopEnd" "\n fld st(0)" "\n fmul st(0),st(2)" "\n fadd st(0),st(0)" "\n fadd st(0),st(4)" "\n fld st(1)" "\n fmul st(0),st(0)" "\n fld st(3)" "\n fmul st(0),st(0)" "\n fsubp st(1),st(0)" "\n fadd st(0),st(3)" "\n fstp st(2)" "\n fstp st(2)" "\n add ecx,1" "\n cmp ecx,10" "\n jb cLoop" "\n cLoopEnd:" "\n lea ebx,intens+ecx" "\n mov ah, [ebx]" "\n mov edx, [x]" "\n lea ebx, ebx+buffer" "\n cld" "\n stosb" ); asm( "\n sub [y],1" "\n jnz yLoop" "\n sub [x],1" "\n jnz xLoop" ); buffer[24*80] = 0; puts(buffer); return 0; } And this is gcc -v output: Reading specs from /usr/lib/gcc-lib/i486-linux/3.3.4/specs Configured with: ../src/configure -v --enable-languages=c,c++,java,f77,pascal,objc,ada,treelang --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-gxx-include-dir=/usr/include/c++/3.3 --enable-shared --with-system-zlib --enable-nls --without-included-gettext --enable-__cxa_atexit --enable-clocale=gnu --enable-debug --enable-java-gc=boehm --enable-java-awt=xlib --enable-objc-gc i486-linux Thread model: posix gcc version 3.3.4 (Debian 1:3.3.4-7) I'm using DSL but don't know the version...
I fogot to mention, that the line that caused the bug is this line "\n lea ebx, ebx+buffer"
This is not a GCC issue really but a bug in as, yes we should not report to file a bug here but that is PR 2252.
OK, but what is PR 2252 ? Nevermind, it was easy to fix... just change lea ebx, ebx+buffer to lea ebx, buffer+ebx Simple, but it's still a bug. I wont care.
(In reply to comment #3) > OK, but what is PR 2252 ? Try http://gcc.gnu.org/PR2252. > Simple, but it's still a bug. Yes but not a GCC one; it is a binutils bug.