public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* 2.95/3.x regression in the compilation of computed gotos?
@ 2004-01-22 13:12 duchier
  2004-01-22 15:52 ` Robert Dewar
  0 siblings, 1 reply; 4+ messages in thread
From: duchier @ 2004-01-22 13:12 UTC (permalink / raw)
  To: gcc

[-- 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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2004-01-22 20:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-01-22 13:12 2.95/3.x regression in the compilation of computed gotos? duchier
2004-01-22 15:52 ` Robert Dewar
2004-01-22 16:41   ` duchier
2004-01-22 21:44     ` Richard Henderson

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).