This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Fwd: Macros taking a function as argument - and evaluating it at least twice
- From: Marc Glisse <marc dot glisse at inria dot fr>
- To: Steven Bosscher <stevenb dot gcc at gmail dot com>
- Cc: GCC Mailing List <gcc at gcc dot gnu dot org>
- Date: Wed, 13 Nov 2013 17:21:55 +0100 (CET)
- Subject: Re: Fwd: Macros taking a function as argument - and evaluating it at least twice
- Authentication-results: sourceware.org; auth=none
- References: <CABu31nMDGXH0n2OpfsPcTpDU7qqwLGsaeWiOXSK=8pSVDBx8pQ at mail dot gmail dot com> <CABu31nMcEEe_W-UKuXHAM33V5n_OT7SqjFan8Rbhwm_7TbvUpw at mail dot gmail dot com>
- Reply-to: GCC Mailing List <gcc at gcc dot gnu dot org>
On Wed, 13 Nov 2013, Steven Bosscher wrote:
Here is a non-comprehensive list of macros that are used with a
function passed to the macro's argument, and the macro evaluates that
argument at least twice:
Note that in your list the macro argument is almost always a simple static
inline function where I expect gcc must optimize away the second copy of
the code.
Not that it wouldn't be good if there was no second copy for gcc to
optimize...
--
Marc Glisse