delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2003/09/26/18:30:51

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
From: "Jarek Pelczar" <spideros1 AT wp DOT pl>
Newsgroups: comp.os.msdos.djgpp
Subject: internal compiler error: Segmentation violation
Date: Sat, 27 Sep 2003 00:20:06 +0200
Organization: tp.internet - http://www.tpi.pl/
Lines: 79
Message-ID: <bl2e3k$6t4$1@atlantis.news.tpi.pl>
NNTP-Posting-Host: pa92.krosno.cvx.ppp.tpnet.pl
X-Trace: atlantis.news.tpi.pl 1064614837 7076 213.77.216.92 (26 Sep 2003 22:20:37 GMT)
X-Complaints-To: usenet AT tpi DOT pl
NNTP-Posting-Date: Fri, 26 Sep 2003 22:20:37 +0000 (UTC)
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

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



- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019