public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/51447] New: global register variable definition incorrectly removed as dead code
@ 2011-12-07  7:26 pitchumani.s at atmel dot com
  2011-12-07 12:43 ` [Bug rtl-optimization/51447] " rguenth at gcc dot gnu.org
                   ` (22 more replies)
  0 siblings, 23 replies; 24+ messages in thread
From: pitchumani.s at atmel dot com @ 2011-12-07  7:26 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51447

             Bug #: 51447
           Summary: global register variable definition incorrectly
                    removed as dead code
    Classification: Unclassified
           Product: gcc
           Version: 4.6.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: pitchumani.s@atmel.com


Global register variable assignment(ptr = func) in the test case below seem to
be removed as dead code during CSE. As per the gcc manual, global register
variable should not be removed even if it appears to be dead. 

http://gcc.gnu.org/onlinedocs/gcc/Global-Reg-Vars.html

Discussion in gcc mailing list:
http://gcc.gnu.org/ml/gcc-help/2011-12/msg00057.html


Test case:

register void *ptr asm("rbx") ;

void testfn1(void* func)
{
  ptr = func;
  goto *(ptr);
}

Options: -S -O1

-- snip of assembly generated --
        .globl  testfn1
        .type   testfn1, @function
testfn1:
.LFB0:
        jmp     *%rdi
.LFE0:
        .size   testfn1, .-testfn1
-- snip end --


^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2020-06-10 20:58 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-12-07  7:26 [Bug c/51447] New: global register variable definition incorrectly removed as dead code pitchumani.s at atmel dot com
2011-12-07 12:43 ` [Bug rtl-optimization/51447] " rguenth at gcc dot gnu.org
2011-12-07 12:57 ` [Bug rtl-optimization/51447] [4.4/4.5/4.6/4.7 Regression] " jakub at gcc dot gnu.org
2011-12-07 13:11 ` jakub at gcc dot gnu.org
2011-12-07 13:49 ` bonzini at gnu dot org
2011-12-07 14:04 ` bonzini at gnu dot org
2011-12-07 14:07 ` jakub at gcc dot gnu.org
2011-12-15 11:45 ` jakub at gcc dot gnu.org
2011-12-15 12:09 ` bonzini at gnu dot org
2011-12-16  8:35 ` jakub at gcc dot gnu.org
2012-01-20  8:11 ` abel at gcc dot gnu.org
2012-03-13 12:48 ` [Bug rtl-optimization/51447] [4.5/4.6/4.7/4.8 " jakub at gcc dot gnu.org
2012-07-02 10:58 ` rguenth at gcc dot gnu.org
2012-11-11 22:05 ` [Bug rtl-optimization/51447] [4.6/4.7/4.8 " steven at gcc dot gnu.org
2012-11-11 22:12 ` steven at gcc dot gnu.org
2012-11-12 20:22 ` steven at gcc dot gnu.org
2012-11-12 20:23 ` [Bug rtl-optimization/51447] [4.6/4.7 " steven at gcc dot gnu.org
2013-01-20 22:18 ` howarth at nitro dot med.uc.edu
2013-01-21 14:53 ` howarth at nitro dot med.uc.edu
2013-04-12 15:15 ` [Bug rtl-optimization/51447] [4.7 " jakub at gcc dot gnu.org
2013-09-10  7:45 ` matthijs at stdin dot nl
2013-09-10  7:52 ` jakub at gcc dot gnu.org
2014-06-12 13:03 ` rguenth at gcc dot gnu.org
2020-06-10 20:58 ` cvs-commit at gcc dot gnu.org

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).