m68k C++ exception handling

Andreas Schwab schwab@suse.de
Tue Aug 19 00:30:00 GMT 2003


Bernardo Innocenti <bernie@develer.com> writes:

|> On Monday 18 August 2003 11:27, Andreas Schwab wrote:
|> > Bernardo Innocenti <bernie@develer.com> writes:
|> > |> C++ exceptions handling appears to be broken on m68k in both GCC 3.3.1
|> > |> and CVS HEAD (I've tested only on ColdFire targets). This didn't work
|> > |> also in GCC 2.95.3 with the uClinux patches I've ported forward, so the
|> > |> cause might be identical.
|> >
|> > I tested this on m68k-linux with positive results, but this is already
|> > quite some time ago.
|> 
|> Could I send you some experimental patches I've applied to my local tree?
|> If you have time, I'd like you to verify exceptions on m68k-linux with
|> those patches applied.

I probably won't have time to look at them in the near future.

|> Where is this information emitted exactly? If it's that dwarf stuff in
|> m68k_output_function_prologue(),

Yes, that's the place.

|> This is what a notmal m68k prologue/epilogue would do:
|> 
|> 	link	#-frame_size,a6
|> 	movm	regs_to_save,-(sp)
|> 
|> 	[...]
|> 
|> 	movm	(sp)+,regs_to_save
|> 	unlk	a6
|> 	rts
|> 
|> And this is how you would it do on a ColdFire:
|> 
|> 	link	#-frame_size_with_regs,a6
|> 	movm	regs_to_save,(fp)
|> 
|> 	[...]
|> 
|> 	movm	(fp),regs_to_save
|> 	unlk	a6
|> 	rts
|> 
|> Seems simple, but it takes quite a lot of intrusive changes in
|> m68k_output_function_(prologue|epilogue) to get it right in all
|> cases, with and without the frame pointer.

I might be that you didn't get the cfa offsets right.  You should try to
single step through the exception handing code to see where it tries to
fetch the register values.

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux AG, Deutschherrnstr. 15-19, D-90429 Nürnberg
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."



More information about the Gcc mailing list