🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.bug
Article #1757

"const" problem in gcc v1.26 and up

#1757
From: Thomas M. Talpey
Date: Sun, 09 Oct 1988 23:36
59 lines
1950 bytes
Gcc cc1, versions 1.26-1.29 have all exhibited the following failure to
do "const" definitions. V1.25 did the right thing, but later versions
usually fail to emit the ".text", although they occasionally do it once
per file, allowing exactly one const to come out right.

Machine: Sun 2/50 or 3/50
Files:	tm -> tm-sun2.h
	md -> m68k.md
	config -> config-m68k.h

% cat tst.c
const char a[] = "test";
int b[] = { 1 };
const long c[] = { 2 };
% 
% gcc -B/usr/local/lib/gcc-old/gcc- -v -S tst.c
gcc version 1.29
 /usr/local/lib/gcc-cpp -v -undef -D__GNU__ -D__GNUC__ -Dmc68000 -Dsun -Dunix -D__HAVE_68881__ -Dmc68010 tst.c /tmp/cca17474.cpp
GNU CPP version 1.29
 /usr/local/lib/gcc-old/gcc-cc1 /tmp/cca17474.cpp -quiet -dumpbase tst.c -version -o tst.s
GNU C version 1.25 (68k, MIT syntax) compiled by GNU C version 1.24.
% cat tst.s
#NO_APP
.globl _a
.text				| V1.25 - correct
_a:
        .ascii "test\0"
.globl _b
.data				| ...
        .even
_b:
        .long 1
.globl _c
.text
        .even
_c:
        .long 2
% 
% gcc -B/usr/local/lib/gcc-new/gcc- -v -S tst.c
gcc version 1.29
 /usr/local/lib/gcc-new/gcc-cpp -v -undef -D__GNU__ -D__GNUC__ -Dmc68000 -Dsun -Dunix -D__HAVE_68881__ -Dmc68010 tst.c /tmp/cca17478.cpp
GNU CPP version 1.29
 /usr/local/lib/gcc-new/gcc-cc1 /tmp/cca17478.cpp -quiet -dumpbase tst.c -version -o tst.s
GNU C version 1.29 (68k, MIT syntax) compiled by GNU C version 1.28.
% cat tst.s
#NO_APP
.globl _a
.data				| V1.29 (and 1.26->), incorrect
_a:
        .ascii "test\0"
.globl _b
        .even
_b:				| no .text/.data ...
        .long 1
.globl _c
        .even
_c:
        .long 2
Technical Details
Message-ID: <173@xpiinc.UU.NET>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!water!watmath!uunet!xpiinc!tmt

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!water!watmath!uunet!xpiinc!tmt
From: tmt@xpiinc.UU.NET (Thomas M. Talpey)
Newsgroups: gnu.gcc.bug
Subject: "const" problem in gcc v1.26 and up
Message-ID: <173@xpiinc.UU.NET>
Date: 9 Oct 88 23:36:54 GMT
Organization: XPI Inc., Providence, R.I.
Lines: 59