The vectorizer generates wrong code for the attached example

dogbert> gcc o.c
dogbert> a.out
 this is where I should be (R = 1.0e+00)...
dogbert> gcc -O1 -ftree-vectorize o.c
dogbert> a.out
 I should not be here (R = -1.0e+300)...
dogbert> gcc -v
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/usr/local/gcc410
--enable-languages=c,c++,f95
Thread model: posix
gcc version 4.1.0 20050725 (experimental)

This behavior shows up on the mainline, but not the 4.0 branch. I could
reproduce the problem on i686-pc-linux-gnu, x86_64-unknown-linux-gnu, and
sparc-sun-solaris2.9, so doesn't seem to be target specific.

-- 
           Summary: -ftree-vectorize generates wrong code
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: tree-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: p dot van-hoof at qub dot ac dot uk
                CC: gcc-bugs at gcc dot gnu dot org


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

Reply via email to