From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10194 invoked by alias); 18 Jan 2008 14:09:39 -0000 Received: (qmail 10014 invoked by uid 48); 18 Jan 2008 14:08:54 -0000 Date: Fri, 18 Jan 2008 14:27:00 -0000 Message-ID: <20080118140854.10013.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug c/34841] 'make check' of libsndfile-1.0.17 fails with gcc-4.2.2 -O2 optimization, OK with -O1 one In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "sergstesh at yahoo dot com" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2008-01/txt/msg01933.txt.bz2 ------- Comment #15 from sergstesh at yahoo dot com 2008-01-18 14:08 ------- With CFLAGS='-O2 -Wstrict-overflow=5' still there is no warnings in 'make_check.log': " sergei@amdam2:/mnt/sda8/sergei/gcc4.2.x-O2_bug/gcc-4.2.2-O2/libsndfile-1.0.17> grep -i warn make.log sndfile.c:491: warning: the address of 'sf_error' will never be NULL sndfile-play.c:292: warning: the address of ‘status’ will always evaluate as ‘true’ sergei@amdam2:/mnt/sda8/sergei/gcc4.2.x-O2_bug/gcc-4.2.2-O2/libsndfile-1.0.17> grep -i warn make_check.log sergei@amdam2:/mnt/sda8/sergei/gcc4.2.x-O2_bug/gcc-4.2.2-O2/libsndfile-1.0.17> grep -P '\-Wstrict-overflow=5' make.log | wc -l 341 sergei@amdam2:/mnt/sda8/sergei/gcc4.2.x-O2_bug/gcc-4.2.2-O2/libsndfile-1.0.17> ", so I think you are right there is a bug in gcc. And there is apparently another bug. If I do _not_ have "-Wstrict-overflow", I _do_ have these warnings during compilation: " sergei@amdam2:/mnt/sda8/sergei/gcc4.2.x-O2_bug/gcc-4.2.2-O2/libsndfile-1.0.17> grep "comparison between signed and unsigned" ../../gcc-4.2.2-O1/libsndfile-1.0.17/make.log floating_point_test.c:338: warning: comparison between signed and unsigned floating_point_test.c:388: warning: comparison between signed and unsigned floating_point_test.c:438: warning: comparison between signed and unsigned floating_point_test.c:488: warning: comparison between signed and unsigned floating_point_test.c:538: warning: comparison between signed and unsigned floating_point_test.c:588: warning: comparison between signed and unsigned floating_point_test.c:638: warning: comparison between signed and unsigned floating_point_test.c:688: warning: comparison between signed and unsigned sergei@amdam2:/mnt/sda8/sergei/gcc4.2.x-O2_bug/gcc-4.2.2-O2/libsndfile-1.0.17> ". If I have "-Wstrict-overflow", I do _not_ have the above warnings: " sergei@amdam2:/mnt/sda8/sergei/gcc4.2.x-O2_bug/gcc-4.2.2-O2/libsndfile-1.0.17> grep "comparison between signed and unsigned" make.log sergei@amdam2:/mnt/sda8/sergei/gcc4.2.x-O2_bug/gcc-4.2.2-O2/libsndfile-1.0.17> ". I believe I should have the warnings in both cases. Folks, libsndfile is easy to compile - it has (kind of) no external dependencies, i.e. it depends only on basic libraries like libm, glibc, etc., so you can easily conduct such experiments yourselves - the the needed "beef", including libsdnfile sources, is in the uploaded file. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34841