qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 1/3] Add support for target helper functions whi


From: Stefan Weil
Subject: Re: [Qemu-devel] [PATCH 1/3] Add support for target helper functions which don't return
Date: Mon, 19 Mar 2012 12:06:53 +0100
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.16) Gecko/20120207 Iceowl/1.0b1 Icedove/3.0.11

Am 19.03.2012 11:45, schrieb Andreas Färber:
Am 18.03.2012 23:16, schrieb Stefan Weil:
Most functions which handle exceptions don't return.

With a compiler attribute (added by QEMU_NORETURN),
gcc can optimize the code.

Do you have any numbers?

Yes, of course: for (;;) { printf("%ld\n", random()); } :-)

To be honest, I don't expect large savings of code (some bytes for the function return
which is no longer needed), nor will there be a huge gain in execution speed.

It's more for documentation purposes that this attribute is useful here.
We might also add a compiler warning for missing attributes some day
(-Wsuggest-attribute=
noreturn) - it is surprising how many functions never return!

Regards,
Stefan



Signed-off-by: Stefan Weil <address@hidden>

Seems like a sensible optimization,

Reviewed-by: Andreas Färber <address@hidden>

Andreas

reply via email to

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