This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/12362] Compiler generates incorrect code at -O2
- From: "sean at mcneil dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 22 Sep 2003 14:47:19 -0000
- Subject: [Bug c/12362] Compiler generates incorrect code at -O2
- References: <20030922052942.12362.sean@mcneil.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12362
sean at mcneil dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |UNCONFIRMED
Resolution|INVALID |
------- Additional Comments From sean at mcneil dot com 2003-09-22 14:47 -------
The code is not invalid. To illustrate my point, I have removed all type
casting and I still get the erroneous code produced. There is no illegal code here.
#define EARLY 4
typedef int (*FUNCPTR) ();
typedef struct
{
FUNCPTR removeRtn;
FUNCPTR calibrateRtn;
FUNCPTR putRtn;
} Q_CLASS;
typedef struct
{
Q_CLASS *pQClass;
} Q_HEAD;
typedef int Q_NODE;
typedef struct
{
int status;
Q_NODE node;
} ID;
extern int ticks;
extern ID *id;
extern Q_HEAD queue;
extern Q_HEAD t_queue;
#define Q_REMOVE(pQHead,pQNode) \
(*(((pQHead))->pQClass->removeRtn)) \
(((pQHead)), ((pQNode)))
#define Q_CALIBRATE(pQHead,keyDelta) \
(*(((pQHead))->pQClass->calibrateRtn)) \
(((pQHead)), ((keyDelta)))
#define Q_PUT(pQHead,pQNode,key) \
(*(((pQHead))->pQClass->putRtn)) \
(((pQHead)), ((pQNode)), (key))
int early (register int timeout)
{
Q_REMOVE (&queue, &id->node);
if ((unsigned)(ticks + timeout) < ticks)
{
Q_CALIBRATE (&t_queue, ~ticks + 1);
ticks = 0;
}
Q_PUT (&queue, &id->node, timeout + ticks);
id->status |= EARLY;
return 0;
}