Commit Graph

149411 Commits

Author SHA1 Message Date
Jeff Law f34bf3d939 epiphany.c (epiphany_print_operand): Adjust fallthru comment.
* config/epiphany/epiphany.c (epiphany_print_operand): Adjust
	fallthru comment.

From-SVN: r241582
2016-10-26 10:23:27 -06:00
Jakub Jelinek 3693a620f0 re PR fortran/77973 (ICE in scan_omp_1_op, at omp-low.c:3841)
PR fortran/77973
	* gimplify.c (gimplify_adjust_omp_clauses_1): For all added map
	clauses with OMP_CLAUSE_SIZE being a decl, call omp_notice_variable
	on outer context if any.

	* gfortran.dg/gomp/pr77973.f90: New test.

Co-Authored-By: Martin Liska <mliska@suse.cz>

From-SVN: r241581
2016-10-26 18:21:56 +02:00
Jakub Jelinek 984fa0eacb gen-pass-instances.awk (adjust_linenos): INcrement pass_lines[p] by increment rather than double it.
* gen-pass-instances.awk (adjust_linenos): INcrement pass_lines[p]
	by increment rather than double it.
	(insert_remove_pass): Strip leading whitespace from args[3].  Don't
	emit a space before args[4].
	(END): Don't emit a space before with_arg.

From-SVN: r241580
2016-10-26 18:20:54 +02:00
Jeff Law 32502b58e2 * config/fr30/fr30.c (fr30_print_operand): Adjust fallthru comment.
From-SVN: r241579
2016-10-26 10:19:55 -06:00
Thomas Preud'homme 3a5a75b53a Adapt atomic compare and swap to ARMv8-M Baseline
2016-10-26  Thomas Preud'homme  <thomas.preudhomme@arm.com>

    gcc/
    * config/arm/sync.md (atomic_compare_and_swap<mode>_1): Add new ARMv8-M
    Baseline only alternatives to (i) hold store atomic success value in a
    return register rather than a scratch register, (ii) use a low register
    for it and to (iii) ensure the cbranchsi insn generated by the split
    respect the constraints of Thumb-1 cbranchsi4_insn and
    cbranchsi4_scratch.
    * config/arm/thumb1.md (cbranchsi4_insn): Add comment to indicate
    constraints must match those in atomic_compare_and_swap.
    (cbranchsi4_scratch): Likewise.

From-SVN: r241578
2016-10-26 16:17:54 +00:00
Thomas Preud'homme 12286f25cd Refactor atomic compare_and_swap to make it fit for ARMv8-M Baseline
2016-10-26  Thomas Preud'homme  <thomas.preudhomme@arm.com>

    gcc/
    * config/arm/arm.c (arm_expand_compare_and_swap): Add new bdst local
    variable.  Add the new parameter to the insn generator.  Set that
    parameter to be CC flag for 32-bit targets, bval otherwise.  Set the
    return value from the negation of that parameter for Thumb-1, keeping
    the logic unchanged otherwise except for using bdst as the destination
    register of the compare_and_swap insn.
    (arm_split_compare_and_swap): Add explanation about how is the value
    returned to the function comment.  Rename scratch variable to
    neg_bval.  Adapt initialization of variables holding operands to the
    new operand numbers.  Use return register to hold result of store
    exclusive for Thumb-1, scratch register otherwise.  Construct the
    appropriate cbranch for Thumb-1 targets, keeping the logic unchanged
    for 32-bit targets.  Guard Z flag setting to restrict to 32bit targets.
    Use gen_cbranchsi4 rather than hand-written conditional branch to loop
    for strongly ordered compare_and_swap.
    * config/arm/predicates.md (cc_register_operand): New predicate.
    * config/arm/sync.md (atomic_compare_and_swap<mode>_1): Use a
    match_operand with the new predicate to accept either the CC flag or a
    destination register for the boolean return value, restricting it to
    CC flag only via constraint.  Adapt operand numbers accordingly.

From-SVN: r241577
2016-10-26 16:17:44 +00:00
Jeff Law 4f4bf94e9c frv.c (comparison_string): Do not fall through after an error.
* config/frv/frv.c (comparison_string): Do not fall through after
	an error.

From-SVN: r241576
2016-10-26 10:15:38 -06:00
Jeff Law 4b59261982 iq2000.c (iq2000_function_arg): Adjust fallthru comment.
* config/iq2000/iq2000.c (iq2000_function_arg): Adjust fallthru
	comment.
	(expand_one_builtin): Add missing break.

From-SVN: r241573
2016-10-26 10:10:40 -06:00
Jeff Law 0c57f4bf4a m32c.c (encode_pattern_1): Add fallthru comment.
* config/m32c/m32c.c (encode_pattern_1): Add fallthru comment.
	(m32c_legitimate_address_p): Likewise.

From-SVN: r241572
2016-10-26 10:08:30 -06:00
Jeff Law 6bd3f67140 * config/m32r/m32r.c (m32r_print_operand): Adjust fallthru comment.
From-SVN: r241571
2016-10-26 10:02:58 -06:00
Jeff Law 0c15dfc1dc * config/mcore/mcore.c (mcore_gen_compare): Adjust fallthru comments.
From-SVN: r241569
2016-10-26 09:59:34 -06:00
Jeff Law 1cd20a8fdc microblaze.c (microblaze_function_arg): Adjust fallthru comment.
* config/microblaze/microblaze.c (microblaze_function_arg): Adjust
	fallthru comment.

From-SVN: r241568
2016-10-26 09:52:41 -06:00
Jeff Law fcbe40f0df msp430.c (msp430_legitimate_address_p): Adjust fallthru comment.
* config/msp430/msp430.c (msp430_legitimate_address_p): Adjust
	fallthru comment.

From-SVN: r241567
2016-10-26 09:49:25 -06:00
Jeff Law aa315f3463 * config/nios2/nios2.c (nios2_rtx_costs): Avoid fallthru.
From-SVN: r241566
2016-10-26 09:47:48 -06:00
Jeff Law e741aaa382 rl78.c (rl78_calculate_death_notes): Add fallthru comment.
* config/rl78/rl78.c (rl78_calculate_death_notes): Add fallthru
	comment.
	(rl78_asm_ctor_dtor): Increase buffer size.

From-SVN: r241565
2016-10-26 09:42:11 -06:00
Jeff Law 42ee9611de stormy16.c (xstormy16_asm_output_destrutor): Increase buffer size.
* config/stormy16/stormy16.c (xstormy16_asm_output_destrutor): Increase
	buffer size.
	(xstormy16_asm_output_constructor): Likewise.

From-SVN: r241564
2016-10-26 09:36:48 -06:00
Edward Smith-Rowland 10da5b7cbc Implement uniform_inside_sphere_distribution extension.
2016-10-26  Edward Smith-Rowland  <3dw4rd@verizon.net>

	Implement uniform_inside_sphere_distribution extension.
	* include/ext/random: Implement uniform_inside_sphere_distribution.
	* include/ext/random.tcc: Ditto.
	* testsuite/ext/random/uniform_inside_sphere_distribution/
	cons/default.cc: New.
	* testsuite/ext/random/uniform_inside_sphere_distribution/
	cons/parms.cc: New.
	* testsuite/ext/random/uniform_inside_sphere_distribution/
	operators/equal.cc: New.
	* testsuite/ext/random/uniform_inside_sphere_distribution/
	operators/generate.cc: New.
	* testsuite/ext/random/uniform_inside_sphere_distribution/
	operators/inequal.cc: New.
	* testsuite/ext/random/uniform_inside_sphere_distribution/
	operators/serialize.cc: New.

From-SVN: r241562
2016-10-26 15:34:18 +00:00
Jeff Law b2029ad650 pa.c (pa_asm_output_mi_thunk): Increase buffer size.
* config/pa/pa.c (pa_asm_output_mi_thunk): Increase buffer
	size.

From-SVN: r241561
2016-10-26 09:25:27 -06:00
Jeff Law 451c15c251 h8300.c (h8300_print_operand): Adjust FALLTHRU comment to silence warning.
* config/h8300/h8300.c (h8300_print_operand): Adjust FALLTHRU
	comment to silence warning.

From-SVN: r241560
2016-10-26 09:20:33 -06:00
Jonathan Wakely ec0b1056a7 Add recursive_directory_iterator::pop(error_code&)
* include/experimental/bits/fs_dir.h (recursive_directory_iterator):
	Overload pop (LWG 2706).
	* src/filesystem/dir.cc (recursive_directory_iterator::pop): Define
	new overload.
	* testsuite/experimental/filesystem/iterators/pop.cc: New test.

From-SVN: r241559
2016-10-26 16:20:04 +01:00
Jeff Law ae51afc5a2 spu.c (spu_sched_reorder): Add missing fallthru comment.
* config/spu/spu.c (spu_sched_reorder): Add missing fallthru comment.
	(spu_legitimate_address_p): Fix logic error and add missing fallthru
	comment.

From-SVN: r241557
2016-10-26 09:17:16 -06:00
Paul Thomas cd612e8a01 re PR fortran/78108 (Generic type-bound operator conflicts)
2016-10-26  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/78108
	* resolve.c (resolve_typebound_intrinsic_op): For submodules
	suppress the error and return if the same procedure symbol
	is added more than once to the interface.

2016-10-26  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/78108
	* gfortran.dg/submodule_18.f08: New test.
	* gfortran.dg/submodule_19.f08: New test.

From-SVN: r241555
2016-10-26 14:48:02 +00:00
Jonathan Wakely b4e7e6bf22 Fix error handling in recursive_directory_iterator::increment
* src/filesystem/dir.cc (recursive_directory_iterator::increment):
	Reset state on error.
	* testsuite/experimental/filesystem/iterators/
	recursive_directory_iterator.cc: Check state after increment error.

From-SVN: r241552
2016-10-26 14:34:34 +01:00
Michael Matz 09844a5f64 fix pr78060 pr78061 pr78088
PR tree-optimization/78060
	PR tree-optimization/78061
	PR tree-optimization/78088
	* tree-ssa-loop-split.c (easy_exit_values): New function.
	(tree_ssa_split_loops): Use it.
	(compute_new_first_bound): Change order of operations,
	fix invalid use of types.

testsuite/
	* g++.dg/pr78060.C: New test.
	* gfortran.dg/pr78061.f: New test.
	* g++.dg/pr78088.C: New test.

From-SVN: r241551
2016-10-26 12:54:30 +00:00
Fritz Reese 0ef33d4462 New I/O specifiers CARRIAGECONTROL, READONLY, SHARE with -fdec.
gcc/fortran/
	* gfortran.texi: Document.
	* frontend-passes.c (gfc_code_walker): Add SHARE and CARRIAGECONTROL.
	* io.c (gfc_free_open, gfc_resolve_open, gfc_match_open): Ditto.
	* gfortran.h (gfc_open): Add SHARE, CARRIAGECONTROL, and READONLY.
	* io.c (io_tag, match_open_element): Ditto.
	* ioparm.def: Ditto.
	* trans-io.c (gfc_trans_open): Ditto.
	* io.c (match_dec_etag, match_dec_ftag): New functions.

	libgfortran/io/
	* libgfortran.h (IOPARM_OPEN_HAS_READONLY, IOPARM_OPEN_HAS_SHARE,
	IOPARM_OPEN_HAS_CC): New for READONLY, SHARE, and CARRIAGECONTROL.
	* close.c (st_close): Support READONLY.
	* io.h (st_parameter_open, unit_flags): Support SHARE, CARRIAGECONTROL,
	and READONLY.
	* open.c (st_open): Ditto.
	* transfer.c (data_transfer_init): Ditto.
	* io.h (st_parameter_dt): New member 'cc' for CARRIAGECONTROL.
	* write.c (write_check_cc, write_cc): New functions for CARRIAGECONTROL.
	* transfer.c (next_record_cc): Ditto.
	* file_pos.c (st_endfile): Support SHARE and CARRIAGECONTROL.
	* io.h (st_parameter_inquire): Ditto.
	* open.c (edit_modes, new_unit): Ditto.
	* inquire.c (inquire_via_unit, inquire_via_filename): Ditto.
	* io.h (unit_share, unit_cc, cc_fortran, IOPARM_INQUIRE_HAS_SHARE,
	IOPARM_INQUIRE_HAS_CC): New for SHARE and CARRIAGECONTROL.
	* open.c (share_opt, cc_opt): Ditto.
	* read.c (read_x): Support CARRIAGECONTROL.
	* transfer.c (read_sf, next_record_r, next_record_w): Ditto.
	* write.c (list_formatted_write_scalar, write_a): Ditto.
	* unix.h (close_share): New prototype.
	* unix.c (open_share, close_share): New functions to handle SHARE.
	* unix.c (open_external): Handle READONLY. Call open_share.
	* close.c (st_close): Call close_share.

	gcc/testsuite/
	* dec_io_1.f90: New test.
        * dec_io_2.f90: New test.
        * dec_io_3.f90: New test.
        * dec_io_4.f90: New test.
        * dec_io_5.f90: New test.
        * dec_io_6.f90: New test.

From-SVN: r241550
2016-10-26 12:11:44 +00:00
Jonathan Wakely 9dbe100a41 PR78111 fix fallback code for filesystem::canonical
PR libstdc++/78111
	* src/filesystem/ops.cc (canonical): Set error for non-existent path.

From-SVN: r241549
2016-10-26 12:29:36 +01:00
Uros Bizjak d955ae42cc Add missing header in Filesystem TS configure tests
2016-10-26  Uros Bizjak  <ubizjak@gmail.com>

	* acinclude.m4 (GLIBCXX_CHECK_FILESYSTEM_DEPS): Include <limits.h>
	for PATH_MAX in realpath test.
	* configure: Regenerate.

From-SVN: r241548
2016-10-26 12:29:31 +01:00
Georg-Johann Lay b6735d9ac5 gen-pass-instances.awk is sensitive to the order in which passes are added...
gen-pass-instances.awk is sensitive to the order in which
	passes are added; passes that appear later have to be added first.
	PR target/71676
	PR target/71678
	* config/avr/avr-passes.def: Swap order of directives for
	gen-pass-instances.awk.

From-SVN: r241547
2016-10-26 09:46:44 +00:00
GCC Administrator 9e8b0bba61 Daily bump.
From-SVN: r241545
2016-10-26 00:16:17 +00:00
Jeff Law 9443c717ef vax.c (vad_address_cost_1): Add missing FALLTHRU comment.
* config/vax/vax.c (vad_address_cost_1): Add missing FALLTHRU comment.
	(vax_notice_update_cc): Likewise.

From-SVN: r241542
2016-10-25 16:31:57 -06:00
Will Schmidt ac164b5b53 MAINTAINERS (Write After Approval): Add myself.
2016-10-25  Will Schmidt  <will_schmidt@vnet.ibm.com>

	* MAINTAINERS (Write After Approval): Add myself.

From-SVN: r241541
2016-10-25 21:34:14 +00:00
Paul Thomas bf9f15ee55 re PR fortran/45516 ([F08] allocatable compontents of recursive type)
2016-10-25  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/45516
	* class.c (gfc_find_derived_vtab): Detect recursive allocatable
	derived type components. If present, add '_deallocate' field to
	the vtable and build the '__deallocate' function.
	* decl.c (build_struct): Allow recursive allocatable derived
	type components for -std=f2008 or more.
	(gfc_match_data_decl): Accept these derived types.
	* expr.c (gfc_has_default_initializer): Ditto.
	* resolve.c (resolve_component): Make sure that the vtable is
	built for these derived types.
	* trans-array.c(structure_alloc_comps) : Use the '__deallocate'
	function for the automatic deallocation of these types.
	* trans-expr.c : Generate the deallocate accessor.
	* trans.h : Add its prototype.
	* trans-types.c (gfc_get_derived_type): Treat the recursive
	allocatable components in the same way as the corresponding
	pointer components.

2016-10-25  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/45516
	* gfortran.dg/class_2.f03: Set -std=f2003.
	* gfortran.dg/finalize_21.f90: Modify tree-dump.
	* gfortran.dg/recursive_alloc_comp_1.f08: New test.
	* gfortran.dg/recursive_alloc_comp_2.f08: New test.
	* gfortran.dg/recursive_alloc_comp_3.f08: New test.
	* gfortran.dg/recursive_alloc_comp_4.f08: New test.

From-SVN: r241539
2016-10-25 20:37:05 +00:00
Eric Botcazou 7c7dae6542 config.gcc (sparc*-*-solaris2*): Adjust.
* config.gcc (sparc*-*-solaris2*): Adjust.
	(sparc64-*-linux*): Likewise.
	* config/sparc/default-64.h: Rename to...
	* config/sparc/default64.h: ...this.
	* config/sparc/sparc.c (sparc_option_override): Replace TARGET_64BIT
	with TARGET_ARCH64.
	(sparc_mangle_type): Replace !TARGET_64BIT with TARGET_ARCH32.
	* config/sparc/sparc.h: Minor tweaks.
	* config/sparc/sparc.md: Replace !TARGET_64BIT and !TARGET_ARCH64 with
	TARGET_ARCH32 throughout.  Minor various tweaks throughout.

From-SVN: r241538
2016-10-25 20:15:44 +00:00
Jakub Jelinek 6c95388f11 re PR sanitizer/78106 (ASAN can't find heap-use-after-free with -O1)
PR sanitizer/78106
	* gcc.dg/asan/pr78106.c: Add -ffat-lto-objects to dg-options.

From-SVN: r241537
2016-10-25 22:15:20 +02:00
David Malcolm f5ea989d50 input.c/libcpp: fix lifetimes of path buffers
Running "make selftest-valgrind" showed various leaks of the form:

408 bytes in 24 blocks are definitely lost in loss record 572 of 679
   at 0x4A0645D: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
   by 0x1B0D057: xmalloc (xmalloc.c:148)
   by 0x1ACCAA1: append_file_to_dir(char const*, cpp_dir*) [clone .isra.3] (files.c:1567)
   by 0x1ACD56F: _cpp_find_file (files.c:390)
   by 0x1ACF8FB: cpp_read_main_file(cpp_reader*, char const*) (init.c:632)
   by 0x1AB3D97: selftest::lexer_test::lexer_test(selftest::line_table_case const&, char const*, selftest::lexer_test_options*) (input.c:2014)
   by 0x1AB792B: selftest::test_lexer_string_locations_u8(selftest::line_table_case const&) (input.c:2713)
   by 0x1ABA22A: selftest::for_each_line_table_case(void (*)(selftest::line_table_case const&)) (input.c:3227)
   by 0x1ABA381: selftest::input_c_tests() (input.c:3260)
   by 0x1A295F1: selftest::run_tests() (selftest-run-tests.c:62)
   by 0xF20DC4: toplev::run_self_tests() (toplev.c:2076)
   by 0xF20FCD: toplev::main(int, char**) (toplev.c:2153)

Fix the leak by freeing the file->path in destroy_cpp_file.
However, doing so would lead to a use-after-free in input.c's file cache
since the filenames in this cache are the libcpp file->path buffers.

Hence we need to ensure that any references to the file in the input.c
cache are purged before cleaning up file->path.  This is normally done
by the temp_source_file dtor.  Hence we need to reorder things to that
the temp_source_file dtor runs before cleaning up the cpp_parser.  The
patch does this by introducing a wrapper class around cpp_parser *, so
that the dtor can run after the dtor for temp_source_file.

gcc/ChangeLog:
	* input.c (fcache::file_patch): Add comment about lifetime.
	(selftest::cpp_reader_ptr): New class.
	(selftest::lexer_test): Convert m_parser from cpp_reader *
	to a cpp_reader_ptr, and move m_tempfile to after it.
	(selftest::lexer_test::lexer_test): Update for above reordering.
	(lexer_test::~lexer_test): Move cleanup of m_parser to
	cpp_reader_ptr's dtor.

libcpp/ChangeLog:
	* files.c (destroy_cpp_file): Free file->path.

From-SVN: r241536
2016-10-25 19:24:01 +00:00
Fritz Reese dd90ca33e8 Convert logical ops on integers to bitwise equivalent with -fdec.
gcc/fortran/
	* gfortran.texi: Document.
	* resolve.c (logical_to_bitwise): New function.
	* resolve.c (resolve_operator): Wrap operands with logical_to_bitwise.

	gcc/testsuite/gfortran.dg/
	* dec_bitwise_ops_1.f90, dec_bitwise_ops_2.f90: New testcases.

From-SVN: r241534
2016-10-25 18:27:51 +00:00
David Malcolm 2be1b79650 Implement ~line_maps ()
line_maps instances such as the global line_table are
GC-managed, but the htab within location_adhoc_data_map.htab
is not GC-managed.

Previously this was deleted manually by a call to
location_adhoc_data_fini within toplev::main.

However, on adding a call to forcibly_ggc_collect after the
selftests, all of the htabs for the various line_tables
created during the selftests start showing up as leaks
in "make selftest-valgrind", e.g.:

13,536 (1,344 direct, 12,192 indirect) bytes in 12 blocks are definitely lost in loss record 1,065 of 1,086
   at 0x4A081D4: calloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
   by 0x16DB3B0: xcalloc (xmalloc.c:163)
   by 0x16D8D34: htab_create_typed_alloc (hashtab.c:358)
   by 0x16D8DBD: htab_create_alloc (hashtab.c:286)
   by 0x16A2CCC: linemap_init(line_maps*, unsigned int) (line-map.c:353)
   by 0x1685605: selftest::line_table_test::line_table_test(selftest::line_table_case const&) (input.c:1624)
   by 0x167D09C: selftest::test_applying_fixits_modernize_named_init(selftest::line_table_case const&) (edit-context.c:1430)
   by 0x1686827: selftest::for_each_line_table_case(void (*)(selftest::line_table_case const&)) (input.c:3227)
   by 0x167F067: selftest::edit_context_c_tests() (edit-context.c:1658)
   by 0x1616E67: selftest::run_tests() (selftest-run-tests.c:71)
   by 0xC0DB25: toplev::run_self_tests() (toplev.c:2076)
   by 0x618EB4: toplev::main(int, char**) (toplev.c:2153)

This patch removes the manual one-time cleanup in favor of
adding a destructor to class line_maps, which cleans up
the non-GC-managed htab.

Doing so improves "make selftest-valgrind" from:

==61118== LEAK SUMMARY:
==61118==    definitely lost: 121,248 bytes in 1,515 blocks
==61118==    indirectly lost: 974,344 bytes in 959 blocks
==61118==      possibly lost: 0 bytes in 0 blocks
==61118==    still reachable: 1,332,599 bytes in 3,684 blocks
==61118==         suppressed: 0 bytes in 0 blocks

to:

==57182== LEAK SUMMARY:
==57182==    definitely lost: 13,840 bytes in 556 blocks
==57182==    indirectly lost: 0 bytes in 0 blocks
==57182==      possibly lost: 0 bytes in 0 blocks
==57182==    still reachable: 1,355,703 bytes in 3,684 blocks
==57182==         suppressed: 0 bytes in 0 blocks

gcc/ChangeLog:
	* toplev.c (toplev::main): Remove call to
	location_adhoc_data_fini.

libcpp/ChangeLog:
	* include/line-map.h (line_maps::~line_maps): New dtor.
	(location_adhoc_data_fini): Delete decl.
	* line-map.c (line_maps::~line_maps): New dtor.
	(location_adhoc_data_fini): Delete.

From-SVN: r241533
2016-10-25 18:10:44 +00:00
Jason Merrill f64e0c029c constexpr.c (maybe_constant_init): Pull out TARGET_EXPR_INITIAL.
* constexpr.c (maybe_constant_init): Pull out TARGET_EXPR_INITIAL.

	(cxx_eval_outermost_constant_expr): Don't return a CONSTRUCTOR
	with CONSTRUCTOR_NO_IMPLICIT_ZERO.
	(cxx_eval_call_expression): Clear CONSTRUCTOR_NO_IMPLICIT_ZERO.

From-SVN: r241531
2016-10-25 13:23:44 -04:00
Eric Botcazou 90e261e494 tree.h (wi::fits_to_tree_p): Accept only 0 and 1 for boolean types.
* tree.h (wi::fits_to_tree_p): Accept only 0 and 1 for boolean types.
	* tree.c (int_fits_type_p): Likewise.  Adjust head comment.

From-SVN: r241529
2016-10-25 17:11:49 +00:00
Andre Vehreschild cef026ecaf re PR fortran/72770 (ICE in make_ssa_name_fn, at tree-ssanames.c:263)
gcc/testsuite/ChangeLog:

2016-10-25  Andre Vehreschild  <vehre@gcc.gnu.org>

	PR fortran/72770
	* gfortran.dg/alloc_comp_class_5.f03: Added test again that caused
	this pr.

gcc/fortran/ChangeLog:

2016-10-25  Andre Vehreschild  <vehre@gcc.gnu.org>

	PR fortran/72770
	* class.c (find_intrinsic_vtab): No longer encode the string length
	into vtype's name and use the char's kind for the size instead of
	the string_length time the size.
	* trans-array.c (gfc_conv_ss_descriptor): For deferred length char
	arrays the dynamically sized type needs to be declared.
	(build_class_array_ref): Address the i-th array element by multiplying
	it with the _vptr->_size and the _len to make sure char arrays are
	addressed correctly.
	* trans-expr.c (gfc_conv_intrinsic_to_class): Made comment more
	precise.

From-SVN: r241528
2016-10-25 19:01:58 +02:00
David Malcolm 6c3b5bf072 Expose forcibly_ggc_collect and run it after all selftests
gcc/ChangeLog:
	* ggc-tests.c (forcibly_ggc_collect): Rename to...
	(selftest::forcibly_ggc_collect): ...this, and remove "static".
	(test_basic_struct): Update for above renaming.
	(test_length): Likewise.
	(test_union): Likewise.
	(test_finalization): Likewise.
	(test_deletable_global): Likewise.
	(test_inheritance): Likewise.
	(test_chain_next): Likewise.
	(test_user_struct): Likewise.
	(test_tree_marking): Likewise.
	* selftest-run-tests.c (selftest::run_tests): Call
	selftest::forcibly_ggc_collect at the end of the selftests.
	* selftest.h (selftest::forcibly_ggc_collect): New decl.

From-SVN: r241527
2016-10-25 16:46:54 +00:00
Jakub Jelinek 96592eeda1 re PR target/78102 (GCC refuses to generate PCMPEQQ instruction for SSE4.1)
PR target/78102
	* optabs.def (vcondeq_optab, vec_cmpeq_optab): New optabs.
	* optabs.c (expand_vec_cond_expr): For comparison codes
	EQ_EXPR and NE_EXPR, attempt vcondeq_optab as fallback.
	(expand_vec_cmp_expr): For comparison codes
	EQ_EXPR and NE_EXPR, attempt vec_cmpeq_optab as fallback.
	* optabs-tree.h (expand_vec_cmp_expr_p, expand_vec_cond_expr_p):
	Add enum tree_code argument.
	* optabs-query.h (get_vec_cmp_eq_icode, get_vcond_eq_icode): New
	inline functions.
	* optabs-tree.c (expand_vec_cmp_expr_p): Add CODE argument.  For
	CODE EQ_EXPR or NE_EXPR, attempt to use vec_cmpeq_optab as
	fallback.
	(expand_vec_cond_expr_p): Add CODE argument.  For CODE EQ_EXPR or
	NE_EXPR, attempt to use vcondeq_optab as fallback.
	* tree-vect-generic.c (expand_vector_comparison,
	expand_vector_divmod, expand_vector_condition): Adjust
	expand_vec_cmp_expr_p and expand_vec_cond_expr_p callers.
	* tree-vect-stmts.c (vectorizable_condition,
	vectorizable_comparison): Likewise.
	* tree-vect-patterns.c (vect_recog_mixed_size_cond_pattern,
	check_bool_pattern, search_type_for_mask_1): Likewise.
	* expr.c (do_store_flag): Likewise.
	* doc/md.texi (@code{vec_cmpeq@var{m}@var{n}},
	@code{vcondeq@var{m}@var{n}}): Document.
	* config/i386/sse.md (vec_cmpeqv2div2di, vcondeq<VI8F_128:mode>v2di):
	New expanders.
testsuite/
	* gcc.target/i386/pr78102.c: New test.

From-SVN: r241525
2016-10-25 18:26:12 +02:00
Cesar Philippidis 8c78afcec8 intrinsic.texi (cosd): New mathop.
gcc/fortran/
	* intrinsic.texi (cosd): New mathop.

From-SVN: r241523
2016-10-25 08:47:12 -07:00
Jonathan Wakely 7195dfe9b6 Handle negative times in filesystem::last_write_time
* src/filesystem/ops.cc
	(last_write_time(const path&, file_time_type, error_code&)): Handle
	negative times correctly.
	* testsuite/experimental/filesystem/operations/last_write_time.cc:
	Test writing file times.

From-SVN: r241522
2016-10-25 16:32:52 +01:00
Jonathan Wakely ec04aad76d Fix error handling in copy_file and equivalent
* src/filesystem/ops.cc (do_copy_file): Report an error if source or
	destination is not a regular file (LWG 2712).
	(equivalent): Fix error handling and result when only one file exists.
	* testsuite/experimental/filesystem/operations/copy.cc: Remove files
	created by tests. Test copying directories.
	* testsuite/experimental/filesystem/operations/copy_file.cc: Remove
	files created by tests.
	* testsuite/experimental/filesystem/operations/equivalent.cc: New.
	* testsuite/experimental/filesystem/operations/is_empty.cc: New.
	* testsuite/experimental/filesystem/operations/read_symlink.cc: Remove
	file created by test.
	* testsuite/experimental/filesystem/operations/remove_all.cc: New.
	* testsuite/util/testsuite_fs.h (~scoped_file): Only try to remove
	file if path is non-empty, to support removal by other means.

From-SVN: r241521
2016-10-25 16:32:37 +01:00
Fritz Reese 1cf1719bc0 Enable .XOR. operator with -std=legacy.
gcc/fortran/
	* match.c (gfc_match_intrinsic_op): Match ".XOR." with -std=legacy.
	* gfortran.texi: Document.

	gcc/testsuite/gfortran.dg/
	* dec_logical_xor_1.f90: New.
        * dec_logical_xor_2.f90: New.
        * dec_logical_xor_3.f03: New.

From-SVN: r241520
2016-10-25 15:30:51 +00:00
Fritz Reese cd714e1e56 Enable %LOC as an rvalue with -std=legacy.
gcc/fortran/
        * primary.c (gfc_match_rvalue): Match %LOC as LOC with -std=legacy.
        * gfortran.texi: Document.

	gcc/testsuite/gfortran.dg/
	* dec_loc_rval_1.f90: New test.
        * dec_loc_rval_2.f90: New test.
        * dec_loc_rval_3.f90: New test.

From-SVN: r241519
2016-10-25 15:27:39 +00:00
Fritz Reese 90051c26da Support TYPE as alias for PRINT with -fdec.
gcc/fortran/
	* decl.c (gfc_match_type): New function.
	* match.h (gfc_match_type): New function.
	* match.c (gfc_match_if): Special case for one-line IFs.
	* gfortran.texi: Update documentation.
	* parse.c (decode_statement): Invoke gfc_match_type.

	gcc/testsuite/gfortran.dg/
	* dec_type_print.f90: New testcase.

From-SVN: r241518
2016-10-25 15:24:36 +00:00
Fritz Reese ef14476730 Treat form feed as whitespace.
gcc/fortran/
	* gfortran.texi: Document.
	* gfortran.h (gfc_is_whitespace): Include form feed ('\f').

	gcc/testsuite/gfortran.dg/
	* feed_1.f90, feed_2.f90: New testcases.

From-SVN: r241517
2016-10-25 15:20:36 +00:00
Fritz Reese f6d17ecdaf Cleanup -fdec.
gcc/fortran/
	* invoke.texi, gfortran.texi: Touch up documentation of -fdec.
	* gfortran.h (gfc_option): Move flag_dec_structure out of gfc_option.
	* decl.c (match_record_decl, gfc_match_decl_type_spec,
	gfc_match_structure_decl): Ditto.
	* match.c (gfc_match_member_sep): Ditto.
	* options.c (gfc_handle_option): Ditto.
	* lang.opt (fdec-structure): Use Fortran Var for flag_dec_structure.
	* lang.opt (fdec): Use Fortran Var to create flag_dec.
	* options.c (set_dec_flags): With -fdec enable -fcray-pointer,
	-fd-lines-as-comments (default), -fdollar-ok, and legacy std flags.

From-SVN: r241516
2016-10-25 15:13:43 +00:00