This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/35590] Value profiling: string op -- requires power of 2 value??
- From: "xinliangli at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 14 Mar 2008 18:55:46 -0000
- Subject: [Bug middle-end/35590] Value profiling: string op -- requires power of 2 value??
- References: <bug-35590-9436@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #1 from xinliangli at gmail dot com 2008-03-14 18:55 -------
(In reply to comment #0)
> value profiling transformation does not kick in for the following simple
> program. Looks like it requires power of 2 values to dominate. It is probably
> not due to design but simply lack of unit testing for feature.
>
> #include <string.h>
>
> void mycpy (char* s1, char *s2, int n) __attribute__((noinline));
> void mycpy (char* s1, char *s2, int n)
> {
> memcpy(s1,s2,n);
> }
>
>
> int main()
> {
>
> char *s1 = malloc(100000);
> char *s2 = malloc(100000);
> int i;
>
> for ( i = 0 ; i < 100000; i ++)
> {
> mycpy(s1,s2, 129);
> }
>
> }
>
Even stranger, try 128 it works, but not for 256.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35590