All of lore.kernel.org
 help / color / mirror / Atom feed
* no-op delay loops
@ 2015-11-27  8:53 Rasmus Villemoes
  2015-11-27  9:04 ` yalin wang
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Rasmus Villemoes @ 2015-11-27  8:53 UTC (permalink / raw)
  To: Ralf Baechle; +Cc: linux-mips, linux-kernel

Hi,

It seems that gcc happily compiles

for (i = 0; i < 1000000000; ++i) ;

into simply

i = 1000000000;

(which is then usually eliminated as a dead store). At least at -O2, and
when i is not declared volatile. So it would seem that the loops at

arch/mips/pci/pci-rt2880.c:235
arch/mips/pmcs-msp71xx/msp_setup.c:80
arch/mips/sni/reset.c:35

actually don't do anything. (In the middle one, i is 'register', but
that doesn't change anything.) Is mips compiled with some special flags
that would make gcc actually emit code for the above?

Rasmus

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

end of thread, other threads:[~2015-12-01 15:32 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-27  8:53 no-op delay loops Rasmus Villemoes
2015-11-27  9:04 ` yalin wang
2015-11-27  9:25   ` Andy Shevchenko
2015-11-27 11:17 ` Arnd Bergmann
2015-11-30 21:29   ` Rasmus Villemoes
2015-11-30 21:44     ` Arnd Bergmann
2015-12-01  1:25     ` Ralf Baechle
2015-12-01 15:31     ` Richard Henderson
2015-11-27 11:20 ` Ralf Baechle

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.