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
>Organization:
The NetBSD Foundation, Inc.
>Environment:
System: NetBSD dead-to-the-world.duskware.de 5.99.65 NetBSD 5.99.65 (DEAD) #51: 
Tue Feb 14 22:38:47 CET 2012 
martin%night-porter.duskware.de@localhost:/usr/src/sys/arch/vax/compile/DEAD vax
Architecture: vax
Machine: vax
>Description:

With gcc 4.5.3 the following (closely based on a config test from 
pkgsrc/lang/tcl)
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))
                        exit(2);
        }
        printf("done\n");
        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.

>How-To-Repeat:
s/a
>Fix:
n/a



Home | Main Index | Thread Index | Old Index