🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.bug
Article #2275

Compiler aborts for GCC 1.33 on both VAX/VMS and Ultrix

#2275
From: jim brown
Date: Mon, 13 Feb 1989 16:43
59 lines
2487 bytes
The following routine causes GCC 1.33 compiler to fail with "access violation"
on VAX/VMS and to equivalently fail on Ultrix:

# define	MAGIC_YEAR	1900

static char	*MonthString = "JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC";

long
ConvertOldDate(date)
char		*date;
{
    /*
	Convert a string of the form dd-mmm-yy to
	an integer of the form YYYYMMDD.  The
	string may not have a NULL at the end.

	Avoid STDIO like the plague
    */
    char		months[4];
    int			day, month, year;
    int			indexx(), atoi();

    day = atoi(date);
    while (*date++ != '-')
	;
    months[0] = *date++;
    months[1] = *date++;
    months[2] = *date++;
    months[3] = 0;
    while (*date++ != '-')
	;
    year = atoi(date);
    /*sscanf(date,"%2d-%3s-%2d",&day,months,&year);*/
    month = (indexx(MonthString,months)-1)/3;
    return((MAGIC_YEAR+year)*10000 + (month+1)*100 + day);
}

Compiler termination message is:

$ gcc /inc="dsp0$:[inc]" j.c
%SYSTEM-F-ACCVIO, access violation, reason mask=00, virtual address=8018FCEC, PC=00039175, PSL=03C00000
%TRACE-F-TRACEBACK, symbolic stack dump follows
module name     routine name                     line       rel PC    abs PC

CSE             equiv_constant                             00000055  00039175
CSE             cse_insn                                   000002EE  00039824
CSE             cse_basic_block                            00000082  0003A49C
CSE             cse_main                                   00000160  0003A3E4
TOPLEV          rest_of_compilation                        000001F9  0000ECC9
C-DECL          finish_function                            00000059  0001A5EB
C-PARSE_TAB     yyparse                                    000005DC  000105A6
TOPLEV          compile_file                               0000061D  0000E6D5
TOPLEV          main                                       0000049C  0000F84C
*** Termination code 1000000c
%SYSTEM-F-ABORT, abort

-- 
Jim Brown, University of Miami (home of the Hurricanes)
[send mail to jim@umigw.miami.edu]
Technical Details
Message-ID: <212@umigw.MIAMI.EDU>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!umigw!jim

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!umigw!jim
From: jim@umigw.MIAMI.EDU (jim brown)
Newsgroups: gnu.gcc.bug
Subject: Compiler aborts for GCC 1.33 on both VAX/VMS and Ultrix
Keywords: boom crash tinkle
Message-ID: <212@umigw.MIAMI.EDU>
Date: 13 Feb 89 16:43:17 GMT
Reply-To: jim@umigw.miami.edu (jim brown)
Distribution: na
Organization: University of Miami
Lines: 59