[Bug fortran/64432] [5 Regression] SYSTEM_CLOCK(COUNT_RATE=rate) wrong result for integer(4)::rate

fxcoudert at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Sun Jan 4 22:04:00 GMT 2015


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64432

--- Comment #12 from Francois-Xavier Coudert <fxcoudert at gcc dot gnu.org> ---
(In reply to Harald Anlauf from comment #10)
> Partial patch to handle proposed behavior of system_clock

Thanks for the partial patch. Some quick critique:
  - it doesn't handle mixed argument kinds (you said you don't care, but others
might)
  - it creates multiple calls to the library (performance issue, especially on
a timing routine)
  - I disagree with the logic for COUNT_RATE: we don't care what kind it is,
because any "decent" kind (32-bit int, 64-bit int, or any real kind) is large
enough to store the value.

We've got to define an implementation that works for everyone, and for all
corner cases. Then we can implement it. I've indicated on comp.lang.fortran
what I think is the best strategy:

  a) if any integer kind is 1 or 2, we emit a warning at compile-time and
behave as if no clock is available
  b) for COUNT_RATE, we treat a real as a "wide" int (64-bit or more)
  c) if the kinds of present arguments don't match, issue a compile-time
warning
  d) if all present args are wide, go for high-res, otherwise go for low-res.

How does that sound?


I will have some time to deal with this in a week.



More information about the Gcc-bugs mailing list