From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7490 invoked by alias); 2 Jun 2004 20:25:11 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 7479 invoked by uid 48); 2 Jun 2004 20:25:10 -0000 Date: Wed, 02 Jun 2004 20:25:00 -0000 From: "peter at the-baradas dot com" To: gcc-bugs@gcc.gnu.org Message-ID: <20040602202507.15782.peter@the-baradas.com> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug target/15782] New: m68k_output_mi_thunk emits wrong code for ColdFire X-Bugzilla-Reason: CC X-SW-Source: 2004-06/txt/msg00250.txt.bz2 List-Id: m68k_output_mi_thunk generats an adjustment of the first parameter on the stack and calls off to the target function. This adjustment is done using addq/subq for values in the range of 1-8, but fo values outside that range, it generates 'add.l #,4(%sp)' which is valid for m68k, but invalid for ColdFire. The suggested fix for ColdFire is to load the value into %d0, and *then* emit 'add.l %d0,4(%sp)'. The following code triggers this bug when compiled with: m68k-elf-g++ -m5307 -O class FooA { public: virtual ~FooA () = 0; int data[100]; }; class FooB { public: virtual void foo1 () = 0; void fooB () {foo1 ();} int data[100]; }; class FooC : public FooA, public FooB { public: virtual void foo1 () {} }; FooC* Test () { FooC* foc = new FooC; foc->fooB (); } -- Summary: m68k_output_mi_thunk emits wrong code for ColdFire Product: gcc Version: 3.4.0 Status: UNCONFIRMED Severity: normal Priority: P2 Component: target AssignedTo: bernie at develer dot com ReportedBy: peter at the-baradas dot com CC: gcc-bugs at gcc dot gnu dot org,peter at the-baradas dot com GCC target triplet: m68k-elf http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15782