From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4959 invoked by alias); 16 Dec 2009 19:51:30 -0000 Received: (qmail 4927 invoked by uid 48); 16 Dec 2009 19:51:21 -0000 Date: Wed, 16 Dec 2009 19:51:00 -0000 Subject: [Bug c++/42394] New: pure virtual method called when compiling with "-fno-strict-aliasing -O" X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "Troy dot Runkel at mathworks 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: 2009-12/txt/msg01618.txt.bz2 The attached test case should produce no output when executed. However, when compiled with the following command-line arguments... g++ pure_virtual_function_test.cpp -fno-strict-aliasing -O -o fail_test the test case produces the following output... pure virtual method called terminate called without an active exception Aborted The assembly code for MakeNvSsInportsNvIfNeeded shows that the call to DescSysOutportSourceHandler::handleEachDescSys is passed the vtable for DescSysOutportSourceHandler. However the call to DescSysSelfLoopHandler::handleEachDescSys is passed the vtable for DescSysIteratorNc instead of the vtable for DescSysSelfLoopHandler. The output of "g++ -v" follows... Using built-in specs. Target: x86_64-unknown-linux-gnu Configured with: ../../../sources/gcc-4.3/configure --prefix=/hub/3rdparty/internal/142814/glnxa64/gcc-4.3.4 --with-gmp=/sandbox/rjarrett/3p-gcc/3p/derived/glnxa64/gcc-4.3/gmp --with-mpfr=/sandbox/rjarrett/3p-gcc/3p/derived/glnxa64/gcc-4.3/mpfr --enable-languages=c,c++,fortran --with-as=/hub/3rdparty/internal/142814/glnxa64/gcc-4.3.4/bin/as --with-ld=/hub/3rdparty/internal/142814/glnxa64/gcc-4.3.4/bin/ld --disable-multilib Thread model: posix gcc version 4.3.4 (GCC) -- Summary: pure virtual method called when compiling with "-fno- strict-aliasing -O" Product: gcc Version: 4.3.4 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: Troy dot Runkel at mathworks dot com http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42394