From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24228 invoked by alias); 24 Oct 2014 12:27:48 -0000 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 Received: (qmail 24205 invoked by uid 89); 24 Oct 2014 12:27:46 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail.turbocat.net Received: from heidi.turbocat.net (HELO mail.turbocat.net) (88.198.202.214) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Fri, 24 Oct 2014 12:27:44 +0000 Received: from laptop015.home.selasky.org (cm-176.74.213.204.customer.telag.net [176.74.213.204]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 9E0271FE023 for ; Fri, 24 Oct 2014 14:27:40 +0200 (CEST) Message-ID: <544A45C1.8060808@selasky.org> Date: Fri, 24 Oct 2014 13:05:00 -0000 From: Hans Petter Selasky User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.1.2 MIME-Version: 1.0 To: gcc-bugs@gcc.gnu.org Subject: GCC48/49 crash on fast floating point math in combination with -O3 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2014-10/txt/msg01940.txt.bz2 Hi, Looks like one of the -O3 optimising steps are broken: cat << EOF > powfcrash.cpp #include #include class test { public: unsigned char y; void testfn(unsigned char); }; void test :: testfn(unsigned char x) { y = x; float fr = expf(powf(y / 127.0f, 0.5f) * logf(25000.0f)) + 40.0f; printf("%f Result\n", fr); } int main() { class test test; test.testfn(2.0); return (0); } EOF g++48 -O3 -ffast-math -Wall -Wextra powfcrash.cpp powfcrash.cpp: In member function 'void test::testfn(unsigned char)': powfcrash.cpp:12:1: internal compiler error: Segmentation fault: 11 test :: testfn(unsigned char x) ^ no stack trace because unwind library not available Please submit a full bug report, with preprocessed source if appropriate. See for instructions. > g++48 -v > Using built-in specs. > COLLECT_GCC=g++48 > COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc48/gcc/x86_64-portbld-freebsd9.1/4.8.3/lto-wrapper > Target: x86_64-portbld-freebsd9.1 > Configured with: ./../gcc-4.8.3/configure --disable-bootstrap --disable-nls --enable-gnu-indirect-function --libdir=/usr/local/lib/gcc48 --libexecdir=/usr/local/libexec/gcc48 --program-suffix=48 --with-as=/usr/local/bin/as --with-gmp=/usr/local --with-gxx-include-dir=/usr/local/lib/gcc48/include/c++/ --with-ld=/usr/local/bin/ld --with-libiconv-prefix=/usr/local --with-pkgversion='FreeBSD Ports Collection' --with-system-zlib --with-ecj-jar=/usr/local/share/java/ecj-4.5.jar --enable-languages=c,c++,objc,fortran,java --prefix=/usr/local --mandir=/usr/local/man --infodir=/usr/local/info/gcc48 --build=x86_64-portbld-freebsd9.1 > Thread model: posix > gcc version 4.8.3 (FreeBSD Ports Collection) Thank you! --HPS