Re: undefined reference to __udivdi3 (gcc-4.3)

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Robert Hancock <hancockr@...>
Cc: Christian Kujau <lists@...>, LKML <linux-kernel@...>
Date: Sunday, May 4, 2008 - 6:19 pm

> I assume it's one or both of these loops in arch/x86/xen/time.c 

That looks plausible.


I think you refer to 38332cb9, "time: prevent the loop in
timespec_add_ns() from being optimised away".


         while(unlikely(ns >= NSEC_PER_SEC)) {
+               /* The following asm() prevents the compiler from
+                * optimising this loop into a modulo operation.  */
+               asm("" : "+r"(ns));
+
                 ns -= NSEC_PER_SEC;
                 a->tv_sec++;
         }



It should be.  The asm() arg tells GCC that the asm() could modify
"ns" in some way, so GCC cannot optimise away the loop, since it
doesn't have the required info about the induction variable to do
that.


Segher

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: undefined reference to __udivdi3 (gcc-4.3), Robert Hancock, (Sun May 4, 1:35 pm)
Re: undefined reference to __udivdi3 (gcc-4.3), Segher Boessenkool, (Sun May 4, 6:19 pm)
Re: undefined reference to __udivdi3 (gcc-4.3), Jeremy Fitzhardinge, (Wed May 7, 5:29 am)
[PATCH] common implementation of iterative div/mod, Jeremy Fitzhardinge, (Thu May 8, 11:16 am)
Re: [PATCH] common implementation of iterative div/mod, Segher Boessenkool, (Thu May 8, 4:52 pm)
Re: [PATCH] common implementation of iterative div/mod, Jeremy Fitzhardinge, (Thu May 8, 5:57 pm)
Re: [PATCH] common implementation of iterative div/mod, Christian Kujau, (Fri May 9, 7:45 am)
Re: [PATCH] common implementation of iterative div/mod, Andrew Morton, (Wed May 14, 2:46 am)
Re: [PATCH] common implementation of iterative div/mod, Jeremy Fitzhardinge, (Wed May 14, 3:33 am)
Re: [PATCH] common implementation of iterative div/mod, Jeremy Fitzhardinge, (Wed May 14, 5:55 am)
Re: [PATCH] common implementation of iterative div/mod, Jeremy Fitzhardinge, (Wed May 14, 6:52 am)
Re: [PATCH] common implementation of iterative div/mod, Jeremy Fitzhardinge, (Wed May 14, 8:58 am)
Re: [PATCH] common implementation of iterative div/mod, Andrew Morton, (Thu May 8, 4:26 pm)
Re: [PATCH] common implementation of iterative div/mod, Jeremy Fitzhardinge, (Thu May 8, 6:00 pm)