Why does casting a function generate a run-time abort?

Mark Mitchell mark@codesourcery.com
Tue Jun 22 04:42:00 GMT 2004


Ziemowit Laski wrote:

>
> Hm... I can't really claim that I never consider aesthetics in my
> hac^H^H^Hengineering activities, although technical considerations
> always trump them, as they should.  I guess I'll just wait for your
> METHOD_EXPR work, and then will decide which approach is more
> disgusting. :-)

I'm going to jump in here and say that I strongly agree with Richard.

In over a decade of working on front ends, I've long since concluded 
that you want to express special things as special nodes.  A good 
example is exception-handling; a C++ front end could just transform it 
all into setjmp/longjmp (as Cfront did), but then you get bad 
performance.  If you want good performance, you must send it to the back 
end as try/catch.  As Richard says, virtual function calls really ought 
to be the same; there's no reason to devolve into the vtable-indexing 
C-ish stuff until you have optimized as much as you can.

-- 
Mark Mitchell
CodeSourcery, LLC
(916) 791-8304
mark@codesourcery.com



More information about the Gcc mailing list