From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11993 invoked by alias); 4 Oct 2002 23:15:24 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 11986 invoked from network); 4 Oct 2002 23:15:22 -0000 Received: from unknown (HELO e4.ny.us.ibm.com) (32.97.182.104) by sources.redhat.com with SMTP; 4 Oct 2002 23:15:22 -0000 Received: from northrelay04.pok.ibm.com (northrelay04.pok.ibm.com [9.56.224.206]) by e4.ny.us.ibm.com (8.12.2/8.12.2) with ESMTP id g94NFLc9184050 for ; Fri, 4 Oct 2002 19:15:21 -0400 Received: from dyn9-47-17-68.beaverton.ibm.com (dyn9-47-17-68.beaverton.ibm.com [9.47.17.68]) by northrelay04.pok.ibm.com (8.12.3/NCO/VER6.4) with ESMTP id g94NFIO1058460 for ; Fri, 4 Oct 2002 19:15:19 -0400 Received: (from janis@localhost) by dyn9-47-17-68.beaverton.ibm.com (8.9.3/8.9.3) id QAA18477 for gcc@gcc.gnu.org; Fri, 4 Oct 2002 16:17:07 -0700 Date: Fri, 04 Oct 2002 17:02:00 -0000 From: Janis Johnson To: gcc@gcc.gnu.org Subject: C++ ABI change since 3.2 with no warning Message-ID: <20021004161706.A17403@us.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i X-SW-Source: 2002-10/txt/msg00313.txt.bz2 While working on C++ compatibility tests I broke up g++.dg/init/empty1.C into this set of source files. This test passes when everything is built with either GCC 3.2 or with the mainline but fails when empty1_x.C is compiled with GCC 3.2 and the rest is built with the mainline. The original test is for a PR that was fixed in 3.0.2. The failure is due to a change in alignment. Is this expected? Should it get a warning with -Wabi for having changed since GCC 3.2? Janis --- empty1.h ----------------------------------------------------------- class EmptyBase0 {}; class EmptyBase1 : public EmptyBase0 {}; class Base1 { public: unsigned int t_; Base1(unsigned int); }; class PEPE : public Base1, public EmptyBase1 { public: PEPE(unsigned int); }; --- empty1_main.C ------------------------------------------------------ // Copyright (C) 2001 Free Software Foundation, Inc. // Contributed by Nathan Sidwell 3 Sept 2001 // Split into pieces for binary compatibility testing October 2002 // Bug 4203. We were bit copying empty bases including the // padding. Which clobbers whatever they overlay. extern void empty1_x (void); int main () { empty1_x (); } --- empty1_x.C --------------------------------------------------------- extern "C" void abort (void); #include "empty1.h" void empty1_x () { PEPE pepe(0xff); if (pepe.t_ != 255) abort (); } --- empty1_y.C --------------------------------------------------------- #include "empty1.h" Base1::Base1(unsigned int t) : t_(t) {} PEPE::PEPE(unsigned int t) : Base1(t), EmptyBase1(EmptyBase1()) {} ------------------------------------------------------------------------