This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

c/2804: C GCC 2001-05-11 snapshot "Internal error: Segmentation fault"



>Number:         2804
>Category:       c
>Synopsis:       regression from 2.95.3
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    unassigned
>State:          open
>Class:          ice-on-legal-code
>Submitter-Id:   net
>Arrival-Date:   Fri May 11 09:06:00 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Etienne Lorrain
>Release:        3.0 20010507 (prerelease)
>Organization:
A bootloader organisation?
>Environment:
System: Linux nextstar.masroudeau.com 2.4.2-2 #1 Sun Apr 8 20:41:30 EDT 2001 i686 unknown
Architecture: i686

	
host: i686-pc-linux-gnu
build: i686-pc-linux-gnu
target: i686-pc-linux-gnu
configured with: ../configure --prefix=/home/etienne/projet/toolchain --enable-languages=C
>Description:
http://www.codesourcery.com/cgi-bin/gcc-compile.py gives:
These are the results of processing your source code with the following command:

gcc -Os [input] 


Exit code: 256

Messages:

/usr/tmp/@31609.7.c: In function `EGA_setpixel':
/usr/tmp/@31609.7.c:92: Internal error: Segmentation fault


	
>How-To-Repeat:
gcc -Os of:
----------
typedef unsigned farptr;

typedef struct {
    unsigned short x, y;
    } __attribute__ ((packed)) coord;

struct user_interface_str {
    struct video_parameter_str {
        unsigned identification;
        unsigned nbcolor;
        unsigned short width, heigh;
        unsigned base_address;
        unsigned char row, col;
        unsigned char nbrow, nbcol;
        unsigned char charwidth, charheigh;
        unsigned char isgraphic;
        unsigned char nbimage;
        unsigned char red_mask_size;
        unsigned char red_field_pos;
        unsigned char green_mask_size;
        unsigned char green_field_pos;
        unsigned char blue_mask_size;
        unsigned char blue_field_pos;
        farptr font;
        unsigned winadr;
        unsigned winsize;
        unsigned short linelength;
        unsigned char bitperpixel;
        unsigned char nbplane;
        unsigned char memtype;
        unsigned char EGA_compatible;
        unsigned char BIOS_compatible;
        unsigned char NbWin;
        unsigned char winNo;
        unsigned short *offsetarray;
        unsigned char wingranul;
        unsigned winreadadr;
        unsigned readdelta;
        unsigned short *readoffsetarray;
        struct hardwindow_str *readhardwindow;
        unsigned addrpositionfarfct;
        } parameter;
    } UI;

extern inline unsigned gpeekb (unsigned offset)
  {
  unsigned returned;

  offset += UI.parameter.readdelta;

  asm volatile (" movzbl %%gs:(%c1),%0 " : "=r" (returned) : "g" (offset));

  return returned;
  }

extern inline void gpokeb (unsigned offset, unsigned char value)
  {
  asm volatile (" movb %0,%%gs:(%c1) " : : "qi" (value), "g" (offset));
  }

static unsigned __attribute__ (( regparm(1) ))
VESA_pixeloffset (coord xy)
  {
  unsigned offset = xy.y * UI.parameter.linelength
                    + (xy.x * UI.parameter.bitperpixel) / 8;

  return offset - UI.parameter.winadr;
  }

static unsigned __attribute__ (( regparm(1) ))
VESA_readpixeloffset (coord xy)
  {
  unsigned offset;

  if (UI.parameter.NbWin <= 1)
      return VESA_pixeloffset (xy);

  offset = xy.y * UI.parameter.linelength
           + (xy.x * UI.parameter.bitperpixel) / 8;

  return offset - UI.parameter.winreadadr;
  }

static void __attribute__ (( regparm(1) ))
EGA_setpixel (coord xy, unsigned color)
  {
  do {
      volatile unsigned char dummyread;
      dummyread = gpeekb (VESA_readpixeloffset (xy));
      gpokeb (VESA_pixeloffset (xy), color);
      } while (0);
  }

----------
	
>Fix:
	
>Release-Note:
>Audit-Trail:
>Unformatted:


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]