public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* egcs1.0.2 in-class function screws switch table
@ 1998-07-19 14:04 Mark Salazar
  1998-07-23 19:01 ` Mumit Khan
  0 siblings, 1 reply; 2+ messages in thread
From: Mark Salazar @ 1998-07-19 14:04 UTC (permalink / raw)
  To: gnu-win32

While debugging some code I discovered that my egcs1.0.2 mingw32 compiler
is generating an invalid jump-address table for a switch construct if the
function in question is defined in-class.  Ie, this works:
	class Child2: public Parent {
		int textstuff (int w) ;
	};
	int Child2::textstuff(int w){
		switch(w){
		case 0: doSomething(1); break;
		case 1: doSomething(2); break;
		}
		return(1);
	}

but this doesn't:
	class Child2: public Parent {
		int textstuff (int w) {
			switch(w){
			case 0: doSomething(1); break;
			case 1: doSomething(2); break;
			}
			return(1);
		};
	};


After much gdb'ing I determined the problem was the compiler-generated
jump table for the switch statement.  It's garbage for the case that
doesn't work.

Has anyone seen this before?


-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".

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

* Re: egcs1.0.2 in-class function screws switch table
  1998-07-19 14:04 egcs1.0.2 in-class function screws switch table Mark Salazar
@ 1998-07-23 19:01 ` Mumit Khan
  0 siblings, 0 replies; 2+ messages in thread
From: Mumit Khan @ 1998-07-23 19:01 UTC (permalink / raw)
  To: Mark Salazar; +Cc: gnu-win32

On Sun, 19 Jul 1998, Mark Salazar wrote:

> While debugging some code I discovered that my egcs1.0.2 mingw32 compiler
> is generating an invalid jump-address table for a switch construct if the
> function in question is defined in-class.  Ie, this works:

Mark, I've uploaded binutils-2.9.1 that works (at least supposed to!) with
egcs-1.0.2. Could you try it out to see if your problem is still there or
not?

  ftp://ftp.xraylith.wisc.edu/pub/khan/gnu-win32/cygwin32/releases/
  ftp://ftp.xraylith.wisc.edu/pub/khan/gnu-win32/mingw32/releases/

To install:
  
  1. cd to Cygnus root 
      
      % cd /Cygnus/B19
  
  2. untar.
      
      % gunzip -v /tmp/binutils-2.9.1.tar.gz
      % tar xvf  /tmp/binutils-2.9.1.tar
     
     or,

      % tar zxvf  /tmp/binutils-2.9.1.tar.gz

Mumit

-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".

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

end of thread, other threads:[~1998-07-23 19:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-07-19 14:04 egcs1.0.2 in-class function screws switch table Mark Salazar
1998-07-23 19:01 ` Mumit Khan

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