NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

toolchain/46033: gcc miscompiles tcl config test

>Number:         46033
>Category:       toolchain
>Synopsis:       gcc miscompiles tcl config test
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    toolchain-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Feb 16 21:50:00 +0000 2012
>Originator:     Martin Husemann
>Release:        NetBSD 5.99.65
The NetBSD Foundation, Inc.
System: NetBSD 5.99.65 NetBSD 5.99.65 (DEAD) #51: 
Tue Feb 14 22:38:47 CET 2012 vax
Architecture: vax
Machine: vax

With gcc 4.5.3 the following (closely based on a config test from 
fails to complete:

#include <ctype.h>
#include <stdlib.h>
#include <stdio.h>

#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))

int main ()
        int i;

        for (i = 0; i < 256; i++) {
                printf("testing with i = %d\n", i);
                if (XOR (islower (i), ISLOWER (i))
                    || toupper (i) != TOUPPER (i))
        return 0;

Compiling this causes strange warnings 

conftest.c:16:7: warning: 'iftmp.4' may be used uninitialized in this function

and the value of i is always 0.


Home | Main Index | Thread Index | Old Index