This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/28481] regression from 3.x: 4.1.1 uses memory where it can use registers
- From: "vda dot linux at googlemail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 25 Jul 2006 17:18:22 -0000
- Subject: [Bug target/28481] regression from 3.x: 4.1.1 uses memory where it can use registers
- References: <bug-28481-12956@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #3 from vda dot linux at googlemail dot com 2006-07-25 17:18 -------
With this test program:
#include <sys/time.h>
#include <stdio.h>
typedef unsigned u32;
struct serpent_ctx { u32 expkey[132]; };
void serpent_encrypt(void *ctx, u32 *dst, const u32 *src);
u32 v[4],u[4];
struct serpent_ctx ctx;
int main() {
time_t t;
int count;
t = time(NULL);
while(t == time(NULL)) /*wait*/;
t = time(NULL); count = 0;
while(t == time(NULL)) {
serpent_encrypt(&ctx, u, v);
serpent_encrypt(&ctx, u, v);
serpent_encrypt(&ctx, u, v);
serpent_encrypt(&ctx, u, v);
count++;
}
printf("ops/second=%d\n", count);
return 0;
}
I see that bigger code = slower code:
# size serpent343-O3 serpent411-O3 serpent343-Os
text data bss dec hex filename
4285 260 592 5137 1411 serpent343-O3
4461 260 592 5313 14c1 serpent411-O3
5101 260 592 5953 1741 serpent343-Os
343-O3 is just tiny bit smaller, and it also is tiny bit faster:
# ./serpent343-O3;./serpent343-O3;./serpent343-O3;
ops/second=168637
ops/second=166610
ops/second=169509
# ./serpent411-O3;./serpent411-O3;./serpent411-O3;
ops/second=164809
ops/second=163172
ops/second=161431
I tried longer runs. It is definitely not just a test variability.
The biggest is the slowest:
# ./serpent343-Os;./serpent343-Os;./serpent343-Os;
ops/second=158495
ops/second=151342
ops/second=154777
So, yes, this is also a smallish speed regression too.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28481