Mombu the Programming Forum sponsored links

Go Back   Mombu the Programming Forum > Programming > internal compiler error: Segmentation violation
User Name
Password
REGISTER NOW! Mark Forums Read

sponsored links


Reply
 
1 13th June 06:46
jarek pelczar
External User
 
Posts: 1
Default internal compiler error: Segmentation violation



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.

/*
test.c ---------------------------------------------------------------------
--------- */
#define NULL ((void *)0)
#define NR_TASKS 512

#define _set_tssldt_desc(n,addr,limit,type) \
__asm__ __volatile__ ("movw $" #limit ",%1\n\t" \
"movw %w0,%2\n\t" \
"rorl $16,%0\n\t" \
"movb %b0,%3\n\t" \
"movb $" type ",%4\n\t" \
"movb $0x00,%5\n\t" \
"movb %h0,%6\n\t" \
"rorl $16,%0" \
: /* no output */ \
:"r" (addr+0xc0000000), "m" (*(n)), "m" (*(n+2)), "m" (*(n+4)), \
"m" (*(n+5)), "m" (*(n+6)), "m" (*(n+7)) \
)

#define set_tss_desc(n,addr) _set_tssldt_desc(((char *)
(n)),((int)(addr)),235,"0x89")
#define set_ldt_desc(n,addr,size) \
_set_tssldt_desc(((char *) (n)),((int)(addr)),((size << 3) - 1),"0x82")

char default_ldt[8];
struct {
long a,b;
} gdt[256];

struct {
char * ldt;
long debugreg[10];
} * current,* task[NR_TASKS];

#define FIRST_LDT_ENTRY 10

void flush_thread(void)
{
int i;

if (current->ldt) {
free_page((unsigned long) current->ldt);
current->ldt = NULL;
for (i=1 ; i<NR_TASKS ; i++) {
if (task[i] == current) {
set_ldt_desc(gdt+(i<<1)+
FIRST_LDT_ENTRY,&default_ldt, 1);
load_ldt(i);
}
}
}

for (i=0 ; i<8 ; i++)
current->debugreg[i] = 0;
}

/* -------------------------------------------------------------------------
----- */

Compilation flags:
gcc -O2 -fomit-frame-pointer test.c -S

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
  Reply With Quote


  sponsored links


2 13th June 06:46
andris pavenis
External User
 
Posts: 1
Default internal compiler error: Segmentation violation



I can reproduce this problem with

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

So the problem is present with all versions, I tested.
Please submit a bug report. See URL above for more information how
to do that

Andris
  Reply With Quote
Reply


Thread Tools
Display Modes




Copyright © 2006 SmartyDevil.com - Dies Mies Jeschet Boenedoesef Douvema Enitemaus -
666