Commit Graph

1219 Commits

Author SHA1 Message Date
Tobias Burnus
3215710740 re PR fortran/50815 (ICE on allocation of deferred length character scalar dummy argument when -fbounds-check)
2011-12-08  Tobias Burnus  <burnus@net-b.de>

        PR fortran/50815
        * trans-decl.c (add_argument_checking): Skip bound checking
        for deferred-length strings.

2011-12-08  Tobias Burnus  <burnus@net-b.de>

        PR fortran/50815
        * gfortran.dg/bounds_check_16.f90: New.

From-SVN: r182134
2011-12-08 20:00:55 +01:00
Andreas Tobler
c6084f681e Additional fixes for FreeBSD-10 build:
/:			* libtool.m4: Additional FreeBSD 10 fixes.

boehm-gc/:		* configure: Regenerate.
gcc/:			* configure: Regenerate.
libffi/:		* configure: Regenerate.
libgfortran/:		* configure: Regenerate.
libgomp/:		* configure: Regenerate.
libitm/:		* configure: Regenerate.
libjava/:		* configure.ac: Fix some more FreeBSD 10 issues..
			* configure: Regenerate.
libjava/libltdl/:	* acinclude.m4: Additional FreeBSD 10 fixes.
			* configure: Regenerate.
libmudflap/:		* configure: Regenerate.
libobjc/:		* configure: Regenerate.
libquadmath/:		* configure: Regenerate.
libssp/:		* configure: Regenerate.
libstdc++-v3/:		* configure: Regenerate.
lto-plugin/:		* configure: Regenerate.
zlib/:			* configure: Regenerate.

From-SVN: r181593
2011-11-21 20:22:35 +01:00
Janne Blomqvist
c492b9d035 PR 51090 Fix r181288 to conform to GNU style
From-SVN: r181290
2011-11-11 18:38:11 +02:00
Janne Blomqvist
ee66e604c3 PR 51090 Check that getenv result != NULL before proceeding.
2011-11-11  Janne Blomqvist  <jb@gcc.gnu.org>

	PR libfortran/51090
	* runtime/main.c (find_addr2line): NULL check before proceeding.

From-SVN: r181288
2011-11-11 18:31:47 +02:00
Janne Blomqvist
992b0aa1cf Let the compiler decide whether to inline.
2011-11-10  Janne Blomqvist  <jb@gcc.gnu.org>

	* intrinsics/cpu_time.c (__cpu_time_1): Don't force inlining.
	* intrinsics/random.c (rnumber_4): Remove inline attribute.
	(rnumber_8, rnumber_10, rnumber_16): Likewise.
	* intrinsics/system_clock.c (gf_gettime_mono): Likewise.
	* intrinsics/time_1.h (ATTRIBUTE_ALWAYS_INLINE): Remove macro.
	(gf_cputime): Add inline attribute for MingW version.
	* io/format.c (format_hash): Remove inline attribute.
	* io/io.h (memset4): Inline function from transfer.c and write.c
	moved here.
	* io/transfer.c (min_off): Remove inline attribute.
	(memset4): Move to io.h.
	* io/write.c (memset4): Likewise.
	(memcpy4): Remove inline attribute.
	* io/write_float.def (calculate_exp): Likewise.

From-SVN: r181260
2011-11-10 19:08:24 +02:00
Janne Blomqvist
9f13f69749 Simplify time() usage.
2011-11-09  Janne Blomqvist  <jb@gcc.gnu.org>

	* intrinsics/time_1.h (gf_gettime): Simplify time() usage.

From-SVN: r181228
2011-11-09 20:30:38 +02:00
Janne Blomqvist
7454437875 Configure cleanup.
2011-11-09  Janne Blomqvist  <jb@gcc.gnu.org>

	* configure.ac (AC_STDC_HEADERS): Remove.
	(AC_HEADER_TIME): Remove.
	(AC_HAVE_HEADERS, AC_CHECK_HEADERS): Move into a single invocation
	of AC_CHECK_HEADERS_ONCE, don't check for presence of C89 headers.
	(AC_CHECK_MEMBERS): Use single invocation.
	(AC_CHECK_FUNCS): Move into single invocation of
	AC_CHEC_FUNCS_ONCE, don't check for presence of C89 functions.
	* config.h.in: Regenerate.
	* configure: Regenerate.
	* intrinsics/clock.c: Include time.h.
	(mclock): Assume clock() is present.
	(mclock8): Likewise.
	* intrinsics/ctime.c (strctime): Assume strftime is present.
	(fdate): Assume time() is present.
	(fdate_sub): Likewise.
	(ctime): Likewise.
	* intrinsics/date_and_time.c: Don't provide abs macro.
	(HAVE_NO_DATE_TIME): Remove code related to macro which is never
	set.
	* intrinsics/execute_command_line.c: Assume stdlib.h is present.
	* intrinsics/exit.c: Likewise.
	* intrinsics/extends_type_of.c: Likewise.
	* intrinsics/gerror.c: Assume strerror() is present.
	* intrinsics/kill.c: Assume signal.h is present.
	* intrinsics/malloc.c: Assume stdlib.h is present.
	* intrinsics/move_alloc.c: Likewise.
	* intrinsics/perror.c: Assume perror() is present.
	* intrinsics/signal.c: Assume signal.h is present.
	* intrinsics/stat.c: Assume stdlib.h is present.
	* intrinsics/system.c: Likewise.
	* intrinsics/time.c: Include time.h, assume time() is present.
	* intrinsics/time_1.h: Conditionally include sys/time.h,
	unconditionally time.h.
	(gf_cputime): Do division in double, fallback using clock().
	(gf_gettime): Assume time() is present.
	* intrinsics/umask.c: Assume stdlib.h is present.
	* runtime/backtrace.c: Likewise.
	* runtime/compile_options.c: Assume signal.h is present, assume
	C89 signals are present.
	* runtime/error.c: Assume signal.h and stdlib.h are present.

From-SVN: r181227
2011-11-09 20:25:58 +02:00
Francois-Xavier Coudert
29d281ca3a re PR libfortran/47972 (error.c:158:7: warning: return makes pointer from integer without a cast)
PR libfortran/47972
	* runtime/error.c (gf_strerror): Silence warning.

From-SVN: r181223
2011-11-09 10:09:42 -08:00
Janne Blomqvist
161f270d4e PR 46686 Fix incorrect comment.
2011-11-09  Janne Blomqvist  <jb@gcc.gnu.org>

	PR fortran/46686
	* runtime/backtrace.c (show_backtrace): Fix incorrect comment.

From-SVN: r181217
2011-11-09 19:52:11 +02:00
Tobias Burnus
60858d8a32 configure.ac: Make more cross-compile friendly.
2011-11-09  Tobias Burnus  <burnus@net-b.de>

        * configure.ac: Make more cross-compile friendly.
        * Makefile.in: Regenerate.
        * aclocal.m4: Regenerate.
        * config.h.in: Regenerate.
        * configure: Regenerate.

From-SVN: r181212
2011-11-09 18:17:57 +01:00
Janne Blomqvist
1ff101ff12 PR 46686 Implement backtrace with _Unwind_Backtrace from libgcc.
2011-11-09  Janne Blomqvist  <jb@gcc.gnu.org>

	PR fortran/46686
	* configure.ac: Don't check execinfo.h, backtrace,
	backtrace_symbols_fd. Check execve instead of execvp. Call
	GCC_CHECK_UNWIND_GETIPINFO.
	* runtime/backtrace.c: Don't include unused headers, include
	limits.h and unwind.h.
	(CAN_FORK): Check execve instead of execvp.
	(GLIBC_BACKTRACE): Remove.
	(bt_header): Conform to gdb backtrace format.
	(struct bt_state): New struct.
	(trace_function): New function.
	(show_backtrace): Use _Unwind_Backtrace from libgcc instead of
	glibc backtrace functions.
	* Makefile.in: Regenerated.
	* aclocal.m4: Regenerated.
	* config.h.in: Regenerated.
	* configure: Regenerated.

From-SVN: r181209
2011-11-09 18:04:42 +02:00
Janne Blomqvist
ed10039e8b PR 50016 Slow I/O on MingW due to _commit
frontend ChangeLog:

2011-11-09  Janne Blomqvist  <jb@gcc.gnu.org>

	PR libfortran/50016
	* gfortran.texi (Data consistency and durability): New section.


testsuite ChangeLog:

2011-11-09  Janne Blomqvist  <jb@gcc.gnu.org>

	PR libfortran/50016
	* gfortran.dg/inquire_size.f90: Don't flush the unit.

libgfortran ChangeLog:

2011-11-09  Janne Blomqvist  <jb@gcc.gnu.org>

	PR libfortran/50016
	* io/inquire.c (inquire_via_unit): Flush the unit and use ssize.
	* io/unix.c (buf_flush): Don't call _commit.

From-SVN: r181207
2011-11-09 17:46:15 +02:00
Francois-Xavier Coudert
6ef982714c re PR libfortran/47972 (error.c:158:7: warning: return makes pointer from integer without a cast)
PR libfortran/47972
	* runtime/error.c (gf_strerror): Silence warning.

From-SVN: r181180
2011-11-08 21:58:47 +00:00
Francois-Xavier Coudert
287188ea07 re PR libfortran/47970 (c99_functions.c:611:5: warning: implicit declaration of function 'round')
PR libfortran/47970
	* intrinsics/c99_functions.c (round): Move higher in the file.

From-SVN: r181153
2011-11-08 10:31:04 +00:00
Janne Blomqvist
0948d15384 Revert previous fix for PR 45723.
libgfortran ChangeLog:

2011-11-07  Janne Blomqvist  <jb@gcc.gnu.org>

        PR libfortran/45723
        * io/open.c (new_unit): Don't check file size before attempting
        seek.


testsuite ChangeLog:

2011-11-07  Janne Blomqvist  <jb@gcc.gnu.org>

        PR libfortran/45723
        * gfortran.dg/open_dev_null.F90: Remove testcase.

From-SVN: r181085
2011-11-07 16:32:50 +02:00
Rainer Orth
5d1c8e77cf Move gthr to toplevel libgcc
gcc:
	* gthr-single.h, gthr.h: Move to ../libgcc.
	* gthr-aix.h: Move to ../libgcc/config/rs6000.
	* gthr-dce.h: Move to ../libgcc/config/pa.
	* gthr-lynx.h: Move to ../libgcc/config.
	* gthr-mipssde.h: Move to ../libgcc/config/mips.
	* gthr-posix.h: Move to ../libgcc/config.
	* gthr-rtems.h: Likewise.
	* gthr-tpf.h: Move to ../libgcc/config/s390.
	* gthr-vxworks.h: Move to ../libgcc/config.
	* gthr-win32.h: Move to ../libgcc/config/i386.
	* configure.ac (gthread_flags): Remove
	(gthr-default.h): Don't create.
	(thread_file): Don't substitute.
	* configure: Regenerate.
	* Makefile.in (GCC_THREAD_FILE): Remove.
	(GTHREAD_FLAGS): Remove.
	(libgcc.mvars): Remove GTHREAD_FLAGS.
	* config/t-vxworks (EXTRA_HEADERS): Remove.

	gcc/po:
	* EXCLUDES (gthr-aix.h, gthr-dce.h, gthr-posix.c, gthr-posix.h)
	(gthr-rtems.h, gthr-single.h, gthr-solaris.h, gthr-vxworks.h)
	(gthr-win32.h, gthr.h): Remove.

	libgcc:
	* gthr-single.h, gthr.h: New files.
	* config/gthr-lynx.h, config/gthr-posix.h., config/gthr-rtems.h,
	config/gthr-vxworks.h, config/i386/gthr-win32.h,
	config/mips/gthr-mipssde.h, config/pa/gthr-dce.h,
	config/rs6000/gthr-aix.h, config/s390/gthr-tpf.h: New files.
	* config/i386/gthr-win32.c: Include "gthr-win32.h".
	* configure.ac (thread_header): New variable.
	Set it depending on target_thread_file.
	(gthr-default.h): Link from $thread_header.
	* configure: Regenerate.
	* Makefile.in (LIBGCC2_CFLAGS): Remove $(GTHREAD_FLAGS).

	libgfortran:
	* Makefile.am (AM_CPPFLAGS): Add
	-I$(srcdir)/$(MULTISRCTOP)../libgcc, -I$(MULTIBUILDTOP)../libgcc.
	* Makefile.in: Regenerate.
	* acinclude.m4 (LIBGFOR_CHECK_GTHR_DEFAULT): Remove.
	* configure.ac (LIBGFOR_CHECK_GTHR_DEFAULT): Likewise.
	* configure: Regenerate.
	* config.h.in: Regenerate.

	libobjc:
	* Makefile.in (INCLUDES): Add -I$(MULTIBUILDTOP)../libgcc.
	* configure.ac (target_thread_file, HAVE_GTHR_DEFAULT): Remove.
	* configure: Regenerate.
	* config.h.in: Regenerate.

	libstdc++-v3:
	* acinclude.m4 (GLIBCXX_CONFIGURE): Determine and substitute
	toplevel_builddir.
	(GLIBCXX_ENABLE_THREADS): Remove glibcxx_thread_h,
	HAVE_GTHR_DEFAULT, enable_thread.
	(GLIBCXX_CHECK_GTHREADS): Reflect gthr move to libgcc.
	* include/Makefile.am (thread_host_headers): Remove
	${host_builddir}/gthr-tpf.h.
	(${host_builddir}/gthr.h): Reflect gthr move to libgcc.
	Use $<.
	(${host_builddir}/gthr-single.h): Likewise.
	(${host_builddir}/gthr-posix.h): Likewise.
	(${host_builddir}/gthr-tpf.h): Remove.
	(${host_builddir}/gthr-default.h): Likewise.
	* configure, config.h.in: Regenerate.
	* Makefile.in, doc/Makefile.in, include/Makefile.in,
	libsupc++/Makefile.in, po/Makefile.in, python/Makefile.in,
	src/Makefile.intestsuite/Makefile.in: Regenerate.

From-SVN: r180776
2011-11-02 15:28:43 +00:00
Janne Blomqvist
eb6a1e56e0 Copyright years and whitespace fix for r180734
From-SVN: r180736
2011-11-01 14:03:38 +02:00
Janne Blomqvist
ea5e3c042b Cleanup NEWUNIT allocation.
2011-11-01  Janne Blomqvist  <jb@gcc.gnu.org>

	* io/io.h (next_available_newunit): Remove prototype.
	* io/unit.h (next_available_newunit): Make variable static,
	initialize it.
	(init_units): Don't initialize next_available_newunit.
	(get_unique_unit_number): Use atomic builtin if available.

From-SVN: r180734
2011-11-01 13:44:12 +02:00
Janne Blomqvist
08810e5257 Update file position for inquire lazily.
libgfortran ChangeLog:

2011-10-31  Janne Blomqvist  <jb@gcc.gnu.org>

	* io/inquire.c (inquire_via_unit): Check whether we're at the
	beginning or end if the position is unspecified. If the position
	is not one of the 3 standard ones, return unspecified.
	* io/io.h (update_position): Remove prototype.
	* io/transfer.c (next_record): Set the position to unspecified,
	letting inquire figure it out more exactly when needed.
	* io/unit.c (update_position): Remove function.


testsuite ChangeLog:

2011-10-31  Janne Blomqvist  <jb@gcc.gnu.org>

	* gfortran.dg/inquire_5.f90: Update testcase to match the standard
	and current implementation.

From-SVN: r180703
2011-10-31 16:59:19 +02:00
Janne Blomqvist
3469bd8660 Introduce a size member function to struct stream.
2011-10-31  Janne Blomqvist  <jb@gcc.gnu.org>

	* io/unix.h (struct stream): Add size function pointer.
	(ssize): New inline function.
	(file_length): Remove prototype.
	* io/unix.c (raw_size): New function.
	(raw_init): Initialize st.size pointer.
	(buf_size): New function.
	(buf_init): Initialize st.size pointer.
	(open_internal): Likewise.
	(open_internal4): Likewise.
	(file_length): Remove function.
	* io/file_pos.c (st_rewind): Use ssize instead of file_length.
	* io/open.c (test_endfile): Likewise.
	* io/transfer.c (data_transfer_init): Likewise.
	(next_record_r): Likewise.
	(next_record_w): Likewise.
	* io/unit.c (update_position): Likewise.

From-SVN: r180702
2011-10-31 16:52:26 +02:00
Janne Blomqvist
7d5ee21935 Simplify handling of special files.
2011-10-31  Janne Blomqvist  <jb@gcc.gnu.org>

* io/file_pos.c (st_rewind): Handle regular and special files
identically.
* io/intrinsics.c (fseek_sub): Don't check whether we think the
file is seekable, just do what the caller says.
* io/transfer.c (skip_record): First try to seek, then fallback to
reading and throwing away what we read.
* io/unit.c (update_position): Don't check whether file is
seekable, just try to do what we're told.
(unit_truncate): Likewise.
* io/unix.c (struct unix_stream): Remove special_file flag.
(buf_flush): Remove code for handling unseekable files.
(buf_seek): Likewise.
(fd_to_stream): Use buffered IO only for regular files.
(file_length): Remove is_seekable() call.
(is_seekable): Remove function.
(is_special): Likewise.
* io/unix.h: Remove prototypes for is_seekable and is_special.

From-SVN: r180701
2011-10-31 16:45:50 +02:00
Thomas Koenig
95928a1322 re PR fortran/49479 (reshape / optionals / zero sized arrays)
2011-09-10  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/49479
	* generated/m4/ifunction.m4:  Always call internal_malloc_size
	even when there is a zero-sized return array.
	* generated/generated/maxloc1_16_i16.c: Regenerated.
	* generated/generated/maxloc1_16_i1.c: Regenerated.
	* generated/generated/maxloc1_16_i2.c: Regenerated.
	* generated/generated/maxloc1_16_i4.c: Regenerated.
	* generated/generated/maxloc1_16_i8.c: Regenerated.
	* generated/generated/maxloc1_16_r10.c: Regenerated.
	* generated/generated/maxloc1_16_r16.c: Regenerated.
	* generated/generated/maxloc1_16_r4.c: Regenerated.
	* generated/generated/maxloc1_16_r8.c: Regenerated.
	* generated/generated/maxloc1_4_i16.c: Regenerated.
	* generated/generated/maxloc1_4_i1.c: Regenerated.
	* generated/generated/maxloc1_4_i2.c: Regenerated.
	* generated/generated/maxloc1_4_i4.c: Regenerated.
	* generated/generated/maxloc1_4_i8.c: Regenerated.
	* generated/generated/maxloc1_4_r10.c: Regenerated.
	* generated/generated/maxloc1_4_r16.c: Regenerated.
	* generated/generated/maxloc1_4_r4.c: Regenerated.
	* generated/generated/maxloc1_4_r8.c: Regenerated.
	* generated/generated/maxloc1_8_i16.c: Regenerated.
	* generated/generated/maxloc1_8_i1.c: Regenerated.
	* generated/generated/maxloc1_8_i2.c: Regenerated.
	* generated/generated/maxloc1_8_i4.c: Regenerated.
	* generated/generated/maxloc1_8_i8.c: Regenerated.
	* generated/generated/maxloc1_8_r10.c: Regenerated.
	* generated/generated/maxloc1_8_r16.c: Regenerated.
	* generated/generated/maxloc1_8_r4.c: Regenerated.
	* generated/generated/maxloc1_8_r8.c: Regenerated.
	* generated/generated/maxval_i16.c: Regenerated.
	* generated/generated/maxval_i1.c: Regenerated.
	* generated/generated/maxval_i2.c: Regenerated.
	* generated/generated/maxval_i4.c: Regenerated.
	* generated/generated/maxval_i8.c: Regenerated.
	* generated/generated/maxval_r10.c: Regenerated.
	* generated/generated/maxval_r16.c: Regenerated.
	* generated/generated/maxval_r4.c: Regenerated.
	* generated/generated/maxval_r8.c: Regenerated.
	* generated/generated/minloc1_16_i16.c: Regenerated.
	* generated/generated/minloc1_16_i1.c: Regenerated.
	* generated/generated/minloc1_16_i2.c: Regenerated.
	* generated/generated/minloc1_16_i4.c: Regenerated.
	* generated/generated/minloc1_16_i8.c: Regenerated.
	* generated/generated/minloc1_16_r10.c: Regenerated.
	* generated/generated/minloc1_16_r16.c: Regenerated.
	* generated/generated/minloc1_16_r4.c: Regenerated.
	* generated/generated/minloc1_16_r8.c: Regenerated.
	* generated/generated/minloc1_4_i16.c: Regenerated.
	* generated/generated/minloc1_4_i1.c: Regenerated.
	* generated/generated/minloc1_4_i2.c: Regenerated.
	* generated/generated/minloc1_4_i4.c: Regenerated.
	* generated/generated/minloc1_4_i8.c: Regenerated.
	* generated/generated/minloc1_4_r10.c: Regenerated.
	* generated/generated/minloc1_4_r16.c: Regenerated.
	* generated/generated/minloc1_4_r4.c: Regenerated.
	* generated/generated/minloc1_4_r8.c: Regenerated.
	* generated/generated/minloc1_8_i16.c: Regenerated.
	* generated/generated/minloc1_8_i1.c: Regenerated.
	* generated/generated/minloc1_8_i2.c: Regenerated.
	* generated/generated/minloc1_8_i4.c: Regenerated.
	* generated/generated/minloc1_8_i8.c: Regenerated.
	* generated/generated/minloc1_8_r10.c: Regenerated.
	* generated/generated/minloc1_8_r16.c: Regenerated.
	* generated/generated/minloc1_8_r4.c: Regenerated.
	* generated/generated/minloc1_8_r8.c: Regenerated.
	* generated/generated/minval_i16.c: Regenerated.
	* generated/generated/minval_i1.c: Regenerated.
	* generated/generated/minval_i2.c: Regenerated.
	* generated/generated/minval_i4.c: Regenerated.
	* generated/generated/minval_i8.c: Regenerated.
	* generated/generated/minval_r10.c: Regenerated.
	* generated/generated/minval_r16.c: Regenerated.
	* generated/generated/minval_r4.c: Regenerated.
	* generated/generated/minval_r8.c: Regenerated.
	* generated/generated/product_c10.c: Regenerated.
	* generated/generated/product_c16.c: Regenerated.
	* generated/generated/product_c4.c: Regenerated.
	* generated/generated/product_c8.c: Regenerated.
	* generated/generated/product_i16.c: Regenerated.
	* generated/generated/product_i1.c: Regenerated.
	* generated/generated/product_i2.c: Regenerated.
	* generated/generated/product_i4.c: Regenerated.
	* generated/generated/product_i8.c: Regenerated.
	* generated/generated/product_r10.c: Regenerated.
	* generated/generated/product_r16.c: Regenerated.
	* generated/generated/product_r4.c: Regenerated.
	* generated/generated/product_r8.c: Regenerated.
	* generated/generated/sum_c10.c: Regenerated.
	* generated/generated/sum_c16.c: Regenerated.
	* generated/generated/sum_c4.c: Regenerated.
	* generated/generated/sum_c8.c: Regenerated.
	* generated/generated/sum_i16.c: Regenerated.
	* generated/generated/sum_i1.c: Regenerated.
	* generated/generated/sum_i2.c: Regenerated.
	* generated/generated/sum_i4.c: Regenerated.
	* generated/generated/sum_i8.c: Regenerated.
	* generated/generated/sum_r10.c: Regenerated.
	* generated/generated/sum_r16.c: Regenerated.
	* generated/generated/sum_r4.c: Regenerated.
	* generated/generated/sum_r8.c: Regenerated.

From-SVN: r178748
2011-09-10 14:06:57 +00:00
Thomas Koenig
3c63480725 bessel_r4.c: Regenerated.
2011-09-01  Thomas Koenig  <tkoenig@gcc.gnu.org>

	* generated/bessel_r4.c: Regenerated.
	* generated/bessel_r8.c: Regenerated.
	* generated/bessel_r10.c: Regenerated.
	* generated/bessel_r16.c: Regenerated.

From-SVN: r178425
2011-09-01 16:44:16 +00:00
Tobias Burnus
86187d0fe0 trans-decl.c (generate_coarray_sym_init): Use GFC_CAF_COARRAY_STATIC for static coarrays.
gcc/fortran/
2011-08-29  Tobias Burnus  <burnus@net-b.de>

        * trans-decl.c (generate_coarray_sym_init): Use
        GFC_CAF_COARRAY_STATIC for static coarrays.

libgfortan/
2011-08-29  Tobias Burnus  <burnus@net-b.de>

        * caf/libcaf.h (_gfortran_caf_deregister): Update prototype.
        * caf/mpi.c (_gfortran_caf_deregister): Modify prototype,
        actually free memory and add error diagnostic.
        (_gfortran_caf_finalize): Add additional free calls.
        * caf/single.c (_gfortran_caf_deregister): Modify prototype,
        actually free memory and add error diagnostic.
        (_gfortran_caf_finalize): Add additional free calls.

From-SVN: r178193
2011-08-29 12:33:09 +02:00
Thomas Koenig
e7898e54f4 re PR libfortran/50192 (Wrong character comparision with wide strings)
2011-08-29  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR libfortran/50192
	* intrinsics/string_intrinsics.c (memcmp_char4):  New function.
	* intrinsics/string_intrinsics_inc.c:  New macro MEMCMP, either
	set to memcmp or memcmp_char4.
	(compare_string):  Use MEMCMP, with correct size for it.
	* libgfortran.h:  Add prototype for memcmp_char4.

2011-08-29  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR libfortran/50192
	* gfortran.dg/widechar_compare_1.f90:  New test.

From-SVN: r178173
2011-08-29 09:05:11 +00:00
Thomas Koenig
3d2244b97f re PR fortran/48066 (Segfault with SUM of zero-sized array)
2011-08-28  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/40866
	* generated/iall_i1.c: Regenerated.
	* generated/iall_i16.c: Regenerated.
	* generated/iall_i2.c: Regenerated.
	* generated/iall_i4.c: Regenerated.
	* generated/iall_i8.c: Regenerated.
	* generated/iany_i1.c: Regenerated.
	* generated/iany_i16.c: Regenerated.
	* generated/iany_i2.c: Regenerated.
	* generated/iany_i4.c: Regenerated.
	* generated/iany_i8.c: Regenerated.
	* generated/iparity_i1.c: Regenerated.
	* generated/iparity_i16.c: Regenerated.
	* generated/iparity_i2.c: Regenerated.
	* generated/iparity_i4.c: Regenerated.
	* generated/iparity_i8.c: Regenerated.
	* generated/norm2_r10.c: Regenerated.
	* generated/norm2_r16.c: Regenerated.
	* generated/norm2_r4.c: Regenerated.
	* generated/norm2_r8.c: Regenerated.
	* generated/parity_l1.c: Regenerated.
	* generated/parity_l16.c: Regenerated.
	* generated/parity_l2.c: Regenerated.
	* generated/parity_l4.c: Regenerated.
	* generated/parity_l8.c: Regenerated.
	* generated/misc_specifics.F90: Regenerated (comment change).
	* generated/_abs_c10.F90: Regenerated (comment change).
	* generated/_abs_c16.F90: Regenerated (comment change).
	* generated/_abs_c4.F90: Regenerated (comment change).
	* generated/_abs_c8.F90: Regenerated (comment change).
	* generated/_abs_i16.F90: Regenerated (comment change).
	* generated/_abs_i4.F90: Regenerated (comment change).
	* generated/_abs_i8.F90: Regenerated (comment change).
	* generated/_abs_r10.F90: Regenerated (comment change).
	* generated/_abs_r16.F90: Regenerated (comment change).
	* generated/_abs_r4.F90: Regenerated (comment change).
	* generated/_abs_r8.F90: Regenerated (comment change).
	* generated/_acosh_r10.F90: Regenerated (comment change).
	* generated/_acosh_r16.F90: Regenerated (comment change).
	* generated/_acosh_r4.F90: Regenerated (comment change).
	* generated/_acosh_r8.F90: Regenerated (comment change).
	* generated/_acos_r10.F90: Regenerated (comment change).
	* generated/_acos_r16.F90: Regenerated (comment change).
	* generated/_acos_r4.F90: Regenerated (comment change).
	* generated/_acos_r8.F90: Regenerated (comment change).
	* generated/_aimag_c10.F90: Regenerated (comment change).
	* generated/_aimag_c16.F90: Regenerated (comment change).
	* generated/_aimag_c4.F90: Regenerated (comment change).
	* generated/_aimag_c8.F90: Regenerated (comment change).
	* generated/_aint_r10.F90: Regenerated (comment change).
	* generated/_aint_r16.F90: Regenerated (comment change).
	* generated/_aint_r4.F90: Regenerated (comment change).
	* generated/_aint_r8.F90: Regenerated (comment change).
	* generated/_anint_r10.F90: Regenerated (comment change).
	* generated/_anint_r16.F90: Regenerated (comment change).
	* generated/_anint_r4.F90: Regenerated (comment change).
	* generated/_anint_r8.F90: Regenerated (comment change).
	* generated/_asinh_r10.F90: Regenerated (comment change).
	* generated/_asinh_r16.F90: Regenerated (comment change).
	* generated/_asinh_r4.F90: Regenerated (comment change).
	* generated/_asinh_r8.F90: Regenerated (comment change).
	* generated/_asin_r10.F90: Regenerated (comment change).
	* generated/_asin_r16.F90: Regenerated (comment change).
	* generated/_asin_r4.F90: Regenerated (comment change).
	* generated/_asin_r8.F90: Regenerated (comment change).
	* generated/_atan2_r10.F90: Regenerated (comment change).
	* generated/_atan2_r16.F90: Regenerated (comment change).
	* generated/_atan2_r4.F90: Regenerated (comment change).
	* generated/_atan2_r8.F90: Regenerated (comment change).
	* generated/_atanh_r10.F90: Regenerated (comment change).
	* generated/_atanh_r16.F90: Regenerated (comment change).
	* generated/_atanh_r4.F90: Regenerated (comment change).
	* generated/_atanh_r8.F90: Regenerated (comment change).
	* generated/_atan_r10.F90: Regenerated (comment change).
	* generated/_atan_r16.F90: Regenerated (comment change).
	* generated/_atan_r4.F90: Regenerated (comment change).
	* generated/_atan_r8.F90: Regenerated (comment change).
	* generated/_conjg_c10.F90: Regenerated (comment change).
	* generated/_conjg_c16.F90: Regenerated (comment change).
	* generated/_conjg_c4.F90: Regenerated (comment change).
	* generated/_conjg_c8.F90: Regenerated (comment change).
	* generated/_cosh_r10.F90: Regenerated (comment change).
	* generated/_cosh_r16.F90: Regenerated (comment change).
	* generated/_cosh_r4.F90: Regenerated (comment change).
	* generated/_cosh_r8.F90: Regenerated (comment change).
	* generated/_cos_c10.F90: Regenerated (comment change).
	* generated/_cos_c16.F90: Regenerated (comment change).
	* generated/_cos_c4.F90: Regenerated (comment change).
	* generated/_cos_c8.F90: Regenerated (comment change).
	* generated/_cos_r10.F90: Regenerated (comment change).
	* generated/_cos_r16.F90: Regenerated (comment change).
	* generated/_cos_r4.F90: Regenerated (comment change).
	* generated/_cos_r8.F90: Regenerated (comment change).
	* generated/_dim_i16.F90: Regenerated (comment change).
	* generated/_dim_i4.F90: Regenerated (comment change).
	* generated/_dim_i8.F90: Regenerated (comment change).
	* generated/_dim_r10.F90: Regenerated (comment change).
	* generated/_dim_r16.F90: Regenerated (comment change).
	* generated/_dim_r4.F90: Regenerated (comment change).
	* generated/_dim_r8.F90: Regenerated (comment change).
	* generated/_exp_c10.F90: Regenerated (comment change).
	* generated/_exp_c16.F90: Regenerated (comment change).
	* generated/_exp_c4.F90: Regenerated (comment change).
	* generated/_exp_c8.F90: Regenerated (comment change).
	* generated/_exp_r10.F90: Regenerated (comment change).
	* generated/_exp_r16.F90: Regenerated (comment change).
	* generated/_exp_r4.F90: Regenerated (comment change).
	* generated/_exp_r8.F90: Regenerated (comment change).
	* generated/_log10_r10.F90: Regenerated (comment change).
	* generated/_log10_r16.F90: Regenerated (comment change).
	* generated/_log10_r4.F90: Regenerated (comment change).
	* generated/_log10_r8.F90: Regenerated (comment change).
	* generated/_log_c10.F90: Regenerated (comment change).
	* generated/_log_c16.F90: Regenerated (comment change).
	* generated/_log_c4.F90: Regenerated (comment change).
	* generated/_log_c8.F90: Regenerated (comment change).
	* generated/_log_r10.F90: Regenerated (comment change).
	* generated/_log_r16.F90: Regenerated (comment change).
	* generated/_log_r4.F90: Regenerated (comment change).
	* generated/_log_r8.F90: Regenerated (comment change).
	* generated/_mod_i16.F90: Regenerated (comment change).
	* generated/_mod_i4.F90: Regenerated (comment change).
	* generated/_mod_i8.F90: Regenerated (comment change).
	* generated/_mod_r10.F90: Regenerated (comment change).
	* generated/_mod_r16.F90: Regenerated (comment change).
	* generated/_mod_r4.F90: Regenerated (comment change).
	* generated/_mod_r8.F90: Regenerated (comment change).
	* generated/_sign_i16.F90: Regenerated (comment change).
	* generated/_sign_i4.F90: Regenerated (comment change).
	* generated/_sign_i8.F90: Regenerated (comment change).
	* generated/_sign_r10.F90: Regenerated (comment change).
	* generated/_sign_r16.F90: Regenerated (comment change).
	* generated/_sign_r4.F90: Regenerated (comment change).
	* generated/_sign_r8.F90: Regenerated (comment change).
	* generated/_sinh_r10.F90: Regenerated (comment change).
	* generated/_sinh_r16.F90: Regenerated (comment change).
	* generated/_sinh_r4.F90: Regenerated (comment change).
	* generated/_sinh_r8.F90: Regenerated (comment change).
	* generated/_sin_c10.F90: Regenerated (comment change).
	* generated/_sin_c16.F90: Regenerated (comment change).
	* generated/_sin_c4.F90: Regenerated (comment change).
	* generated/_sin_c8.F90: Regenerated (comment change).
	* generated/_sin_r10.F90: Regenerated (comment change).
	* generated/_sin_r16.F90: Regenerated (comment change).
	* generated/_sin_r4.F90: Regenerated (comment change).
	* generated/_sin_r8.F90: Regenerated (comment change).
	* generated/_sqrt_c10.F90: Regenerated (comment change).
	* generated/_sqrt_c16.F90: Regenerated (comment change).
	* generated/_sqrt_c4.F90: Regenerated (comment change).
	* generated/_sqrt_c8.F90: Regenerated (comment change).
	* generated/_sqrt_r10.F90: Regenerated (comment change).
	* generated/_sqrt_r16.F90: Regenerated (comment change).
	* generated/_sqrt_r4.F90: Regenerated (comment change).
	* generated/_sqrt_r8.F90: Regenerated (comment change).
	* generated/_tanh_r10.F90: Regenerated (comment change).
	* generated/_tanh_r16.F90: Regenerated (comment change).
	* generated/_tanh_r4.F90: Regenerated (comment change).
	* generated/_tanh_r8.F90: Regenerated (comment change).
	* generated/_tan_r10.F90: Regenerated (comment change).
	* generated/_tan_r16.F90: Regenerated (comment change).
	* generated/_tan_r4.F90: Regenerated (comment change).
	* generated/_tan_r8.F90: Regenerated (comment change).

From-SVN: r178140
2011-08-28 10:08:50 +00:00
Tobias Burnus
a2f3eae24d re PR fortran/50109 (Formatted namelist read with multiple "!" fails with: Cannot match namelist object name !)
2011-08-18  Tobias Burnus  <burnus@net-b.de>

        PR fortran/50109
        * io/list_read.c (eat_separator): Fix skipping over "!" lines.

2011-08-18  Tobias Burnus  <burnus@net-b.de>

        PR fortran/50109
        * gfortran.dg/namelist_73.f90: New.

From-SVN: r177858
2011-08-18 16:23:41 +02:00
Andreas Schwab
53390685bd ctime.c: Include <stdlib.h>.
* libgfortran/intrinsics/ctime.c: Include <stdlib.h>.
* libgfortran/intrinsics/getlog.c: Likewise.
* libgfortran/runtime/stop.c: Likewise.

From-SVN: r176675
2011-07-23 11:06:04 +00:00
Tobias Burnus
f5e62ce922 re PR libfortran/49791 (Formatted namelist reads fails with: Cannot match namelist object)
2011-07-23  Tobias Burnus  <burnus@net-b.de>

        PR fortran/49791
        * io/list_read.c (nml_parse_qualifier): Remove check to
        enabled extended read for another case.

2011-07-23  Tobias Burnus  <burnus@net-b.de>

        PR fortran/49791
        * gfortran.dg/namelist_72.f: New.

From-SVN: r176661
2011-07-23 00:44:20 +02:00
Daniel Carrera
c0f1579204 mpi.c (caf_runtime_error): Change fprintf to vfprintf.
2011-07-15  Daniel Carrera  <dcarrera@gmail.com>

	* caf/mpi.c (caf_runtime_error): Change fprintf to vfprintf.
	* caf/single.c (caf_runtime_error): Ditto.

From-SVN: r176340
2011-07-15 22:39:03 +00:00
Daniel Carrera
8019694098 Remove error parameter from caf_runtime_error. Add caf_runtime_error to single.c.
From-SVN: r176278
2011-07-14 15:49:00 +00:00
Janne Blomqvist
5f54710465 PR 49296 List read, EOF without preceding separator
2011-07-13  Janne Blomqvist  <jb@gcc.gnu.org>

	PR libfortran/49296
	* io/list_read.c (read_logical): Don't error out if a valid value
	is followed by EOF instead of a normal separator.
	(read_integer): Likewise.

testsuite:

2011-07-13  Janne Blomqvist  <jb@gcc.gnu.org>

	PR libfortran/49296
	* gfortran.dg/read_list_eof_1.f90: Add tests for integer, real,
	and logical reads.

From-SVN: r176245
2011-07-13 21:46:44 +03:00
Tobias Burnus
f6da75edeb error.c (sys_abort): Change argument list from "()" to "(void)".
2011-07-09  Tobias Burnus  <burnus@net-b.de>

        * runtime/error.c (sys_abort): Change argument list
        from "()" to "(void)".

From-SVN: r176109
2011-07-09 23:22:44 +02:00
Tobias Burnus
41de45c6a0 mpi.c (runtime_error): New function.
2011-07-09  Tobias Burnus  <burnus@net-b.de>
            Daniel Carrera  <dcarrera@gmail.com>

        * caf/mpi.c (runtime_error): New function.
        (_gfortran_caf_register): Use it.
        (_gfortran_caf_sync_all): Use it, add STAT_STOPPED_IMAGE
        as possible status value.
        (_gfortran_caf_sync_images): Ditto.


Co-Authored-By: Daniel Carrera <dcarrera@gmail.com>

From-SVN: r176080
2011-07-09 16:29:50 +02:00
Tobias Burnus
4054bc52d6 trans.c (gfc_allocate_with_status): Call _gfortran_caf_register with NULL arguments for (new) stat=/errmsg= arguments.
2011-07-07  Tobias Burnus  <burnus@net-b.de>

        * trans.c (gfc_allocate_with_status): Call _gfortran_caf_register
        with NULL arguments for (new) stat=/errmsg= arguments.

2011-07-07  Tobias Burnus  <burnus@net-b.de>

        * libcaf.h (__attribute__, unlikely, likely): New macros.
        (caf_register_t): Update comment.
        (_gfortran_caf_register): Add stat, errmsg, errmsg_len arguments.
        * single.c (_gfortran_caf_register): Ditto; add error diagnostics.
        * mpi.c (_gfortran_caf_register): Ditto.
        (caf_is_finalized): New global variable.
        (_gfortran_caf_finalize): Use it.

From-SVN: r175966
2011-07-07 14:46:18 +02:00
Thomas Koenig
a787f6f9ec memory.c (internal_malloc_size): If size is zero, allocate a single byte.
2011-07-05  Thomas Koenig  <tkoenig@gcc.gnu.org>

	* runtime/memory.c (internal_malloc_size):  If size is zero,
	allocate a single byte.
	* m4/pack.m4 (pack_'rtype_code`):  Don't check for zero size
	for the argument of internal_malloc_size.
	* m4/spread.m4 (spread_'rtype_code`):  Likewise.
	* m4/eoshift1.m4 (eoshift1):  Don't allocate twice.  Don't check
	for zero size for the argument of internal_malloc_size.
	* m4/eoshift3.m4: Don't check for zero size for the argument of
	internal_malloc_size.
	* intrinsics/pack_generic.c (pack_internal):  Likewise.
	(pack_s_internal):  Likewise.
	* intrinsics/cshift0.c (cshift0):  Likewise.
	* intrinsics/spread_generic.c (spread_internal):  Likewise.
	* intrinsics/eoshift0.c (eoshift0):  Likewise.
	* intrinsics/eoshift2.c (eoshift2):  Likewise.
	* generated/eoshift1_16.c: Regenerated.
	* generated/eoshift1_4.c: Regenerated.
	* generated/eoshift1_8.c: Regenerated.
	* generated/eoshift3_16.c: Regenerated.
	* generated/eoshift3_4.c: Regenerated.
	* generated/eoshift3_8.c: Regenerated.
	* generated/pack_c10.c: Regenerated.
	* generated/pack_c16.c: Regenerated.
	* generated/pack_c4.c: Regenerated.
	* generated/pack_c8.c: Regenerated.
	* generated/pack_i16.c: Regenerated.
	* generated/pack_i1.c: Regenerated.
	* generated/pack_i2.c: Regenerated.
	* generated/pack_i4.c: Regenerated.
	* generated/pack_i8.c: Regenerated.
	* generated/pack_r10.c: Regenerated.
	* generated/pack_r16.c: Regenerated.
	* generated/pack_r4.c: Regenerated.
	* generated/pack_r8.c: Regenerated.
	* generated/spread_c10.c: Regenerated.
	* generated/spread_c16.c: Regenerated.
	* generated/spread_c4.c: Regenerated.
	* generated/spread_c8.c: Regenerated.
	* generated/spread_i16.c: Regenerated.
	* generated/spread_i1.c: Regenerated.
	* generated/spread_i2.c: Regenerated.
	* generated/spread_i4.c: Regenerated.
	* generated/spread_i8.c: Regenerated.
	* generated/spread_r10.c: Regenerated.
	* generated/spread_r16.c: Regenerated.
	* generated/spread_r4.c: Regenerated.
	* generated/spread_r8.c: Regenerated.

From-SVN: r175880
2011-07-05 18:16:17 +00:00
Thomas Koenig
19b76346c0 re PR fortran/49479 (reshape / optionals / zero sized arrays)
2011-06-28  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/49479
	* m4/reshape.m4: If source allocation is smaller than one, set it
	to one.
	* intrinsics/reshape_generic.c:  Likewise.
	* generated/reshape_r16.c: Regenerated.
	* generated/reshape_c4.c: Regenerated.
	* generated/reshape_c16.c: Regenerated.
	* generated/reshape_c8.c: Regenerated.
	* generated/reshape_r4.c: Regenerated.
	* generated/reshape_i4.c: Regenerated.
	* generated/reshape_r10.c: Regenerated.
	* generated/reshape_r8.c: Regenerated.
	* generated/reshape_c10.c: Regenerated.
	* generated/reshape_i8.c: Regenerated.
	* generated/reshape_i16.c: Regenerated.

2011-06-28  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/49479
	* gfortran.dg/reshape_zerosize_3.f90:  New test.

From-SVN: r175594
2011-06-28 18:59:04 +00:00
Janne Blomqvist
d3ff9ee468 PR 49296 List directed read of string ending in EOF.
libgfortran ChangeLog entry:

2011-06-18  Janne Blomqvist  <jb@gcc.gnu.org>

        PR libfortran/49296
        * io/list_read.c (read_character): Accept EOF as a separator when
        reading string.


testsuite ChangeLog entry:

2011-06-18  Janne Blomqvist  <jb@gcc.gnu.org>

        PR libfortran/48296
	* gfortran.dg/read_list_eof_1.f90: New test.

From-SVN: r175166
2011-06-18 10:53:09 +03:00
Daniel Carrera
0a1138af63 single.c (_gfortran_caf_register): Store the address of all static coarrays in a linked list.
2011-06-17  Daniel Carrera  <dcarrera@gmail.com>

        * caf/single.c (_gfortran_caf_register): Store the address
        of all static coarrays in a linked list.
        (_gfortran_caf_finalize): Free memory of staic coarrays.
        * caf/mpi.c (_gfortran_caf_register): Store the address
        of all static coarrays in a linked list. Initialize MPI
        if necessary.
        (_gfortran_caf_finalize): Free memory of staic coarrays.
        (_gfortran_caf_init): Check if MPI is already initialized
        before initializing again.
        * caf/libcaf.h: Add a type to caf_register_t to distinguish
        static coarrays and add the type caf_static_t to make the
        linked list of static coarrays.

From-SVN: r175124
2011-06-17 01:09:36 +02:00
Janne Blomqvist
09ad57ec8f Return error when trying to seek a non-seekable buffered file
From-SVN: r174947
2011-06-11 13:52:18 +03:00
Janne Blomqvist
5ea0705af7 Figure out whether a file is seekable with lseek()
From-SVN: r174946
2011-06-11 13:19:49 +03:00
Daniel Carrera
f5c01f5bde trans-decl.c (gfc_build_builtin_function_decls): Updated declaration of caf_sync_all and caf_sync_images.
gcc/fortran/
2011-06-10  Daniel Carrera  <dcarrera@gmail.com>

        * trans-decl.c (gfc_build_builtin_function_decls):
        Updated declaration of caf_sync_all and caf_sync_images.
        * trans-stmt.c (gfc_trans_sync): Function
        can now handle a "stat" variable that has an integer type
        different from integer_type_node.

libgfortran/
2011-06-10  Daniel Carrera  <dcarrera@gmail.com>

        * caf/mpi.c (_gfortran_caf_sync_all,
        _gfortran_caf_sync_images): Functions have void return type
        and move status into parameter list.
        * caf/single.c (_gfortran_caf_sync_all,
        _gfortran_caf_sync_images): Functions have void return type
        and move status into parameter list.
        * caf/libcaf.h (_gfortran_caf_sync_all,
        _gfortran_caf_sync_images): Functions have void return type
        and move status into parameter list.

gcc/testsuite/
2011-06-10  Daniel Carrera  <dcarrera@gmail.com>

        * gfortran.dg/coarray/sync_1.f90: New test for
        "SYNC ALL", "SYNC MEMORY" and "SYNC IMAGES".

From-SVN: r174896
2011-06-10 12:22:24 +02:00
Richard Henderson
1b7a0148f0 gcc:
* config/i386/crtfastmath.c [!__x86_64__ && __sun__ && __svr4__]
	(sigill_hdlr): Correct insn, insn size.
	(set_fast_math) [!__x86_64__ && __sun__ && __svr4__]: Use movaps.

	gcc/testsuite:
	* lib/target-supports.exp (check_sse_os_support_available): Use
	movaps.

	libgfortran.
	* config/fpu-387.h [__sun__ && __svr4__] (sigill_hdlr): Correct
	insn, insn size.
	(has_sse) [!__x86_64__ && __sun__ && __svr4__]: Use movaps.

Co-Authored-By: Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>

From-SVN: r174609
2011-06-03 17:36:21 +00:00
Janne Blomqvist
155732f56d PR 48931 Use async-signal-safe execve instead of execvp
From-SVN: r174415
2011-05-29 23:13:52 +03:00
Janne Blomqvist
8bea6ce492 PR 49214 fd_gets should return NULL if nothing was read
From-SVN: r174395
2011-05-29 16:17:17 +03:00
Janne Blomqvist
04a4a57b1b PR 19155 Check for strtod failure via endptr
From-SVN: r174393
2011-05-29 11:59:44 +03:00
Tobias Burnus
1523ffa92a stop.c (stop_string,error_stop_string): Minor cleanup.
2011-05-22  Tobias Burnus  <burnus@net-b.de>

        * runtime/stop.c (stop_string,error_stop_string): Minor cleanup.

From-SVN: r174039
2011-05-22 21:34:16 +02:00
Janne Blomqvist
eec2794c17 PR 48931 Make backtrace async-signal-safe, reformat output
From-SVN: r174030
2011-05-22 19:38:05 +03:00
Janne Blomqvist
9272cac88a PR 48977 Denormal exception on glibc targets
Co-Authored-By: Uros Bizjak <ubizjak@gmail.com>

From-SVN: r173952
2011-05-20 17:45:51 +03:00
Janne Blomqvist
57b4d355a1 Clarify FP exception documentation and messages
From-SVN: r173944
2011-05-20 15:55:45 +03:00