From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10936 invoked by alias); 2 Mar 2003 22:46:01 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 10914 invoked by uid 71); 2 Mar 2003 22:46:01 -0000 Resent-Date: 2 Mar 2003 22:46:01 -0000 Resent-Message-ID: <20030302224601.10913.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, kfoltman@onet.pl Received: (qmail 8856 invoked by uid 48); 2 Mar 2003 22:36:44 -0000 Message-Id: <20030302223644.8855.qmail@sources.redhat.com> Date: Sun, 02 Mar 2003 22:46:00 -0000 From: kfoltman@onet.pl Reply-To: kfoltman@onet.pl To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version: gnatsweb-2.9.3 (1.1.1.1.2.31) Subject: target/9908: wrong code generated for virtual method call (gas bug?) X-SW-Source: 2003-03/txt/msg00055.txt.bz2 List-Id: >Number: 9908 >Category: target >Synopsis: wrong code generated for virtual method call (gas bug?) >Confidential: no >Severity: critical >Priority: medium >Responsible: unassigned >State: open >Class: wrong-code >Submitter-Id: net >Arrival-Date: Sun Mar 02 22:46:01 UTC 2003 >Closed-Date: >Last-Modified: >Originator: Krzysztof Foltman >Release: gcc-3.2.2 >Organization: >Environment: Debian-x86, mingw - both give same effect >Description: Wrong call type is generated in -masm=intel mode. I'm not sure, but it looks like the .S file contains correct call (call dword ptr label+8), but it's assembled as near jump (E8 08 00 00 00) instead of indirect jump (FF 15 08 00 00 00). Checked by compiling both AT&T and Intel versions with -S, assembling with as and unassembling with ndisasmw. >How-To-Repeat: ========== cut ======================= struct B { virtual int foo() { } }; void check(void *pV) { ((B *)pV)->foo(); } int main(int argc, char *argv) { B b; check((B *)&b); } ========== cut ======================= # gcc-3.2 -O3 -masm=att -o inh inh.cpp -l stdc++ && ./inh (this works) # gcc-3.2 -O3 -masm=intel -o inh inh.cpp -l stdc++ && ./inh (this segfaults) 100% repeatable both on mingw and debian gcc-3.2 >Fix: >Release-Note: >Audit-Trail: >Unformatted: