[Bug fortran/28484] system_clock with real-type count_rate does not compile
--- Comment #10 from dfranke at gcc dot gnu dot org 2007-12-13 19:14 --- (In reply to comment #9) Any news on this ? Bad ones. Lost track due to real-life interference. Unassigning myself for now. -- dfranke at gcc dot gnu dot org changed: What|Removed |Added AssignedTo|dfranke at gcc dot gnu dot |unassigned at gcc dot gnu |org |dot org Status|ASSIGNED|NEW http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28484
[Bug fortran/28484] system_clock with real-type count_rate does not compile
--- Comment #9 from jv244 at cam dot ac dot uk 2007-10-26 07:32 --- (In reply to comment #8) Taking over. Any news on this ? -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28484
[Bug fortran/28484] system_clock with real-type count_rate does not compile
--- Comment #8 from dfranke at gcc dot gnu dot org 2007-05-29 20:44 --- Taking over. -- dfranke at gcc dot gnu dot org changed: What|Removed |Added AssignedTo|unassigned at gcc dot gnu |dfranke at gcc dot gnu dot |dot org |org Status|NEW |ASSIGNED Last reconfirmed|2007-05-22 16:16:25 |2007-05-29 20:44:46 date|| http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28484
[Bug fortran/28484] system_clock with real-type count_rate does not compile
--- Comment #7 from burnus at gcc dot gnu dot org 2007-05-22 16:16 --- Won't work on it for a while. -- burnus at gcc dot gnu dot org changed: What|Removed |Added Last reconfirmed|2006-10-28 22:13:07 |2007-05-22 16:16:25 date|| http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28484
[Bug fortran/28484] system_clock with real-type count_rate does not compile
-- burnus at gcc dot gnu dot org changed: What|Removed |Added AssignedTo|burnus at gcc dot gnu dot |unassigned at gcc dot gnu |org |dot org Status|ASSIGNED|NEW http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28484
[Bug fortran/28484] system_clock with real-type count_rate does not compile
--- Comment #5 from burnus at gcc dot gnu dot org 2006-11-02 16:02 --- Created an attachment (id=12535) -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=12535action=view) Idea how libgfortran/intrinsic/system_clock.c could look like Some bits of thought. Methods obtaining the time: * clock_gettime() [POSIX] 10^-9s (nanosecond) resolution, options: CLOCK_REALTIME - on unix time since the epoch [I would suggested this] CLOCK_MONOTONIC - survives even changing the time, but starting point is arbitrary See also PR 15516 for assembler calling sequences for Linux * gettimeofday (tv, NULL) [POSIX] 10^-6s (microsecond) resolution * time() [POSIX] second resolution Resolution - time able to be represented - For huge(i4) = 2147483647 1000 ms:68 years 100 ms: 2485 days 10 ms: 246 days 1 ms:25 days 100 us:60 hours 10 us: 6 hours = 10 ms seems to be a good resolution, 25 days might be a bit short for some calculation jobs, but 250 days should be enough. For huge(i8) = 9223372036854775807 1 s: 2e11 years 1 ms: 2e8 years 1 us: 292271years 1 ns:292years = 1 ns seems to be ok I'm thinking of the following library implementation: Only do integer(8) as this seems to be enough. (See attachment.) For iresolve.c one needs to do something like the following (pseudo code): if(count != NULL counts.type != 8) gfc_convert_type() if(count != NULL count_max.type != 8) gfc_convert_type() if(count != NULL count_rate.type != 8) gfc_convert_type() c-resolved_sym = gfc_get_intrinsic_sub_symbol (system_clock) if (count != NULL count.type == 4) count = (int4) ((count8/1000) % GFC_INTEGER_4_HUGE) else if (count != NULL count.type != 8) count = (type) count8 if (count_rate != NULL count_rate.type == 4) add_expression(if(count_rate8 == 0) count_rate = 0 else count_rate = 100) else if (count != NULL count.type != 8) count_rate = (type) count_rate8 if (count_max != NULL count_max.type == 4) add_expression(if(count_max8 == 0) count_max = 0 else count_max = GFC_INTEGER_4_HUGE) else if (count != NULL count.type != 8) count_rate = (type) count_rate8 -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28484
[Bug fortran/28484] system_clock with real-type count_rate does not compile
--- Comment #6 from burnus at gcc dot gnu dot org 2006-11-02 16:32 --- Created an attachment (id=12536) -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=12536action=view) Revised idea how libgfortran/intrinsic/system_clock.c could look like The latter part is of cause not completely right if count_rate = 1 or 100, and for an error int16 and real counts didn't contain -huge(). Maybe having in the library a system_clock_4 version makes life easier. The following pseudocode should then work with system_clock_4 and system_clock_8 (which has also the advantage that we don't modify the library which is nice in terms of compatibility :-) if ( (counts != NULL counts.type == 4) ||(count_max != NULL count_max.type == 4) { if(count != NULL counts.type != 4) gfc_convert_type() if(count != NULL count_max.type != 4) gfc_convert_type() if(count != NULL count_rate.type != 4) gfc_convert_type() c-resolved_sym = gfc_get_intrinsic_sub_symbol (system_clock_4) if (counts != NULL counts.type != 4) add_expression(if(counts4 0) counts = -huge_max(type) else counts = (type) counts4) if (count_rate != NULL count_rate.type != 4) count_rate = (type) count_rate4 if (count_max != NULL count_max.type != 4) count_rate = (type) count_rate4 } else { if(count != NULL counts.type != 8) gfc_convert_type() if(count != NULL count_max.type != 8) gfc_convert_type() if(count != NULL count_rate.type != 8) gfc_convert_type() c-resolved_sym = gfc_get_intrinsic_sub_symbol (system_clock_8) if (counts != NULL counts.type != 8) add_expression(if(counts8 0) counts = -huge_max(type) else counts = (type) counts8) if (count_rate != NULL count_rate.type != 8) count_rate = (type) count_rate8 if (count_max != NULL count_max.type != 8) count_rate = (type) count_rate8 } Now I only have to figure out how to add the conversion and the if(counts8 0) expression in iresolve.c. -- burnus at gcc dot gnu dot org changed: What|Removed |Added Attachment #12535|0 |1 is obsolete|| http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28484
[Bug fortran/28484] system_clock with real-type count_rate does not compile
--- Comment #3 from patchapp at dberlin dot org 2006-10-28 16:39 --- Subject: Bug number PR28484 A patch for this bug has been added to the patch tracker. The mailing list url for the patch is http://gcc.gnu.org/ml/gcc-patches/2006-10/msg01387.html -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28484
[Bug fortran/28484] system_clock with real-type count_rate does not compile
--- Comment #4 from burnus at gcc dot gnu dot org 2006-10-28 22:13 --- Assign. Preliminary patch at: http://gcc.gnu.org/ml/gcc-patches/2006-10/msg01387.html -- burnus at gcc dot gnu dot org changed: What|Removed |Added AssignedTo|unassigned at gcc dot gnu |burnus at gcc dot gnu dot |dot org |org Status|NEW |ASSIGNED Last reconfirmed|2006-09-03 06:10:52 |2006-10-28 22:13:07 date|| http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28484
[Bug fortran/28484] system_clock with real-type count_rate does not compile
--- Comment #2 from pinskia at gcc dot gnu dot org 2006-09-03 06:10 --- Confirmed. -- pinskia at gcc dot gnu dot org changed: What|Removed |Added OtherBugsDependingO||20585 nThis|| Status|UNCONFIRMED |NEW Ever Confirmed|0 |1 Last reconfirmed|-00-00 00:00:00 |2006-09-03 06:10:52 date|| http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28484
[Bug fortran/28484] system_clock with real-type count_rate does not compile
--- Comment #1 from kargl at gcc dot gnu dot org 2006-07-25 20:22 --- gfortran is primarily a Fortran 95 with a few Fortran 2003 enhancements. -- kargl at gcc dot gnu dot org changed: What|Removed |Added CC||kargl at gcc dot gnu dot org Severity|normal |enhancement http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28484