This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] __volatile__ needed in get_cycles()?
- To: Mike Galbraith <mikeg at weiden dot de>
- Subject: Re: [patch] __volatile__ needed in get_cycles()?
- From: Jeffrey A Law <law at cygnus dot com>
- Date: Fri, 09 Apr 1999 01:19:42 -0600
- cc: Andrea Arcangeli <andrea at e-mind dot com>, Tigran Aivazian <tigran at sco dot COM>, Richard Henderson <rth at twiddle dot net>, linux-kernel at vger dot rutgers dot edu, Horst von Brand <vonbrand at inf dot utfsm dot cl>, egcs-bugs at cygnus dot com
- Reply-To: law at cygnus dot com
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 :)
[ ... ]
As I mentioned earlier, cse decided the two rdtsc asms computed the same
value and eliminated the redundant computation. This behavior from CSE is
incorrect since the two rdtsc asms were separated by one or more volatile
asms.
It turns out that reload_cse has the same bug.
I just checked in a fix for this bug into the egcs development sources to
fix both instances of this bug.
Thanks,
jeff