[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#613782: gcc-4.4: Vectorizes some loops with -m32, but not on x86_64.

Package: gcc-4.4
Version: 4.4.5-10
Severity: normal

For the following two functions,

void foo(const float * __restrict__ input, float * __restrict__ output)
    unsigned int pos;
    for (pos = 0; pos < 10100; pos++)
        output[pos] = input[pos] * 0.1;

void bar(const float * __restrict__ input, float * __restrict__ output)
    unsigned int pos;
    unsigned int i;
    for (pos = 0; pos <= 10000; pos += 100)
        for (i = 0; i < 100; i++)
            output[pos + i] = input[pos + i] * 0.1;

compiled with 

gcc -O3 -ftree-vectorizer-verbose=5 -msse2 -m32 -c main.c

vectorizes both foo and bar.  However, compiled without the -m32

gcc -O3 -ftree-vectorizer-verbose=5 -msse2 -c main.c

will only vectorize foo, and not bar.  They should both be vectorized on both platforms.

-- System Information:
Debian Release: wheezy/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'stable'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.32-5-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_US.utf8, LC_CTYPE=en_US.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages gcc-4.4 depends on:
ii  binutils                      2.20.1-16  The GNU assembler, linker and bina
ii  cpp-4.4                       4.4.5-10   The GNU C preprocessor
ii  gcc-4.4-base                  4.4.5-10   The GNU Compiler Collection (base 
ii  libc6                         2.11.2-11  Embedded GNU C Library: Shared lib
ii  libgcc1                       1:4.4.5-10 GCC support library
ii  libgomp1                      4.4.5-10   GCC OpenMP (GOMP) support library

Versions of packages gcc-4.4 recommends:
ii  libc6-dev                     2.11.2-11  Embedded GNU C Library: Developmen

Versions of packages gcc-4.4 suggests:
pn  gcc-4.4-doc                   <none>     (no description available)
pn  gcc-4.4-locales               <none>     (no description available)
ii  gcc-4.4-multilib              4.4.5-10   The GNU C compiler (multilib files
pn  libcloog-ppl0                 <none>     (no description available)
pn  libgcc1-dbg                   <none>     (no description available)
pn  libgomp1-dbg                  <none>     (no description available)
pn  libmudflap0-4.4-dev           <none>     (no description available)
pn  libmudflap0-dbg               <none>     (no description available)
pn  libppl-c2                     <none>     (no description available)
pn  libppl7                       <none>     (no description available)

-- no debconf information

Reply to: