public inbox for gcc-prs@sourceware.org help / color / mirror / Atom feed
From: kfoltman@onet.pl To: gcc-gnats@gcc.gnu.org Subject: target/9908: wrong code generated for virtual method call (gas bug?) Date: Sun, 02 Mar 2003 22:46:00 -0000 [thread overview] Message-ID: <20030302223644.8855.qmail@sources.redhat.com> (raw) >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:
reply other threads:[~2003-03-02 22:46 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20030302223644.8855.qmail@sources.redhat.com \ --to=kfoltman@onet.pl \ --cc=gcc-gnats@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).