This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

other/6613: Problem with RTX_UNCHANGING_P (again)

>Number:         6613
>Category:       other
>Synopsis:       Problem with RTX_UNCHANGING_P (again)
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu May 09 13:46:01 PDT 2002
>Release:        Verified on 3.1, 3.0.4, 3.0.2 20011002 by Jakub Jelinek
Debian/GNU-Linux IA-32, gcc 3.1
The code below produces garbage.

But compiling without -O2 or with -DREMOVE_CTOR or -DUSE_INT
will work-around the problem.

#include <iostream>

struct logic
        enum state_value { LO, HI, DC, Z, NVL };

        logic(state_value l = NVL)
                : state(l) { }
        logic(const logic &l)
                : state(l.state) { }

#ifdef USE_INT
        int state;
        char state;

const logic  LO(logic::LO);
const logic  HI(logic::HI);

void func(void);

        return 0;

struct addtab
        logic sum;
        logic carry;
const struct addtab ADDTABLE[] =

        for (int tmp = 0; tmp < 8; ++tmp)
                std::cout << (int)ADDTABLE[tmp].sum.state
                          << ","
                          << (int)ADDTABLE[tmp].carry.state
                          << std::endl;

g++ -O2


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]