Nick Cremelie wrote:
> And this is what gdb shows me (I think it's pretty much the same)
> ---begin---
> GDB 4.16 (rs6000-ibm-aix4), Copyright 1996 Free Software Foundation, Inc...
> Core was generated by `gpc1'.
> Program terminated with signal 6, IOT/Abort trap.
> #0 0xd0077eac in raise ()
> (gdb) bt
> #0 0xd0077eac in raise ()
> #1 0xd0019a74 in abort ()
> #2 0x1004f258 in output_epilog (file=0xf013f4c0, size=-1) at rs6000.c:4027
> #3 0x10142664 in final_end_function (first=0x0, file=0xf013f4c0, optimize=-1)
> at final.c:1151
> #4 0x10005548 in rest_of_compilation (decl=0x20080a2c) at toplev.c:3647
> #5 0x100b8ce4 in finish_function (nested=0) at gpc-decl.c:8734
> #6 0x1018dbc0 in yyparse () at parse.y:6628
> #7 0x10003084 in compile_file (name=0x0) at toplev.c:2494
> #8 0x10006624 in main (argc=15, argv=0x2ff227cc, envp=0xffffffff)
> at toplev.c:4377
> #9 0x100001f4 in __start ()
> ---end---
>
> Apparently there's something not right in rs6000.c. What do you think?
I haven't read the previous stack dump closely enough, I think. And I think
your analysis is correct. The code around line 4027 in rs6000.c looks like
this:
/* Language type. Unfortunately, there doesn't seem to be any
official way to get this info, so we use language_string. C
is 0. C++ is 9. No number defined for Obj-C, so use the
value for C for now. */
if (! strcmp (language_string, "GNU C")
|| ! strcmp (language_string, "GNU Obj-C"))
i = 0;
else if (! strcmp (language_string, "GNU F77"))
i = 1;
else if (! strcmp (language_string, "GNU Ada"))
i = 3;
else if (! strcmp (language_string, "GNU Pascal"))
i = 2;
else if (! strcmp (language_string, "GNU C++"))
i = 9;
else
abort ();
fprintf (file, "%d,", i);
So here you go, abort! Who messed around with the language_string recently?
This should be rather trivial to fix for Peter. The actual bug is in p/parse.c
and is even documented. Just take the language_string hack for _IBMR2 out
and your compiler should work. The "bug" is around line 360 in p/parse.c.
Of course, to fix this, we need to change p/parse.y, being the source for
parse.c. Nick, do you have bison installed on your machine? If not, you have
to change p/parse.c by hand for a quick fix, and don't apply the p/parse.y
patch below.
oops, just noticed that I forgot to add useful options to diff. I hope
that the following works for you, Peter. If not, drop me a note.
I got to run now, and probably won't be back till 12:30 CEST.
Klaus
115,123d114
< *
< * rs6000.c calls abort() if this is "GNU Pascal" :-)
< *
< * I have modified rs6000.c. Since "Pascal" is a person's name
< * like "Ada" it has the right to be written in the same manner. :-)
< * - PG
< *
< * Sigh, I don't want to change rs6000.c; I will inform Kenner to change
< * it in the next release.
125,127d115
< #ifdef _IBMR2
< char *language_string = "GNU PASCAL";
< #else
129d116
< #endif /* Sigh */