RFC [ABI]: C++ PATCH for c++/44540 - avoid mangling attribute noreturn

Mark Mitchell mark@codesourcery.com
Tue Jul 6 22:23:00 GMT 2010


Jason Merrill wrote:

> The ICE in PR 44540 called attention to a long-standing mangling bug:
> attributes noreturn and const are represented internally as
> TYPE_VOLATILE and TYPE_CONST on FUNCTION_TYPE, and we were emitting them
> as cv-quals on the mangled form of the function type in a parameter of
> pointer-to-function type.

Oh, ugh.  I've always thought that using TYPE_{VOLATILE,CONST} for these
attributes was an ugly representation hack, but I didn't think about the
impact on mangling.

> The testcase was derived from the systemtap sources, where the relevant
> declaration has C linkage, so it would not be affected by this change.
> But it is an ABI change.

I guess I think this ought to require an -fabi-version=N option.  Your
change is clearly correct, but to the extent that this matters to
anyone, it is going to break existing working code.

-- 
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713



More information about the Gcc-patches mailing list