On Wednesday 14 February 2001 09:33, Ch Rama Krishna Prasad wrote:
> Thank u Mr. David Olofson for the reply.
> Just after sending the previous mail, I have changed the code such that
> the code under the case is replaced by a function call. The function itself
> contains the same code which was previously under case.
> Now the module is functioning o.k.But i do not get the reason. If u have
> any idea pl. reply.
Interesting... How large does the switch() construct actually get with the
code inlined?
It *could* be a compiler bug - or just a compiler switch that breaks
something. The compiler could somehow silently fail to select the right word
size for the switch() offset table... That would be easy to figure out by
looking at the asm output. If the offset table consists of 16 bit offsets and
the last case is >32k (or *possibly* 64k - not sure if unsigned offsets are
ever used) away from the switch() LUT code (usually some CMPs and a jump to
PC + [table_start + switch_arg]), there's why it crashes.
I don't feel particularly good about accusing the compiler (it's nearly
always the last place to look), but I've seen a few gcc bugs break code
lately, so I'm a bit paranoid... And this looks like one of those extreme
cases that can trigger complier bugs that are rarely seen, and therefore may
pass unnoticed for long.
If that's not it, the only thing I can think of right now is still to look at
the asm output. It can help to look at your code translated into another
language also if the bug is in your code. (You'd have to know some asm in
this case, obviously. :-)
//David
.- M A I A -------------------------------------------------.
| Multimedia Application Integration Architecture |
| A Free/Open Source Plugin API for Professional Multimedia |
`----------------------> http://www.linuxaudiodev.com/maia -'
.- David Olofson -------------------------------------------.
| Audio Hacker - Open Source Advocate - Singer - Songwriter |
`--------------------------------------> [EMAIL PROTECTED] -'