Subject: bin/2181: bug in gcc/i386 optimizer
To: None <gnats-bugs@NetBSD.ORG>
From: None <jpo@NetBSD.ORG>
List: netbsd-bugs
Date: 03/06/1996 08:47:26
>Number:         2181
>Category:       bin
>Synopsis:       bug in gcc/i386 optimizer
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    bin-bug-people (Utility Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Mar  6 08:50:01 1996
>Last-Modified:
>Originator:     Jochen Pohl
>Organization:
	
>Release:        96/02/24
>Environment:
System: NetBSD pain.lcs.mit.edu 1.1A NetBSD 1.1A (PAIN) #0: Mon Feb 26 04:02:34 EST 1996 mycroft@zygorthian-space-raiders:/afs/sipb.mit.edu/project/netbsd/dev/current-source/build/i386_nbsd1/sys/arch/i386/compile/PAIN i386


>Description:
	The program below, compiled with -O, prints ???, which is
	obviously wrong. It prints nothing if it is compiled
	without optimization. This is with our gcc 2.7.2 on i386.

>How-To-Repeat:

$ cat >t.c
#include <stdio.h>
#include <limits.h>
 
main()
{
        quad_t q;
 
        q = 0;
        if (q > INT_MAX || q < INT_MIN)
                printf("???\n");
}
^D
$ cc -O -o t t.c
$ ./t
???
$ cc -o t t.c
$ ./t
$

>Fix:
	unknown
>Audit-Trail:
>Unformatted: