public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/29925]  New: Wrong code with -ftree-vectorize
@ 2006-11-21 12:22 jean-marc dot valin at usherbrooke dot ca
  2006-11-21 12:24 ` [Bug c/29925] " jean-marc dot valin at usherbrooke dot ca
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: jean-marc dot valin at usherbrooke dot ca @ 2006-11-21 12:22 UTC (permalink / raw)
  To: gcc-bugs

I just hit what seems to be a wrong code generation bug in gcc. The bug happens
only when compiling the attached file with:
gcc -g -O1 -ffast-math -ftree-vectorize gcc_bug.c -o gcc_bug

Removing any one of -O1 -ffast-math -ftree-vectorize makes the problem go away.
When I run the complete code (which is in the Speex codec BTW), not only do I
get the wrong result, but there is a "read past array" that happens. With the
reduced example, only the read error is visible and valgrind reports:

==9508== Invalid read of size 8
==9508==    at 0x4004E3: interp_pitch (gcc_bug.c:17)
==9508==    by 0x4005D2: main (gcc_bug.c:29)
==9508==  Address 0x4D64224 is 500 bytes inside a block of size 504 alloc'd
==9508==    at 0x4A1FB37: calloc (vg_replace_malloc.c:279)
==9508==    by 0x4005A8: main (gcc_bug.c:25)

This is on an Ubuntu 64-bit Edgy machine with gcc -v:

Using built-in specs.
Target: x86_64-linux-gnu
Configured with: ../src/configure -v
--enable-languages=c,c++,fortran,objc,obj-c++,treelang --prefix=/usr
--enable-shared --with-system-zlib --libexecdir=/usr/lib
--without-included-gettext --enable-threads=posix --enable-nls
--program-suffix=-4.1 --enable-__cxa_atexit --enable-clocale=gnu
--enable-libstdcxx-debug --enable-mpfr --enable-checking=release
x86_64-linux-gnu
Thread model: posix
gcc version 4.1.2 20060928 (prerelease) (Ubuntu 4.1.1-13ubuntu5)


-- 
           Summary: Wrong code with -ftree-vectorize
           Product: gcc
           Version: 4.1.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jean-marc dot valin at usherbrooke dot ca


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


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2007-07-01  8:35 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-11-21 12:22 [Bug c/29925] New: Wrong code with -ftree-vectorize jean-marc dot valin at usherbrooke dot ca
2006-11-21 12:24 ` [Bug c/29925] " jean-marc dot valin at usherbrooke dot ca
2006-11-21 12:30 ` jean-marc dot valin at usherbrooke dot ca
2006-11-21 12:32 ` jean-marc dot valin at usherbrooke dot ca
2006-11-21 12:35 ` rguenth at gcc dot gnu dot org
2006-11-21 14:29 ` [Bug tree-optimization/29925] " jean-marc dot valin at usherbrooke dot ca
2006-12-14 12:42 ` irar at il dot ibm dot com
2006-12-14 13:28 ` jean-marc dot valin at usherbrooke dot ca
2006-12-30  6:42 ` jean-marc dot valin at usherbrooke dot ca
2007-03-05  8:01 ` patchapp at dberlin dot org
2007-03-11 13:47 ` irar at gcc dot gnu dot org
2007-03-12  6:57 ` irar at gcc dot gnu dot org
2007-07-01  8:35 ` dorit at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).