public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* other/6613: Problem with RTX_UNCHANGING_P (again)
@ 2002-05-09 13:46 jching
0 siblings, 0 replies; 3+ messages in thread
From: jching @ 2002-05-09 13:46 UTC (permalink / raw)
To: gcc-gnats
>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:
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: other/6613: Problem with RTX_UNCHANGING_P (again)
@ 2002-10-17 13:57 mmitchel
0 siblings, 0 replies; 3+ messages in thread
From: mmitchel @ 2002-10-17 13:57 UTC (permalink / raw)
To: gcc-bugs, gcc-prs, jching, nobody
Synopsis: Problem with RTX_UNCHANGING_P (again)
State-Changed-From-To: analyzed->closed
State-Changed-By: mmitchel
State-Changed-When: Thu Oct 17 13:57:18 2002
State-Changed-Why:
Already fixed in GCC 3.2.1.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=6613
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: other/6613: Problem with RTX_UNCHANGING_P (again)
@ 2002-05-13 0:03 jakub
0 siblings, 0 replies; 3+ messages in thread
From: jakub @ 2002-05-13 0:03 UTC (permalink / raw)
To: gcc-bugs, gcc-prs, jching, nobody
Synopsis: Problem with RTX_UNCHANGING_P (again)
State-Changed-From-To: open->analyzed
State-Changed-By: jakub
State-Changed-When: Mon May 13 00:03:20 2002
State-Changed-Why:
Simplified testcase is
struct L
{
enum S { A, B, C };
L (S x = C) : l (x) {}
L (const L &x) : l (x.l) {}
char l;
};
const L A (L::A);
const L B (L::B);
struct T
{
L u, v;
};
const struct T x [] =
{
{A, A}, {B, A}, {B, A}, {A, B}, {B, A}, {A, B}, {A, B}, {B, B}
};
extern "C" void abort (void);
extern "C" void exit (int);
int
main()
{
for (int i = 0; i < 8; i++)
{
if (x[i].u.l * 2 != ((((i & 3) ^ (i >> 2)) + 1) & 2))
abort ();
if (x[i].v.l != ((((i + 1) ^ 1) - 1) >= 4))
abort ();
}
exit (0);
}
Regression from 2.95.x.
For some details, see http://gcc.gnu.org/ml/gcc/2002-05/msg00642.html
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=6613
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2002-10-17 20:57 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-05-09 13:46 other/6613: Problem with RTX_UNCHANGING_P (again) jching
2002-05-13 0:03 jakub
2002-10-17 13:57 mmitchel
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).