This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Patch, libfortran] Use high resolution clock if available, timing cleanup
- From: Hans-Peter Nilsson <hp at bitrange dot com>
- To: Janne Blomqvist <blomqvist dot janne at gmail dot com>
- Cc: Fortran List <fortran at gcc dot gnu dot org>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 31 Jan 2011 21:38:38 -0500 (EST)
- Subject: Re: [Patch, libfortran] Use high resolution clock if available, timing cleanup
- References: <AANLkTikNqhqPaeAYdf4nac_NrGEGBFvYpEpcJRx=o3UK@mail.gmail.com>
On Mon, 31 Jan 2011, Janne Blomqvist wrote:
> the attached patch
>
> 1) Does some cleanup for CPU timing functions.
>
> 2) Uses clock_gettime() if available, and if so in particular:
> 2a) enables up to nanosecond resolution for system_clock_8.
> 2b) SYSTEM_CLOCK uses the monotonic clock, if available, which
> is a better choice for a wallclock timing function.
3) Uses errno without including errno.h (or the equivalent
action), breaking build on some targets.
For cris-elf (or presumably any newlib-based target) cutnpasted:
libtool: compile:
/tmp/hpautotest-gcc1/cris-elf/gccobj/./gcc/xgcc
-B/tmp/hpautotest-gcc1/cris-elf/gccobj/./gcc/ -nostdinc
-B/tmp/hpautotest-gcc1/cris-elf/gccobj/cris-elf/newlib/ -isystem
/tmp/hpautotest-gcc1/cris-elf/gccobj/cris-elf/newlib/targ-include
-isystem /tmp/hpautotest-gcc1/gcc/newlib/libc/include
-B/tmp/hpautotest-gcc1/cris-elf/gccobj/cris-elf/libgloss/cris
-L/tmp/hpautotest-gcc1/cris-elf/gccobj/cris-elf/libgloss/libnosys
-L/tmp/hpautotest-gcc1/gcc/libgloss/cris
-B/tmp/hpautotest-gcc1/cris-elf/pre/cris-elf/bin/
-B/tmp/hpautotest-gcc1/cris-elf/pre/cris-elf/lib/ -isystem
/tmp/hpautotest-gcc1/cris-elf/pre/cris-elf/include -isystem
/tmp/hpautotest-gcc1/cris-elf/pre/cris-elf/sys-include
-DHAVE_CONFIG_H -I. -I/tmp/hpautotest-gcc1/gcc/libgfortran
-iquote/tmp/hpautotest-gcc1/gcc/libgfortran/io
-I/tmp/hpautotest-gcc1/gcc/libgfortran/../gcc
-I/tmp/hpautotest-gcc1/gcc/libgfortran/../gcc/config
-I../.././gcc -D_GNU_SOURCE -std=gnu99 -Wall -Wstrict-prototypes
-Wmissing-prototypes -Wold-style-definition -Wextra
-Wwrite-strings -fcx-fortran-rules -ffunction-sections
-fdata-sections -g -O2 -MT cpu_time.lo -MD -MP -MF
.deps/cpu_time.Tpo -c
/tmp/hpautotest-gcc1/gcc/libgfortran/intrinsics/cpu_time.c -o
cpu_time.o
In file included from
/tmp/hpautotest-gcc1/gcc/libgfortran/intrinsics/cpu_time.c:26:0:
/tmp/hpautotest-gcc1/gcc/libgfortran/intrinsics/time_1.h: In
function 'gf_cputime':
/tmp/hpautotest-gcc1/gcc/libgfortran/intrinsics/time_1.h:158:32:
error: 'errno' undeclared (first use in this function)
/tmp/hpautotest-gcc1/gcc/libgfortran/intrinsics/time_1.h:158:32:
note: each undeclared identifier is reported only once for each
function it appears in
make[3]: *** [cpu_time.lo] Error 1
make[3]: Leaving directory
`/tmp/hpautotest-gcc1/cris-elf/gccobj/cris-elf/libgfortran'
make[2]: *** [all] Error 2
brgds, H-P