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]

Internal compiler error in egcs1.0.3a on Dec Alpha.


Hi,

I installed egcs1.0.3 a couple of days ago on Dec Alpha.
It works great but I found a bug while using
the -mcpu=21164a flag.

System properties, a small testcase which shows the bug, and
the compiler crash are given at the end of this mail.

Unfortunately, I was not able to test this with egcs-current.
It would be great if it is already fixed in the upcoming
1.1 release.

Best regards,

        Hans Dolfing

===============================================================

System (21164a cpu)
-------------------

config.guess:

alphaev56-dec-osf4.0c

egcs -v:

Reading specs from /usr/local/egcs1.0/osf4.0/lib/gcc-lib/alphaev56-dec-osf4.0c/egcs-2.90.29/specs
gcc version egcs-2.90.29 980515 (egcs-1.0.3 release)

Compiler cmd-line:
------------------

Crash:  egcs -c -O2 -mcpu=21164a bug.c
Crash:  egcs -c -O  -mcpu=21164a bug.c
Ok:     egcs -c     -mcpu=21164a bug.c

Ok:     egcs -c -O2 -mcpu=21164  bug.c
Ok:     egcs -c -O2  bug.c

So, using -O[2] together with -mcpu=21164a triggers the crash.
Using -mcpu=21164 is ok.

Compiler crash
---------------

egcs -c -O2 -mcpu=21164a bug.c
bug.c: In function `main':
bug.c:28: internal error--unrecognizable insn:
(insn 117 66 79 (set (mem:QI (plus:DI (reg:DI 30 $30)
                (const_int 24)))
        (subreg:QI (reg:DI 33 $f1) 0)) -1 (nil)
    (nil))
gcc: Internal compiler error: program cc1 got fatal signal 6
Exit 1

Testcase
--------

#include <stdio.h>

typedef struct
{
   int    s;
   double x;
   char   MyChar;
} MyStruct, *MyStructPtr;

int main(void)
{

  MyStruct    m2;
  MyStructPtr m = &m2;

  m->x = 3.0;
  m->s = 1;

  while (1)
  {
    switch(m->s)
    {
     case 1:
       m->MyChar = ((int)((m->x)>0?(m->x)+0.5:(m->x)-0.5));
    }
  }
  return 0;
}


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