This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug go/60406] recover.go: test13reflect2 test failure
- From: "ubizjak at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 07 Aug 2014 10:34:50 +0000
- Subject: [Bug go/60406] recover.go: test13reflect2 test failure
- Auto-submitted: auto-generated
- References: <bug-60406-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60406
--- Comment #4 from UroÅ Bizjak <ubizjak at gmail dot com> ---
Alternatively, since __go_set_defer_retaddr always returns 0, we can prevent
split of the label by enclosing it in asm volatiles:
extern int foo (void *);
extern void bar (void);
int test_1 (void)
{
__label__ bla1;
if (foo (&&bla1))
goto bla1;
asm volatile ("");
bar ();
bla1:
asm volatile ("");
return 0;
}
test_1:
subl $28, %esp
movl $.L2, (%esp)
call foo
testl %eax, %eax
jne .L2
call bar
.L2:
xorl %eax, %eax
addl $28, %esp
ret
'goto label' can also be substituted with 'asm goto ("" :::: label)', but I
don't think this is necessary in the above case.