This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Loop unrolling
- To: mrs at wrs dot com (Mike Stump)
- Subject: Re: Loop unrolling
- From: Joern Rennecke <amylaar at cygnus dot co dot uk>
- Date: Thu, 11 Jun 1998 13:18:50 +0100 (BST)
- Cc: pfeifer at dbai dot tuwien dot ac dot at, egcs-patches at cygnus dot com, egcs at cygnus dot com
> > Branko Cibej <branko.cibej@hermes.si>,
>
> His example was mistaken. He had no ``empty'' loops.
>
> for (size_t i = 0; i < size; ++i)
> new (&objs[i]) T(init);
>
> In this case, ``new (&objs[i]) T(init)'' != ``'', hence the loop is
> not empty.
>
> for (size_t i = 0; i < size; ++i)
> objs[i].~T();
>
> In this case, ``objs[i].~T()'' != ``'', hence the loop is not empty.
Well, how about some plain C macroid code:
#define NOP(X, N) /* This space intentionally left blank */
#define FROB(X, OP) \
do { \
foo (x); \
for (i = n; --i >=0; ) \
OP (X, i); \
bar(x); \
} while (0);
FROB (x, NOP);