lkml.org 
[lkml]   [1999]   [Mar]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [patch] __volatile__ needed in get_cycles()?
Date
From

In message <Pine.LNX.4.02A.9903312009540.353-100000@mikeg.weiden.de>you write
> It's not off-topic, compiler technicalities are very important in the
> kernel. As to it being optimized away.. it didn't. I think that your
> initial look was dead center.. the second rdtsc was combined with the
> first, which is a lot different from throwing it away. (I would find
> it easy to view combination of two rdtsc insns as a bug tho, given the
> purpose of that insn :)
Two asms with idential asm-strings and the same inputs/clobbers can be
cse'd by the compiler.

Given two asms with the same output, the first may be deleted if the value
it computes is not used before the second asm (traditional dead code
elimination).


In the example provided, it is cse, not combine that (in my opinion)
incorrectly eliminated one of the rdtsc asms (the volatile asms between
the rdtsc asms should have prevented cse from doing that).

You can see this by running the compiler with the "-dap" option, then
examining the .jump file, then examining the .cse file.

This (IMHO) is a compiler bug.
Jeff

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:51    [W:0.054 / U:0.788 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site