[Bug tree-optimization/17739] New: tree-optimizers extend the lifetime of a hard register variable

rth at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Wed Sep 29 21:26:00 GMT 2004


#define REGISTER "0"
 
static inline int source(void)
{
  register int hardreg __asm__(REGISTER);
  asm("" : "=r"(hardreg));
  return hardreg;
}
 
void test(void)
{
  int t = source();
  foo(t);
  bar(t);
}

Optimization should not turn "bar(t_4)" into "bar(hardreg)",
since the hard register gets clobbered by foo.

This test case is reduced from java/lang/natObject.cc affecting Alpha.

-- 
           Summary: tree-optimizers extend the lifetime of a hard register
                    variable
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P2
         Component: tree-optimization
        AssignedTo: rth at gcc dot gnu dot org
        ReportedBy: rth at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org


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



More information about the Gcc-bugs mailing list