avr-gcc-list
[Top][All Lists]
Advanced

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

Re: [avr-gcc-list] Link Time Optimization vs __builtin_unreachable() and


From: Bob Paddock
Subject: Re: [avr-gcc-list] Link Time Optimization vs __builtin_unreachable() and .signature?
Date: Mon, 18 Jun 2012 15:53:16 -0400

>> With LTO all the code after __builtin_unreachable(); is gone, breaking
>> the project.
>
> Code after __builtin_unreachable() is unreachable, this not needed.
> If you claim a function is noreturn but there is a code path that can reach
> the end of such a function, your claim is obviously wrong, thus the warning.
>
> Note that the compiler has no knowledge on the magic of RST.CTRL.
> I don't know how the macro exactly expands, presumably it's just some
> inline assembler and SFR writes. This means that code execution resumes
> after the sequence, except you tell so. This is accomplished by
> __builtin_unreachable. It means "I never come here, any code after here
> is dead".

The issue is one of scope.  I expect the reach of __unreachable() to
be limited to the __noreturn__ function or at least the file that it
is contained in.

With LTO all code after __unreachable() in *all* files linked after it
(guessing about 30) are gone.  Does not seem correct.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]