This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug inline-asm/12473] New: internal compiler error: Segmentation violation
- From: "jaroslaw dot pelczar at xl dot wp dot pl" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 1 Oct 2003 06:26:56 -0000
- Subject: [Bug inline-asm/12473] New: internal compiler error: Segmentation violation
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12473
Summary: internal compiler error: Segmentation violation
Product: gcc
Version: 3.3
Status: UNCONFIRMED
Severity: critical
Priority: P2
Component: inline-asm
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: jaroslaw dot pelczar at xl dot wp dot pl
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: i586-pc-msdosdjgpp
GCC host triplet: i586-pc-msdosdjgpp
GCC target triplet: i586-pc-msdosdjgpp
I've posted it to comp.os.msdos.djgpp and one man tried it and could
reproduce this bug on:
gcc-3.3.1 release for target i586-pc-msdosdjgpp
gcc-3.3.1 release for target i486-slackware-gnu
gcc-3.4 20030924 (experimental) for target i686-pc-linux-gnu
compiler dump:
test.c: In function `flush_thread':
test.c:52: internal compiler error: Segmentation violation
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
gcc flags:
gcc test.c -S -O2 -fomit-frame-pointer
gcc -v dump:
Reading specs from c:/djgpp/lib/gcc-lib/djgpp/3.3/specs
Configured with: /devel/gnu/gcc/3.3/gnu/gcc-3.3/configure i586-pc-msdosdjgpp --
prefix=/dev/env/DJDIR --disable-nls
Thread model: single
gcc version 3.3
preprocessed file:
# 1 "program.c"
# 1 "<built-in>"
# 1 "<command line>"
# 1 "c:/djgpp/lib/gcc-lib/djgpp/3.3/djgpp.ver" 1
# 1 "c:/djgpp/include/sys/version.h" 1 3
# 2 "c:/djgpp/lib/gcc-lib/djgpp/3.3/djgpp.ver" 2
# 2 "<command line>" 2
# 1 "program.c"
# 22 "program.c"
char default_ldt[8];
struct {
long a,b;
} gdt[256];
struct {
char * ldt;
long debugreg[10];
} * current,* task[512];
void flush_thread(void)
{
int i;
if (current->ldt) {
free_page((unsigned long) current->ldt);
current->ldt = ((void *)0);
for (i=1 ; i<512 ; i++) {
if (task[i] == current) {
__asm__ __volatile__ ("movw $" "((1 << 3) - 1)" ",%1\n\t" "movw %w0,%2
\n\t" "rorl $16,%0\n\t" "movb %b0,%3\n\t" "movb $" "0x82" ",%4\n\t" "movb
$0x00,%5\n\t" "movb %h0,%6\n\t" "rorl $16,%0" : :"r" (((int)(&default_ldt))
+0xc0000000), "m" (*(((char *) (gdt+(i<<1)+ 10)))), "m" (*(((char *) (gdt+
(i<<1)+ 10))+2)), "m" (*(((char *) (gdt+(i<<1)+ 10))+4)), "m" (*(((char *)
(gdt+(i<<1)+ 10))+5)), "m" (*(((char *) (gdt+(i<<1)+ 10))+6)), "m" (*(((char
*) (gdt+(i<<1)+ 10))+7)) );
load_ldt(i);
}
}
}
for (i=0 ; i<8 ; i++)
current->debugreg[i] = 0;
}
And there could be also another bug with gcc on i386-*.
When I write
__asm__ __volatile__("movb %b1,%0":"=m"(*test):"r"(xyz));
compiler can replace %b1 with %sil. I think it has something common
with above bug.