public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: jching@flex.com
To: gcc-gnats@gcc.gnu.org
Subject: other/6613: Problem with RTX_UNCHANGING_P (again)
Date: Thu, 09 May 2002 13:46:00 -0000	[thread overview]
Message-ID: <20020509203816.5593.qmail@sources.redhat.com> (raw)


>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
>Closed-Date:
>Last-Modified:
>Originator:     jching@flex.com
>Release:        Verified on 3.1, 3.0.4, 3.0.2 20011002 by Jakub Jelinek
>Organization:
>Environment:
Debian/GNU-Linux IA-32, gcc 3.1
>Description:
The code below produces garbage.

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

--jc
----------------------------
#include <iostream>

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

        logic(state_value l = NVL)
                : state(l) { }
#ifndef REMOVE_CTOR
        logic(const logic &l)
                : state(l.state) { }
#endif

#ifdef USE_INT
        int state;
#else
        char state;
#endif
        };

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

void func(void);

int
main()
        {
        func();
        return 0;
        }

struct addtab
        {
        logic sum;
        logic carry;
        };
const struct addtab ADDTABLE[] =
        {
        {LO,LO},
        {HI,LO},
        {HI,LO},
        {LO,HI},
        {HI,LO},
        {LO,HI},
        {LO,HI},
        {HI,HI}
        };

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

>How-To-Repeat:
g++ -O2 file.cc
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


             reply	other threads:[~2002-05-09 20:46 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-05-09 13:46 jching [this message]
2002-05-13  0:03 jakub
2002-10-17 13:57 mmitchel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20020509203816.5593.qmail@sources.redhat.com \
    --to=jching@flex.com \
    --cc=gcc-gnats@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).