[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [patches] Remove "nonreturn" declaration from abort



On Thu, 7 May 2009, David Kastrup wrote:

> I don't actually include a patch: it would just consist of removing the
> respective declaration from the abort call.  I can't vouch that gcc
> itself has builtin "knowledge" here, too, but fixing the library
> declaration would be a first step.

The compiler does have built-in knowledge.  Furthermore, thus knowledge is 
important for other reasons; many bogus warnings and -Werror build 
failures would result if the compiler doesn't know that execution 
terminates on certain paths and so things that certain flows of control 
are possible that are not possible.

I think you should add an extra attribute to the compiler to say that 
certain optimizations should not be applied to calls to a particular 
noreturn function, and make the compiler also put that on its built-in 
declaration of abort.  The compiler would still know about the control 
flow effects, and just avoid those transformations that are problematic.

-- 
Joseph S. Myers
joseph@xxxxxxxxxxxxxxxx