public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "marcus at jet dot franken dot de" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c/31628] New: stdcall function is miscompiled Date: Wed, 18 Apr 2007 18:44:00 -0000 [thread overview] Message-ID: <bug-31628-3760@http.gcc.gnu.org/bugzilla/> (raw) Testcase is extracted from Wine. /home/marcus/projects/gcc/BIN/bin/gcc -m32 -fPIC -O2 -o reg reg.i ./reg Segmentation fault (I did not try the i586 version of the compiler.) Looking at the disassembly the stdcall function is compiled as: foo: pushl %ebp movl %esp, %ebp pushl %ebx call __i686.get_pc_thunk.bx addl $_GLOBAL_OFFSET_TABLE_, %ebx subl $4, %esp movl $0, (%esp) call bar@PLT addl $4, %esp popl %ebx popl %ebp ret It does adjust the stackframe after the call to bar wrongly, either it should not do it, or just emit a "leave". -- Summary: stdcall function is miscompiled Product: gcc Version: 4.3.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: marcus at jet dot franken dot de GCC build triplet: x86_64-unknown-linux-gnu GCC host triplet: x86_64-unknown-linux-gnu GCC target triplet: i586-unknown-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31628
next reply other threads:[~2007-04-18 18:44 UTC|newest] Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top 2007-04-18 18:44 marcus at jet dot franken dot de [this message] 2007-04-18 18:44 ` [Bug c/31628] " marcus at jet dot franken dot de 2007-04-18 18:46 ` marcus at jet dot franken dot de 2007-04-18 18:46 ` marcus at jet dot franken dot de 2007-04-18 19:16 ` [Bug target/31628] " rguenth at gcc dot gnu dot org 2007-04-18 21:14 ` rth at gcc dot gnu dot org 2007-04-20 23:54 ` rth at gcc dot gnu dot org 2007-04-20 23:58 ` rth at gcc dot gnu dot org 2007-05-18 19:30 ` hjl at gcc dot gnu dot org 2007-05-26 3:10 ` pinskia at gcc dot gnu dot org
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=bug-31628-3760@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@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).