This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


#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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]