extern int printf(const char *, ...);
void testL(long long Arg) {
  printf("%lld\n", Arg / (1LL << 4));
}
int main() {
  unsigned long B53 = - (1LL << 53);
  testL(B53 + 65);
  return 0;
}

GCC 3.4.2 miscompiles this when compiling with -m32 on Sparc.  It should print
4, instead it prints -562949953421307.  :(

-Chris


-- 
           Summary: Trivial code miscompilation on 32-bit Sparc
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: sabre at nondot dot org


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

Reply via email to