public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "slyfox at inbox dot ru" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/40718] Invalid code produced with -foptimize-sibling-calls
Date: Sun, 23 Aug 2009 11:12:00 -0000 [thread overview]
Message-ID: <20090823111219.8438.qmail@sourceware.org> (raw)
In-Reply-To: <bug-40718-16926@http.gcc.gnu.org/bugzilla/>
------- Comment #8 from slyfox at inbox dot ru 2009-08-23 11:12 -------
(In reply to comment #7)
> Subject: Bug 40718
>
> Author: uros
> Date: Sun Aug 23 09:46:00 2009
> New Revision: 151028
>
> URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=151028
> Log:
> PR target/40718
> * config/i386/i386.c (*call_pop_1): Disable for sibling calls.
> (*sibcall_pop_1): New insn pattern.
>
> testsuite/ChangeLog:
>
> PR target/40718
> * gcc.target/i386/pr40718.c: New test.
>
>
> Added:
> trunk/gcc/testsuite/gcc.target/i386/pr40718.c
> Modified:
> trunk/gcc/ChangeLog
> trunk/gcc/config/i386/i386.md
> trunk/gcc/testsuite/ChangeLog
>
This patch fixes for me Dmitry's sample, but does not fix mine. Still SIGSEGVs.
I've managed to
place whole testcase in one file:
$ g++ -O1 -foptimize-sibling-calls -m32 -DCALLTYPE="__attribute__((stdcall))"
main.cc -o show_the_bug
$ ./show_the_bug
Segmentation fault
$ cat main.cc
#define CALLTYPE __attribute__((stdcall))
struct Base {
virtual unsigned long CALLTYPE base_do1(unsigned long, unsigned long)
__attribute__((noinline))
{
return 4;
}
};
static Base bi;
Base * glo_ptr_to_base = &bi;
struct Stuff {
void CALLTYPE do_stuff(unsigned long param1, unsigned long param2)
__attribute__((noinline))
{
if (param1 == 0xFFFFFFFE)
{
return;
}
glo_ptr_to_base->base_do1(param1, param2);
}
};
int
main()
{
Stuff o;
o.do_stuff(1, 32);
return 0;
}
-----------------------------------------------
_ZN5Stuff8do_stuffEmm:
.LFB1:
.cfi_startproc
.cfi_personality 0x0,__gxx_personality_v0
pushl %ebp
.cfi_def_cfa_offset 8
movl %esp, %ebp
.cfi_offset 5, -8
.cfi_def_cfa_register 5
pushl %ebx
subl $4, %esp
movl 12(%ebp), %eax
cmpl $-2, %eax
je .L5
.cfi_offset 3, -12
movl glo_ptr_to_base, %edx
movl %edx, 8(%ebp)
movl -4(%ebp), %ebx
leave
jmp *(%ebx)
.L5:
movl -4(%ebp), %ebx
leave
ret $12
.cfi_endproc
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40718
next prev parent reply other threads:[~2009-08-23 11:12 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-11 0:06 [Bug middle-end/40718] New: " d dot g dot gorbachev at gmail dot com
2009-08-22 12:09 ` [Bug middle-end/40718] " slyfox at inbox dot ru
2009-08-22 13:38 ` [Bug target/40718] " ubizjak at gmail dot com
2009-08-22 13:43 ` ubizjak at gmail dot com
2009-08-22 13:51 ` ubizjak at gmail dot com
2009-08-22 18:38 ` slyfox at inbox dot ru
2009-08-23 9:09 ` ubizjak at gmail dot com
2009-08-23 9:46 ` uros at gcc dot gnu dot org
2009-08-23 11:12 ` slyfox at inbox dot ru [this message]
2009-08-23 11:41 ` ubizjak at gmail dot com
2009-08-23 11:58 ` ubizjak at gmail dot com
2009-08-23 12:08 ` ubizjak at gmail dot com
2009-08-23 12:14 ` uros at gcc dot gnu dot org
2009-08-23 12:38 ` uros at gcc dot gnu dot org
2009-08-23 13:04 ` uros at gcc dot gnu dot org
2009-08-23 13:04 ` ubizjak at gmail dot com
2009-08-29 10:26 ` slyfox at inbox dot ru
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=20090823111219.8438.qmail@sourceware.org \
--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: link
Be 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).