This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: [patch] __volatile__ needed in get_cycles()?



  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




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]