🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.bug
Article #2837

probable generic bug with gcc 1.36 with LONG_MIN

#2837
From: Bill Bailey
Date: Thu, 01 Feb 1990 05:31
30 lines
1169 bytes
Dear rms:

I believe the code below demonstrates a generic bug with gcc 1.36.
It is at least a problem on sparc where I built gcc 1.36.
It prints "false, true" when it should print "false, false."  Note
the second if clause is the problematic one, I include the first
simply to illustrate the inconsistency.

I spent some time in dbx working on this.  The problem almost certainly
has to do with the routine shorten_compare() but I can't quite pin
it down.  Please let me know if there is a simple fix.

Thank you.
wbailey@oracle.com

main()
{
    char i = 1;
    int j = 1;

    if ( i < -128 )
	printf("true, ");
    else
	printf("false, ");

    if ( j < -2147483648 )
	printf("true\n");
    else
	printf("false\n");
}
Technical Details
Message-ID: <9002010531.AA02596@flame.oracle.com>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!flame.oracle.com!wbailey

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!flame.oracle.com!wbailey
From: wbailey@flame.oracle.com (Bill Bailey)
Newsgroups: gnu.gcc.bug
Subject: probable generic bug with gcc 1.36 with LONG_MIN
Message-ID: <9002010531.AA02596@flame.oracle.com>
Date: 1 Feb 90 05:31:13 GMT
Sender: daemon@tut.cis.ohio-state.edu
Distribution: gnu
Organization: GNUs Not Usenet
Lines: 30