[Bug target/40243] New: no aligned instruction generated for i386

2009-05-25 Thread abhishek dot shrivastav24 at gmail dot com
Even a simple program like:

for(i=0;i<1000;i++)
a[i]= b[i]+c[i];

is vectorized using -ftree-vectorize -msse2 -O2 flag. Unaligned instruction are
generated. For any program, Not even a single aligned instruction is generated.

As, the variable STACK_BOUNDARY in function "vect_can_force_dr_alignment_p" in
file tree-vectorizer.c:1798 is defined to be BITS_PER_WORD(32) for i386 in
i386.h . while this should be 128, so this variable should be replaced by some
other variable or might be again restored to PREFERRED_STACK_BOUNDARY, like
previous versions.

In version 4.4.0 , it is replaced by MAX_STACK_ALIGNMENT, which is defined as
MAX_OFILE_ALIGNEMENT in i386.h. So, both conditions return ,the same answer (
alignment <= MAX_OFILE_ALIGNMENT).


-- 
   Summary: no aligned instruction generated for i386
   Product: gcc
   Version: 4.3.3
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: target
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: abhishek dot shrivastav24 at gmail dot com
 GCC build triplet: i686-unknown-linux
  GCC host triplet: i686-unknown-linux
GCC target triplet: i686-unknown-linux


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40243



[Bug target/40243] no aligned instruction generated for i386

2009-05-25 Thread abhishek dot shrivastav24 at gmail dot com


--- Comment #2 from abhishek dot shrivastav24 at gmail dot com  2009-05-25 
14:36 ---
(In reply to comment #1)
> Works for me (your simple program is not a valid program).
> 

The whole program is like this:

/* sample.c */
#include 
#define N 1000
int main()
{
   int a[N], b[N], c[N], i;
   for(i=0;ihttp://gcc.gnu.org/bugzilla/show_bug.cgi?id=40243