Re: [PATCH] ARM: Convert BUG() to use unreachable()

David Daney
2009-12-10T17:57:02Z

Russell King - ARM Linux wrote:
> On Tue, Dec 08, 2009 at 10:55:38AM +0100, Uwe Kleine-König wrote:
>> Use the new unreachable() macro instead of for(;;);
>
> Have you investigated what effect this has on generated code?

Yes.

Pre GCC-4.5 the generated code should be identical as 'unreachable()'
just expands to 'for(;;);' in this case.

Post GCC-4.5 the generated code should be smaller.

I have not tested on ARM, but on x86_64, i686, and mips64 this is the
case. The code size reduction is due to not emitting an endless loop
after the asm() that never returns.

David Daney