[GRASS5] compile error in splitfont.c in module for_grass

Hello,

I get the following error compiling GRASS5.0 CVS version:

splitfont.c: In function `main':
splitfont.c:132: unrecognizable insn:
(insn 943 922 463 (set (reg/v:QI 63)
        (const_int 129 [0x81])) -1 (nil)
    (expr_list:REG_EQUAL (const_int 129 [0x81])
        (nil)))
splitfont.c:132: Internal compiler error in extract_insn, at recog.c:2148
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html&gt; for instructions.
make[1]: *** [OBJ.i686-pc-linux-gnu/splitfont.o] Erreur 1
make[1]: Leaving directory `/data/GRASSCVS/grass/src/fonts/for_grass'
GISGEN failure at STEP: src/fonts/for_grass

Is this a gcc problem or a GRASS problem ?

Moritz

On Mon, 7 Jul 2003, Moritz Lennert wrote:

I get the following error compiling GRASS5.0 CVS version:

splitfont.c: In function `main': splitfont.c:132: unrecognizable
insn: (insn 943 922 463 (set (reg/v:QI 63) (const_int 129 [0x81]))
-1 (nil) (expr_list:REG_EQUAL (const_int 129 [0x81]) (nil)))
splitfont.c:132: Internal compiler error in extract_insn, at
recog.c:2148 Please submit a full bug report, with preprocessed
source if appropriate. See <URL:http://gcc.gnu.org/bugs.html&gt; for
instructions. make[1]: *** [OBJ.i686-pc-linux-gnu/splitfont.o]
Erreur 1 make[1]: Leaving directory
`/data/GRASSCVS/grass/src/fonts/for_grass' GISGEN failure at STEP:
src/fonts/for_grass

Is this a gcc problem or a GRASS problem ?

I had the same problem when compiling with gcc-3.3 and gcc-3.2. I
guess that I could have tried some other gcc-3.x versions, but at this
point I just went back to gcc-2.95, and encountered no errors. That
would seem to point the finger at gcc.

Cheers,
  Martin

--
Martin Pokorny
Tucson, AZ, USA

Moritz Lennert wrote:

I get the following error compiling GRASS5.0 CVS version:

splitfont.c: In function `main':
splitfont.c:132: unrecognizable insn:
(insn 943 922 463 (set (reg/v:QI 63)
        (const_int 129 [0x81])) -1 (nil)
    (expr_list:REG_EQUAL (const_int 129 [0x81])
        (nil)))
splitfont.c:132: Internal compiler error in extract_insn, at recog.c:2148
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html&gt; for instructions.
make[1]: *** [OBJ.i686-pc-linux-gnu/splitfont.o] Erreur 1
make[1]: Leaving directory `/data/GRASSCVS/grass/src/fonts/for_grass'
GISGEN failure at STEP: src/fonts/for_grass

Is this a gcc problem or a GRASS problem ?

A bit of both. Given that main() is declared as returning "int", it
should actually have a "return" statement. OTOH, gcc really shouldn't
be throwing an internal compiler error.

The attached patch should solve the problem.

--
Glynn Clements <glynn.clements@virgin.net>

(attachments)

splitfont.c-patch (284 Bytes)

Glynn,

I tried the proposed patch, but it still fails (gcc 3.2.2 on Mandrake 9.1).

splitfont.c: In function 'main':
splitfont.c:132: unrecognizable insn:
(insn 947 926 463 (set (reg/v:QI 63)
        (const_int 129 [0x81])) -1 (nil)
    (expr_list:REG_EQUAL (const_int 129 [0x81])
        (nil)))
splitfont.c:132: Internal compiler error in extract_insn, at recog.c:2148
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:https://qa.mandrakesoft.com/&gt; for instructions.

Markus

On Mon, Jul 07, 2003 at 06:11:27PM +0100, Glynn Clements wrote:
Content-Description: message body and .signature

Moritz Lennert wrote:

> I get the following error compiling GRASS5.0 CVS version:
>
> splitfont.c: In function `main':
> splitfont.c:132: unrecognizable insn:
> (insn 943 922 463 (set (reg/v:QI 63)
> (const_int 129 [0x81])) -1 (nil)
> (expr_list:REG_EQUAL (const_int 129 [0x81])
> (nil)))
> splitfont.c:132: Internal compiler error in extract_insn, at recog.c:2148
> Please submit a full bug report,
> with preprocessed source if appropriate.
> See <URL:http://gcc.gnu.org/bugs.html&gt; for instructions.
> make[1]: *** [OBJ.i686-pc-linux-gnu/splitfont.o] Erreur 1
> make[1]: Leaving directory `/data/GRASSCVS/grass/src/fonts/for_grass'
> GISGEN failure at STEP: src/fonts/for_grass
>
> Is this a gcc problem or a GRASS problem ?

A bit of both. Given that main() is declared as returning "int", it
should actually have a "return" statement. OTOH, gcc really shouldn't
be throwing an internal compiler error.

The attached patch should solve the problem.

--
Glynn Clements <glynn.clements@virgin.net>

Content-Description: splitfont.c patch

--- src/fonts/for_grass/splitfont.c~ Thu Jul 3 21:41:13 2003
+++ src/fonts/for_grass/splitfont.c Mon Jul 7 18:09:56 2003
@@ -128,7 +128,7 @@
     write (newfont, &newoffset, sizeof(newoffset));
     close (newfont);
   }
- exit(0);
+ return 0;
}

int savechar (int font, int newfont)

I should add that the file was recently updated. The previous version
compiles fine on gcc 3.2.2. So the problem was introduced with the
8bit updates. It can be still a gcc problem of course.

Markus

On Mon, Jul 07, 2003 at 10:47:17PM +0200, Markus Neteler wrote:

Glynn,

I tried the proposed patch, but it still fails (gcc 3.2.2 on Mandrake 9.1).

splitfont.c: In function 'main':
splitfont.c:132: unrecognizable insn:
(insn 947 926 463 (set (reg/v:QI 63)
        (const_int 129 [0x81])) -1 (nil)
    (expr_list:REG_EQUAL (const_int 129 [0x81])
        (nil)))
splitfont.c:132: Internal compiler error in extract_insn, at recog.c:2148
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:https://qa.mandrakesoft.com/&gt; for instructions.

Markus

On Mon, Jul 07, 2003 at 06:11:27PM +0100, Glynn Clements wrote:
Content-Description: message body and .signature
>
> Moritz Lennert wrote:
>
> > I get the following error compiling GRASS5.0 CVS version:
> >
> > splitfont.c: In function `main':
> > splitfont.c:132: unrecognizable insn:
> > (insn 943 922 463 (set (reg/v:QI 63)
> > (const_int 129 [0x81])) -1 (nil)
> > (expr_list:REG_EQUAL (const_int 129 [0x81])
> > (nil)))
> > splitfont.c:132: Internal compiler error in extract_insn, at recog.c:2148
> > Please submit a full bug report,
> > with preprocessed source if appropriate.
> > See <URL:http://gcc.gnu.org/bugs.html&gt; for instructions.
> > make[1]: *** [OBJ.i686-pc-linux-gnu/splitfont.o] Erreur 1
> > make[1]: Leaving directory `/data/GRASSCVS/grass/src/fonts/for_grass'
> > GISGEN failure at STEP: src/fonts/for_grass
> >
> > Is this a gcc problem or a GRASS problem ?
>
> A bit of both. Given that main() is declared as returning "int", it
> should actually have a "return" statement. OTOH, gcc really shouldn't
> be throwing an internal compiler error.
>
> The attached patch should solve the problem.
>
> --
> Glynn Clements <glynn.clements@virgin.net>
>

Content-Description: splitfont.c patch
> --- src/fonts/for_grass/splitfont.c~ Thu Jul 3 21:41:13 2003
> +++ src/fonts/for_grass/splitfont.c Mon Jul 7 18:09:56 2003
> @@ -128,7 +128,7 @@
> write (newfont, &newoffset, sizeof(newoffset));
> close (newfont);
> }
> - exit(0);
> + return 0;
> }
>
> int savechar (int font, int newfont)

_______________________________________________
grass5 mailing list
grass5@grass.itc.it
http://grass.itc.it/mailman/listinfo/grass5

Glynn Clements said:

Moritz Lennert wrote:

I get the following error compiling GRASS5.0 CVS version:

splitfont.c: In function `main':
splitfont.c:132: unrecognizable insn:
(insn 943 922 463 (set (reg/v:QI 63)
        (const_int 129 [0x81])) -1 (nil)
    (expr_list:REG_EQUAL (const_int 129 [0x81])
        (nil)))
splitfont.c:132: Internal compiler error in extract_insn, at
recog.c:2148
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html&gt; for instructions.
make[1]: *** [OBJ.i686-pc-linux-gnu/splitfont.o] Erreur 1
make[1]: Leaving directory `/data/GRASSCVS/grass/src/fonts/for_grass'
GISGEN failure at STEP: src/fonts/for_grass

Is this a gcc problem or a GRASS problem ?

A bit of both. Given that main() is declared as returning "int", it
should actually have a "return" statement. OTOH, gcc really shouldn't
be throwing an internal compiler error.

The attached patch should solve the problem.

--
Glynn Clements <glynn.clements@virgin.net>

--- src/fonts/for_grass/splitfont.c~ Thu Jul 3 21:41:13 2003
+++ src/fonts/for_grass/splitfont.c Mon Jul 7 18:09:56 2003
@@ -128,7 +128,7 @@
     write (newfont, &newoffset, sizeof(newoffset));
     close (newfont);
   }
- exit(0);
+ return 0;
}

int savechar (int font, int newfont)

As for Markus, this doesn't solve the problem for me. Linking /usr/bin/gcc
to /usr/bin/gcc-2.95 instead of /usr/bin/gcc-3.2 did the trick.

Moritz

Markus Neteler wrote:

I tried the proposed patch, but it still fails (gcc 3.2.2 on Mandrake 9.1).

A couple of other things to try include:

1. Change the type of the variable "achar" from char to int (the code
assumes that achar can hold negative values, but C doesn't specify
whether char is signed or unsigned).

2. Change the second argument to memset() (at line 63) from a
character literal to an integer literal, i.e.:

    memset(map, 0, sizeof(map));

I don't have gcc 3.x, so I can't test any of this.

--
Glynn Clements <glynn.clements@virgin.net>

Glynn Clements said:

Markus Neteler wrote:

I tried the proposed patch, but it still fails (gcc 3.2.2 on Mandrake
9.1).

A couple of other things to try include:

1. Change the type of the variable "achar" from char to int (the code
assumes that achar can hold negative values, but C doesn't specify
whether char is signed or unsigned).

That works. It compiles perfectly now, even with gcc3.2. Thanks !

2. Change the second argument to memset() (at line 63) from a
character literal to an integer literal, i.e.:

    memset(map, 0, sizeof(map));

I don't have gcc 3.x, so I can't test any of this.

That didn't change anything.

Moritz

On Tue, Jul 08, 2003 at 04:20:34PM +0100, Glynn Clements wrote:

Markus Neteler wrote:

> I tried the proposed patch, but it still fails (gcc 3.2.2 on Mandrake 9.1).

A couple of other things to try include:

1. Change the type of the variable "achar" from char to int (the code
assumes that achar can hold negative values, but C doesn't specify
whether char is signed or unsigned).

This works out of the box, great.

2. Change the second argument to memset() (at line 63) from a
character literal to an integer literal, i.e.:

    memset(map, 0, sizeof(map));

Applying this additionally, it still compiles.
Applying only the second, gcc3.2.2 crashes. So the first change
does the trick.

Thanks for identifying the problem!

Markus