From: duchier@ps.uni-sb.de
To: gcc@gcc.gnu.org
Subject: 2.95/3.x regression in the compilation of computed gotos?
Date: Thu, 22 Jan 2004 13:12:00 -0000 [thread overview]
Message-ID: <87fze8i2oq.fsf@tdg.loria.fr> (raw)
[-- Attachment #1: Type: text/plain, Size: 462 bytes --]
Guys,
I'd like to get your opinion on the difference in how gcc 2.95 and
3.3.2 compile the line of code below (where PC has type void**):
goto ** (PC += 1);
2.95:
addl $4,%eax
jmp *(%eax)
3.3.2:
addl $4,%ecx
movl (%ecx),%edx
jmp *%edx
Isn't this a regression?
I attach below the short program used to illustrate this difference.
It reflects in a simplified manner what happens in our emulator for
mozart/oz threaded bytecode.
[-- Attachment #2: test program --]
[-- Type: text/plain, Size: 267 bytes --]
void* program[2];
int counter = 0;
#define DISPATCH(N) goto **(PC+=N)
void foo (void** PC)
{
if (PC==0) {
program[0] = && one;
program[1] = && two;
return;
}
DISPATCH(0);
one:
counter += 3;
DISPATCH(1);
two:
counter += 5;
DISPATCH(1);
}
[-- Attachment #3: Type: text/plain, Size: 77 bytes --]
Cheers,
--
Denys Duchier - Équipe Calligramme - LORIA, Nancy, France
next reply other threads:[~2004-01-22 12:34 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-01-22 13:12 duchier [this message]
2004-01-22 15:52 ` Robert Dewar
2004-01-22 16:41 ` duchier
2004-01-22 21:44 ` Richard Henderson
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=87fze8i2oq.fsf@tdg.loria.fr \
--to=duchier@ps.uni-sb.de \
--cc=gcc@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).