[Bug c/28847] New: as compiler error

2006-08-25 Thread ulvinge at gmail dot com
gcc: Internal error: Segmentation fault (program as)
Please submit a full bug report.
See http://gcc.gnu.org/bugs.html> for instructions.
For Debian GNU/Linux specific bug reporting instructions,
see .

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 ""
# 1 ""
# 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...


-- 
   Summary: as compiler error
   Product: gcc
   Version: 3.3.4
Status: UNCONFIRMED
  Severity: critical
  Priority: P3
 Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: ulvinge at gmail dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28847



[Bug target/28847] as compiler error

2006-08-25 Thread ulvinge at gmail dot com


--- Comment #1 from ulvinge at gmail dot com  2006-08-25 19:13 ---
I fogot to mention, that the line that caused the bug is this line

"\n lea ebx, ebx+buffer"


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28847



[Bug target/28847] as compiler error

2006-08-25 Thread ulvinge at gmail dot com


--- Comment #3 from ulvinge at gmail dot com  2006-08-25 19:27 ---
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.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28847