http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60220
--- Comment #3 from harmeeksingh at gmail dot com ---
It still does not vectorise after adding the recomended flag. But rewriting the
code the following way does.
This is a bizare behavioir . My tests show that this is not an issue of gcc
rewriting it as a memset . If I change the value 0 to a array assignment it
still gives. From the output it does show that it is trying to assign FALSE.
31: not vectorized: data ref analysis failed *D.2549_9 = 0;
31: not vectorized: data ref analysis failed *D.2549_9 = 0;
#include <stdio.h>
#include <stdint.h>
#define FALSE ((char )0)
struct test
{
int *copy;
};
typedef struct test test;
static inline
foo1(int *a, unsigned int num)
{
unsigned int cnt;
for (cnt = 0; cnt < num ; cnt++)
a[cnt] = FALSE;
}
typedef uintptr_t Datum;
void
foo(test *__restrict c, unsigned int a, unsigned int num)
{
foo1(c->copy, num); // This vectorizes. if we pass it to inline function
}