This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug rtl-optimization/51447] [4.4/4.5/4.6/4.7 Regression] global register variable definition incorrectly removed as dead code
- From: "jakub at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 07 Dec 2011 14:06:41 +0000
- Subject: [Bug rtl-optimization/51447] [4.4/4.5/4.6/4.7 Regression] global register variable definition incorrectly removed as dead code
- Auto-submitted: auto-generated
- References: <bug-51447-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51447
--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-12-07 14:06:41 UTC ---
I think goto ptr can't be nonlocal, so that testcase indeed would be invalid.
register void *ptr asm ("rbx");
int
foo (void)
{
__label__ nonlocal_lab;
__attribute__((noinline, noclone)) void
bar (void *func)
{
ptr = func;
goto nonlocal_lab;
}
bar (&&nonlocal_lab);
return 1;
nonlocal_lab:
return ptr != &&nonlocal_lab;
}
ought to be valid though, this is normal non-local goto.