Commit Graph

1193 Commits

Author SHA1 Message Date
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
Tobias Burnus
ade2e40389 lang.opt (fdump-core): Re-add as ignored option for backward compatibility.
2011-05-14  Tobias Burnus  <burnus@net-b.de>

        * lang.opt (fdump-core): Re-add as ignored option
        for backward compatibility.

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

        * runtime/stop.c (error_stop_string, error_stop_numeric):
        Do not backtrace for ERROR STOP.

From-SVN: r173760
2011-05-14 18:02:07 +02:00
Janne Blomqvist
de8bd1420e PR 48915 Abort handling
From-SVN: r173750
2011-05-14 11:44:09 +03:00
Janne Blomqvist
1028b2bded Error printing thread safety, remove GFORTRAN_USE_STDERR
From-SVN: r173749
2011-05-14 10:55:51 +03:00
Tobias Burnus
b4224aec54 re PR libfortran/48961 (EXECUTE_COMMAND_LINE(WAIT=.false.) fails on MinGW)
2011-05-14  Tobias Burnus  <burnus@net-b.de>

        PR fortran/48961
        * intrinsics/execute_command_line.c (set_cmdstat): Don't abort if
        synchronously executing with WAIT=.false.
        (execute_command_line): Fix setting of cmdstat and exitstat.

From-SVN: r173748
2011-05-14 08:35:18 +02:00
Tobias Burnus
cc9ae24cbe re PR fortran/18918 (Eventually support Fortran 2008's coarrays [co-arrays])
2011-05-06  Tobias Burnus  <burnus@net-b.de>

        PR fortran/18918
        * caf/libcaf.h: Cleanup headers.
        (_gfortran_caf_critical, _gfortran_caf_end_critical): Make stub.
        (caf_register_t): New enum.
        (_gfortran_caf_register, _gfortran_caf_deregister): New prototype.
        * caf/single.c (_gfortran_caf_critical,
        _gfortran_caf_end_critical): Remove.
        (_gfortran_caf_register, _gfortran_caf_deregister): New functions.
        * caf/mpi.c (_gfortran_caf_critical,
        _gfortran_caf_end_critical): Remove.
        (_gfortran_caf_register, _gfortran_caf_deregister): New functions.
        (caf_world_window): Remove global variable.
        (_gfortran_caf_init): Fix off-by-one error of this_image.

From-SVN: r173505
2011-05-06 20:35:00 +02:00
Jerry DeLisle
d6b872ad5e re PR libfortran/48787 (Invalid UP/DOWN rounding with F editing)
2011-05-04  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libgfortran/48787
	* io/write_float.def (output_float): Adjust up and down rounding for
	cases where 'd' = 0. Gather common code to one location.

From-SVN: r173408
2011-05-05 01:19:30 +00:00
Jerry DeLisle
7c4f44cd60 re PR libfortran/48787 (Invalid UP/DOWN rounding with F editing)
2011-05-01  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libgfortran/48787
	* io/write_float.def (output_float): Gather up integer declarations and
	add new 'p' for scale factor. Use 'p' in place of the 'dtp' reference
	everywhere. For ROUND_UP scan the digit string and only perform
	rounding if something other than '0' is found.

From-SVN: r173231
2011-05-01 12:32:18 +00:00
Janne Blomqvist
176f076f05 Whitespace fixes
From-SVN: r173173
2011-04-29 19:11:36 +03:00
Janne Blomqvist
1e03060224 Fix path handling
From-SVN: r173172
2011-04-29 19:09:45 +03:00
Janne Blomqvist
848eab5c43 PR 48488 Typo
From-SVN: r173171
2011-04-29 19:06:48 +03:00
Janne Blomqvist
ef6d0b6760 PR 48488 Fix comments
From-SVN: r173170
2011-04-29 19:03:54 +03:00
Janne Blomqvist
d785f6a394 PR 48488 Fix comments
From-SVN: r173169
2011-04-29 18:58:20 +03:00
Jerry DeLisle
a3f02fe44c re PR libfortran/48488 (Wrong default format for real numbers)
2011-04-29  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
	    Janne Blomqvist  <jb@gcc.gnu.org>

	PR libgfortran/48488
	PR libgfortran/48602
	PR libgfortran/48615
	PR libgfortran/48684
	PR libgfortran/48787
	* io/write.c (write_d, write_e, write_f, write_en,
	write_es): Add precision compemsation parameter to call.
	(set_fnode_default): Adjust default widths to assure
	round trip on write and read. (write_real): Adjust call to write_float.
	(write_real_g0): Calculate compensation for extra precision and adjust
	call to write_float. 
	* io/write_float.def (output_float_FMT_G_): Use volatile rather than
	asm volatile to avoid optimization issue. Correctly calculate the
	number of blanks (nb) to be appended and simplify calculation logic.
	(write_float): Increase MIN_FIELD_WIDTH by one to accomodate the new
	default widths. Eliminate the code that attempted to reduce the
	the precision used in later sprintf functions.  Add call parameter to
	compensate for extra precision.

Co-Authored-By: Janne Blomqvist <jb@gcc.gnu.org>

From-SVN: r173166
2011-04-29 14:56:02 +00:00
Jim Meyering
046957830e remove useless if-before-free tests
Change "if (E) free (E);" to "free (E);" everywhere except in the
libgo/, intl/, zlib/ and classpath/ directories.
Also transform equivalent variants like
"if (E != NULL) free (E);" and allow an extra cast on the
argument to free.  Otherwise, the tested and freed "E"
expressions must be identical, modulo white space.

From-SVN: r172785
2011-04-20 18:19:03 +00:00
Jerry DeLisle
b48de48389 re PR libfortran/48602 (Invalid F conversion of G descriptor for values close to powers of 10)
2011-04-19  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libgfortran/48602
	* io/write_float.def (output_float_FMT_G): Fix reversal in conditional.
	Use asm volatile to mark temp variable, avoiding optimization errors.

From-SVN: r172753
2011-04-20 04:18:25 +00:00
Jerry DeLisle
bc7409a8a9 re PR libfortran/48602 (Invalid F conversion of G descriptor for values close to powers of 10)
2011-04-17  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libgfortran/48602
	* io/write_float.def (output_float_FMT_G): Use current rounding mode
	to set the rounding parameters. (output_float): Skip rounding
	if value is zero.

From-SVN: r172634
2011-04-18 03:48:25 +00:00
Janne Blomqvist
d30fe1c5cd Replace sprintf with snprintf
From-SVN: r172590
2011-04-16 20:43:03 +03:00
Jerry DeLisle
0b0a0c945f re PR libfortran/48589 (Invalid G0/G0.d editing for NaN/infinity)
2011-04-15  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libgfortran/48589
	* io/write_float.def (write_infnan): Set width properly for G0.

From-SVN: r172502
2011-04-15 16:29:44 +00:00
Tobias Burnus
7e3d293f3d re PR fortran/18918 (Eventually support Fortran 2008's coarrays [co-arrays])
2011-04-15  Tobias Burnus  <burnus@net-b.de>

        PR fortran/18918
        * Makefile.am: Build and install caf/single.c as
        libcaf_single.a.
        * Makefile.in: Regenerate.

From-SVN: r172499
2011-04-15 18:13:28 +02:00
Janne Blomqvist
2aadeae27f PR 47571 Fix bootstrap regression on alpha-dec-osf
From-SVN: r172469
2011-04-15 07:21:19 +03:00
Janne Blomqvist
44720bef9d Cleanup memsize types
From-SVN: r172340
2011-04-12 22:27:49 +03:00
Janne Blomqvist
51603205f2 Remove _GNU_SOURCE from AM_CPPFLAGS
From-SVN: r172330
2011-04-12 21:10:28 +03:00
Tobias Burnus
6eb87b330f re PR fortran/18918 (Eventually support Fortran 2008's coarrays [co-arrays])
2011-04-06  Tobias Burnus  <burnus@net-b.de>

        PR fortran/18918
        * caf/mpi.c (_gfortran_caf_init, _gfortran_caf_finalize):
        Add global variable caf_mpi_initialized and use it for when
        finalizing.

From-SVN: r172059
2011-04-06 20:29:55 +02:00
Tobias Burnus
99ebea0382 unix.c: Adapt stat DEFINEs since MinGW64 supports LFS.
2011-04-04  Tobias Burnus  <burnus@net-b.de>

        * unix.c: Adapt stat DEFINEs since MinGW64 supports LFS.
        (fallback_access, open_internal4, compare_file_filename,
        find_file, file_size, inquire_sequential, inquire_direct,
        inquire_formatted): Use "struct stat" instead of gfstat_t.

From-SVN: r171911
2011-04-03 17:44:02 +02:00
Tobias Burnus
5092eb960c re PR fortran/18918 (Eventually support Fortran 2008's coarrays [co-arrays])
2011-03-27  Tobias Burnus  <burnus@net-b.de>

        PR fortran/18918
        * caf/libcaf.h: New - coarray communication library.
        * caf/mpi.c: New.
        * caf/single.c: New.

From-SVN: r171570
2011-03-27 11:01:34 +02:00
Jerry DeLisle
27deda791b re PR libfortran/48030 (Implement read_x using fbuf_getc)
2011-03-23  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libgfortran/48030
	* io/read.c (read_x): Re-implement using fbuf_getc.

From-SVN: r171378
2011-03-24 01:48:57 +00:00