Jeff Law [Wed, 26 Oct 2016 16:02:58 +0000 (10:02 -0600)]
* config/m32r/m32r.c (m32r_print_operand): Adjust fallthru comment.
From-SVN: r241571
Jeff Law [Wed, 26 Oct 2016 15:59:34 +0000 (09:59 -0600)]
* config/mcore/mcore.c (mcore_gen_compare): Adjust fallthru comments.
From-SVN: r241569
Jeff Law [Wed, 26 Oct 2016 15:52:41 +0000 (09:52 -0600)]
microblaze.c (microblaze_function_arg): Adjust fallthru comment.
* config/microblaze/microblaze.c (microblaze_function_arg): Adjust
fallthru comment.
From-SVN: r241568
Jeff Law [Wed, 26 Oct 2016 15:49:25 +0000 (09:49 -0600)]
msp430.c (msp430_legitimate_address_p): Adjust fallthru comment.
* config/msp430/msp430.c (msp430_legitimate_address_p): Adjust
fallthru comment.
From-SVN: r241567
Jeff Law [Wed, 26 Oct 2016 15:47:48 +0000 (09:47 -0600)]
* config/nios2/nios2.c (nios2_rtx_costs): Avoid fallthru.
From-SVN: r241566
Jeff Law [Wed, 26 Oct 2016 15:42:11 +0000 (09:42 -0600)]
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
Jeff Law [Wed, 26 Oct 2016 15:36:48 +0000 (09:36 -0600)]
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
Edward Smith-Rowland [Wed, 26 Oct 2016 15:34:18 +0000 (15:34 +0000)]
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
Jeff Law [Wed, 26 Oct 2016 15:25:27 +0000 (09:25 -0600)]
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
Jeff Law [Wed, 26 Oct 2016 15:20:33 +0000 (09:20 -0600)]
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
Jonathan Wakely [Wed, 26 Oct 2016 15:20:04 +0000 (16:20 +0100)]
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
Jeff Law [Wed, 26 Oct 2016 15:17:16 +0000 (09:17 -0600)]
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
Paul Thomas [Wed, 26 Oct 2016 14:48:02 +0000 (14:48 +0000)]
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
Jonathan Wakely [Wed, 26 Oct 2016 13:34:34 +0000 (14:34 +0100)]
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
Michael Matz [Wed, 26 Oct 2016 12:54:30 +0000 (12:54 +0000)]
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
Fritz Reese [Wed, 26 Oct 2016 12:11:44 +0000 (12:11 +0000)]
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
Jonathan Wakely [Wed, 26 Oct 2016 11:29:36 +0000 (12:29 +0100)]
PR78111 fix fallback code for filesystem::canonical
PR libstdc++/78111
* src/filesystem/ops.cc (canonical): Set error for non-existent path.
From-SVN: r241549
Uros Bizjak [Wed, 26 Oct 2016 11:29:31 +0000 (13:29 +0200)]
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
Georg-Johann Lay [Wed, 26 Oct 2016 09:46:44 +0000 (09:46 +0000)]
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
GCC Administrator [Wed, 26 Oct 2016 00:16:17 +0000 (00:16 +0000)]
Daily bump.
From-SVN: r241545
Jeff Law [Tue, 25 Oct 2016 22:31:57 +0000 (16:31 -0600)]
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
Will Schmidt [Tue, 25 Oct 2016 21:34:14 +0000 (21:34 +0000)]
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
Paul Thomas [Tue, 25 Oct 2016 20:37:05 +0000 (20:37 +0000)]
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
Eric Botcazou [Tue, 25 Oct 2016 20:15:44 +0000 (20:15 +0000)]
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
Jakub Jelinek [Tue, 25 Oct 2016 20:15:20 +0000 (22:15 +0200)]
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
David Malcolm [Tue, 25 Oct 2016 19:24:01 +0000 (19:24 +0000)]
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
Fritz Reese [Tue, 25 Oct 2016 18:27:51 +0000 (18:27 +0000)]
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
David Malcolm [Tue, 25 Oct 2016 18:10:44 +0000 (18:10 +0000)]
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
Jason Merrill [Tue, 25 Oct 2016 17:23:44 +0000 (13:23 -0400)]
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
Eric Botcazou [Tue, 25 Oct 2016 17:11:49 +0000 (17:11 +0000)]
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
Andre Vehreschild [Tue, 25 Oct 2016 17:01:58 +0000 (19:01 +0200)]
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
David Malcolm [Tue, 25 Oct 2016 16:46:54 +0000 (16:46 +0000)]
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
Jakub Jelinek [Tue, 25 Oct 2016 16:26:12 +0000 (18:26 +0200)]
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
Cesar Philippidis [Tue, 25 Oct 2016 15:47:12 +0000 (08:47 -0700)]
intrinsic.texi (cosd): New mathop.
gcc/fortran/
* intrinsic.texi (cosd): New mathop.
From-SVN: r241523
Jonathan Wakely [Tue, 25 Oct 2016 15:32:52 +0000 (16:32 +0100)]
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
Jonathan Wakely [Tue, 25 Oct 2016 15:32:37 +0000 (16:32 +0100)]
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
Fritz Reese [Tue, 25 Oct 2016 15:30:51 +0000 (15:30 +0000)]
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
Fritz Reese [Tue, 25 Oct 2016 15:27:39 +0000 (15:27 +0000)]
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
Fritz Reese [Tue, 25 Oct 2016 15:24:36 +0000 (15:24 +0000)]
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
Fritz Reese [Tue, 25 Oct 2016 15:20:36 +0000 (15:20 +0000)]
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
Fritz Reese [Tue, 25 Oct 2016 15:13:43 +0000 (15:13 +0000)]
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
Jeff Law [Tue, 25 Oct 2016 15:02:32 +0000 (09:02 -0600)]
Add BZ marker to recent commit
From-SVN: r241515
David Malcolm [Tue, 25 Oct 2016 14:47:38 +0000 (14:47 +0000)]
go-lang.c: remove a redundant cast
gcc/go/ChangeLog:
* go-lang.c (go_langhook_type_for_mode): Remove redundant cast
from result of GET_MODE_CLASS. Minor formatting fixes.
From-SVN: r241514
Jeff Law [Tue, 25 Oct 2016 14:39:34 +0000 (08:39 -0600)]
v850.c (v850_handle_data_area_attribute): Fix fallthru comment.
* config/v850/v850.c (v850_handle_data_area_attribute): Fix fallthru
comment.
(v850_output_aligned_bss): Add missing break.
From-SVN: r241513
Jeff Law [Tue, 25 Oct 2016 14:33:16 +0000 (08:33 -0600)]
* config/m68k/m68k.c (m68k_get_reloc_decoration): Add gcc_unreachable.
From-SVN: r241512
Martin Liska [Tue, 25 Oct 2016 14:16:10 +0000 (16:16 +0200)]
Fix not caught use-after-scope with -O1 (PR sanitize/78106)
PR sanitizer/78106
* sanopt.c (imm_dom_path_with_freeing_call): Handle gasm
statements as they can also contain possibly a freeing call.
PR sanitizer/78106
* gcc.dg/asan/pr78106.c: New test.
From-SVN: r241511
Martin Liska [Tue, 25 Oct 2016 12:20:19 +0000 (12:20 +0000)]
Fix 2 typos in IPA ICF pass
* gcc.dg/ipa/ipa-icf-32.c: Removed one scanned pattern.
Martin Liska <mliska@suse.cz>
PR ipa/78099
* common.opt: Mark flag_ipa_icf_variables as Optimization flag.
* ipa-icf.c (sem_function::get_hash): Add target optimization
node to hash.
From-SVN: r241510
Jakub Jelinek [Tue, 25 Oct 2016 10:47:47 +0000 (12:47 +0200)]
* parser.c (cp_parser_postfix_expression): Adding missing break;.
From-SVN: r241509
Wilco Dijkstra [Tue, 25 Oct 2016 10:25:28 +0000 (10:25 +0000)]
With -fpu=neon DI mode shifts are expanded after reload.
With -fpu=neon DI mode shifts are expanded after reload. DI mode registers can
either fully or partially overlap on both ARM and Thumb-2. However the shift
expansion code can only deal with the full overlap case, and generates incorrect
code for partial overlaps. The fix is to add new variants that support either
full overlap or no overlap.
gcc/
PR target/78041
* config/arm/neon.md (ashldi3_neon): Add "r 0 i" and "&r r i" variants.
Remove partial overlap check for shift by 1.
(ashldi3_neon): Likewise.
testsuite/
* gcc.target/arm/pr78041.c: New test.
From-SVN: r241508
Thomas Preud'homme [Tue, 25 Oct 2016 09:18:46 +0000 (09:18 +0000)]
constraints.md (Q constraint): Document its use for Thumb-1.
2016-10-25 Thomas Preud'homme <thomas.preudhomme@arm.com>
gcc/
* config/arm/constraints.md (Q constraint): Document its use for
Thumb-1.
(Pf constraint): New constraint for relaxed, consume or relaxed memory
models.
* config/arm/sync.md (atomic_load<mode>): Add new ARMv8-M Baseline only
alternatives to allow any register when memory model matches Pf and
thus lda is used, but only low registers otherwise. Use unpredicated
output template for Thumb-1 targets.
(atomic_store<mode>): Likewise for stl.
(arm_load_exclusive<mode>): Add new ARMv8-M Baseline only alternative
whose output template does not have predication.
(arm_load_acquire_exclusive<mode>): Likewise.
(arm_load_exclusivesi): Likewise.
(arm_load_acquire_exclusivesi): Likewise.
(arm_store_release_exclusive<mode>): Likewise.
(arm_store_exclusive<mode>): Use unpredicated output template for
Thumb-1 targets.
From-SVN: r241507
Jakub Jelinek [Tue, 25 Oct 2016 08:47:15 +0000 (10:47 +0200)]
internal-fn.def (LAUNDER): New internal function.
* internal-fn.def (LAUNDER): New internal function.
* internal-fn.c (expand_LAUNDER): New function.
c-family/
* c-common.h (enum rid): Add RID_BUILTIN_LAUNDER.
* c-common.c (c_common_reswords): Add __builtin_launder.
cp/
* cp-tree.h (finish_builtin_launder): Declare.
* parser.c (cp_parser_postfix_expression): Handle RID_BUILTIN_LAUNDER.
* semantics.c (finish_builtin_launder): New function.
* pt.c (tsubst_copy_and_build): Handle instantiation of IFN_LAUNDER.
* constexpr.c (cxx_eval_internal_function): Handle IFN_LAUNDER.
(potential_constant_expression_1): Likewise.
testsuite/
* g++.dg/cpp1z/launder1.C: New test.
* g++.dg/cpp1z/launder2.C: New test.
From-SVN: r241506
Georg-Johann Lay [Tue, 25 Oct 2016 08:37:01 +0000 (08:37 +0000)]
Typo.
From-SVN: r241505
Georg-Johann Lay [Tue, 25 Oct 2016 08:35:17 +0000 (08:35 +0000)]
New avt target pass to work around performance loss by PR fix.
gcc/
New avt target pass to work around performance loss by PR fix.
PR target/71676
PR target/71678
* config/avr/avr.md (casesi_<mode>_sequence) [qi,hi]: New insn.
(*cmp<mode>) [qi,qq,uqq,hi,hq,uhq,ha,uha]: Rename to cmp<mode>3.
* config/avr/predicates.md (extend_operator): New.
* config/avr/avr-passes.def (avr_pass_casesi): Register new pass.
* config/avr/avr-protos.h (avr_casei_sequence_check_operands)
(make_avr_pass_casesi): New prototypes.
* config/avr/avr.c (print-rtl.h): Include it.
(pass_data avr_pass_data_casesi): Data for new pass.
(avr_pass_casesi): New class implementing rtl_opt_pass .avr-casesi.
(make_avr_pass_casesi, avr_parallel_insn_from_insns)
(avr_is_casesi_sequence, avr_casei_sequence_check_operands)
(avr_optimize_casesi): New functions.
gcc/testsuite/
PR target/71676
PR target/71678
* gcc.target/avr/pr71676-2.c: New test.
From-SVN: r241504
Georg-Johann Lay [Tue, 25 Oct 2016 08:26:59 +0000 (08:26 +0000)]
re PR target/71676 ([avr] casesi won't handle switch values larger than 16 bits)
gcc/
PR target/71676
PR target/71678
* config/avr/avr.md (casesi): Rewrite avoiding subregs of SI.
gcc/testsuite/
PR target/71676
PR target/71678
* gcc.target/avr/pr71676-1.c: New test.
* gcc.target/avr/pr71676-3.c: New test.
* gcc.target/avr/pr71676.c: New test.
* gcc.target/avr/pr71678.c: New test.
Co-Authored-By: Pitchumani Sivanupandi <pitchumani.sivanupandi@microchip.com>
From-SVN: r241503
GCC Administrator [Tue, 25 Oct 2016 00:16:21 +0000 (00:16 +0000)]
Daily bump.
From-SVN: r241502
Kugan Vivekanandarajah [Mon, 24 Oct 2016 22:31:14 +0000 (22:31 +0000)]
test_frame_common.h: Add noclone attribute such that cloned verions of tested functions are not created.
gcc/testsuite/ChangeLog:
2016-10-24 Kugan Vivekanandarajah <kuganvi@linaro.org>
* gcc.target/aarch64/test_frame_common.h: Add noclone attribute
such that cloned verions of tested functions are not created.
From-SVN: r241499
Jerry DeLisle [Mon, 24 Oct 2016 21:42:29 +0000 (21:42 +0000)]
re PR libfortran/77828 (Linking gfortran-7 compiled program with libgfortran of 5.x allowed but crashes when containing write to string)
2016-10-24 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR fortran/77828
* io/io.h (st_parameter_dt): Reorder for readability and sanity.
* io/transfer.c (data_transfer_init): Remove TODO and enable the
runtime error message, rec= specifier not allowed in STREAM
access.
* libtool-version: Bump major version of libgfortran to 4.
* ioparm.def: Reorder dt parameters to match libgfortran.
* libgfortran.h: Swap definitions of GFC_INTERNAL_UNIT and
GFC_INTERNAL_UNIT4.
From-SVN: r241497
Steven G. Kargl [Mon, 24 Oct 2016 19:21:42 +0000 (19:21 +0000)]
re PR fortran/71895 (ICE in gfc_compare_derived_types, at fortran/interface.c:520)
2016-10-24 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/71895
* interface.c (gfc_compare_derived_types): Convert gcc_assert()
to a gfc_internal_error() to prevent an ICE.
2016-10-24 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/71895
* gfortran.dg/pr71895.f90: New test.
From-SVN: r241493
Jakub Jelinek [Mon, 24 Oct 2016 18:44:30 +0000 (20:44 +0200)]
dwarf2out.c (gen_subprogram_die): Add DW_AT_reference or DW_AT_rvalue_reference attributes.
* dwarf2out.c (gen_subprogram_die): Add DW_AT_reference or
DW_AT_rvalue_reference attributes.
* cp-objcp-common.c (cp_decl_dwarf_attribute): Handle DW_AT_reference
and DW_AT_rvalue_reference.
* g++.dg/debug/dwarf2/ref-2.C: New test.
From-SVN: r241492
Florian Weimer [Mon, 24 Oct 2016 18:25:09 +0000 (20:25 +0200)]
PR libgcc/78064: Add missing include directive to unwind-c.c
PR libgcc/78064
* unwind-c.c: Include auto-target.h.
From-SVN: r241491
Bernd Edlinger [Mon, 24 Oct 2016 17:14:41 +0000 (17:14 +0000)]
c-common.c (c_common_truthvalue_conversion): Warn for multiplications in boolean context.
2016-10-24 Bernd Edlinger <bernd.edlinger@hotmail.de>
* c-common.c (c_common_truthvalue_conversion): Warn for
multiplications in boolean context. Fix the quoting of '<<' and '<'
in the shift warning.
gcc:
2016-10-24 Bernd Edlinger <bernd.edlinger@hotmail.de>
* doc/invoke.text (Wint-in-bool-context): Update documentation.
* value-prof.c (stringop_block_profile): Fix a warning.
testsuite:
2016-10-24 Bernd Edlinger <bernd.edlinger@hotmail.de>
* c-c++-common/Wint-in-bool-context-3.c: New test.
From-SVN: r241490
Martin Sebor [Mon, 24 Oct 2016 16:53:20 +0000 (16:53 +0000)]
PR middle-end/77735 - FAIL: gcc.dg/tree-ssa/builtin-sprintf-warn-1.c
gcc/ChangeLog:
PR middle-end/77735
* builtins.c (string_length): New function.
(c_strlen): Use string_length. Correctly handle wide strings.
* gimple-ssa-sprintf.c (target_max_value, target_size_max): New
functions.
(target_int_max): Call target_max_value.
(format_result::knownrange): New data member.
(fmtresult::fmtresult): Define default constructor.
(format_integer): Use it and set format_result::knownrange.
Handle global constants.
(format_floating_max): Add third argument.
(format_floating): Recompute maximum value for %a for each argument.
(get_string_length): Use fmtresult default ctor.
(format_string): Set format_result::knownrange.
(format_directive): Check format_result::knownrange.
(add_bytes): Same. Correct caret placement in diagnostics.
(pass_sprintf_length::compute_format_length): Set
format_result::knownrange.
(pass_sprintf_length::handle_gimple_call): Use target_size_max.
gcc/testsuite/ChangeLog:
PR middle-end/77735
* gcc.dg/tree-ssa/builtin-sprintf-2.c: Add test cases.
* gcc.dg/tree-ssa/builtin-sprintf-warn-1.c: Same.
* gcc.dg/tree-ssa/builtin-sprintf-warn-2.c: Same.
* gcc.dg/tree-ssa/builtin-sprintf-warn-3.c: Adjust/relax.
* gcc.dg/tree-ssa/builtin-sprintf-warn-4.c: Add test cases.
* gcc.dg/tree-ssa/builtin-sprintf-warn-6.c: XFAIL for LP64 only.
* gcc.dg/tree-ssa/builtin-sprintf.c: Add test cases.
From-SVN: r241489
Jonathan Wakely [Mon, 24 Oct 2016 16:45:55 +0000 (17:45 +0100)]
Fix error handling in filesystem::is_empty
* src/filesystem/ops.cc (is_empty): Fix error handling.
* testsuite/experimental/filesystem/operations/is_empty.cc: New test.
From-SVN: r241488
Jonathan Wakely [Mon, 24 Oct 2016 16:45:51 +0000 (17:45 +0100)]
PR71337 fix filesystem::temp_directory_path error handling
PR libstdc++/71337
* src/filesystem/ops.cc (temp_directory_path): Pass error_code
argument to other filesystem operations.
* testsuite/experimental/filesystem/operations/temp_directory_path.cc:
Add testcase for inaccessible directory.
From-SVN: r241487
Jonathan Wakely [Mon, 24 Oct 2016 16:45:45 +0000 (17:45 +0100)]
Make directory iterators become end iterator on error
* src/filesystem/dir.cc (open_dir): Return same value for errors
whether ignored or not.
(_Dir::advance(error_code*, directory_options)): Return false on
error.
(directory_iterator(const path&, directory_options, error_code*)):
Create end iterator on error (LWG 2723).
(recursive_directory_iterator(const path&, directory_options,
error_code*)): Likewise.
* testsuite/experimental/filesystem/iterators/directory_iterator.cc:
Update expected behaviour on error.
* testsuite/experimental/filesystem/iterators/
recursive_directory_iterator.cc: Likewise.
From-SVN: r241486
Jonathan Wakely [Mon, 24 Oct 2016 16:45:40 +0000 (17:45 +0100)]
Do not retry failed close(3) in filesystem::copy
* src/filesystem/ops.cc (close_fd): Remove.
(do_copy_file): Just use close(3) instead of close_fd, to prevent
retrying on error.
From-SVN: r241485
Jonathan Wakely [Mon, 24 Oct 2016 16:45:31 +0000 (17:45 +0100)]
Implement DR resolutions for filesystem::copy
* src/filesystem/ops.cc (do_copy_file): Return an error if either
source or destination is not a regular file.
(copy): Update comment to refer to LWG 2681. Implement 2682 and 2683
resolutions.
(read_symlink): Add missing ec.clear().
* testsuite/experimental/filesystem/operations/copy.cc: Update
expected behaviour for copying directories with create_symlinks.
Verify that error_code arguments are cleared if there's no error.
* testsuite/experimental/filesystem/operations/read_symlink.cc: New.
From-SVN: r241484
Moritz Klammler [Mon, 24 Oct 2016 16:05:48 +0000 (16:05 +0000)]
download_prerequisites: Conditionally verify checksums of downloaded pacakges.
2016-10-24 Moritz Klammler <moritz@glammler.eu>
* download_prerequisites: Conditionally verify checksums of
downloaded pacakges. Add help text.
* prerequisites.md5: New file.
* prerequisites.sha512: New file.
From-SVN: r241483
Jakub Jelinek [Mon, 24 Oct 2016 16:05:09 +0000 (18:05 +0200)]
trans-intrinsic.c (gfc_conv_intrinsic_minmax): Use VAR_P (x) instead of TREE_CODE (x) == VAR_DECL.
* trans-intrinsic.c (gfc_conv_intrinsic_minmax): Use VAR_P (x)
instead of TREE_CODE (x) == VAR_DECL.
* trans-expr.c (gfc_class_vptr_get, gfc_class_len_get,
gfc_class_len_or_zero_get, gfc_get_vptr_from_expr,
gfc_conv_string_length, conv_base_obj_fcn_val,
gfc_conv_procedure_call, gfc_trans_assignment_1): Likewise.
* trans-openmp.c (gfc_omp_predetermined_sharing,
gfc_omp_disregard_value_expr, gfc_omp_private_debug_clause,
gfc_trans_omp_atomic, gfc_trans_omp_do): Likewise.
* trans-io.c (nml_get_addr_expr): Likewise.
* trans-decl.c (gfc_finish_decl, gfc_build_qualified_array,
gfc_get_symbol_decl, gfc_get_fake_result_decl,
gfc_trans_deferred_vars, gfc_trans_use_stmts,
generate_local_decl): Likewise.
* trans-array.c (trans_array_constructor, trans_array_bound_check,
build_class_array_ref, gfc_array_init_size,
gfc_trans_auto_array_allocation, gfc_trans_g77_array,
gfc_trans_dummy_array_bias, gfc_alloc_allocatable_for_assignment,
gfc_trans_deferred_array): Likewise.
* trans.c (gfc_build_array_ref): Likewise. Use
VAR_OR_FUNCTION_DECL_P (x) instead of TREE_CODE (x) == VAR_DECL
|| TREE_CODE (x) == FUNCTION_DECL.
From-SVN: r241482
Jakub Jelinek [Mon, 24 Oct 2016 16:04:37 +0000 (18:04 +0200)]
i386.c (ix86_in_large_data_p, [...]): Use VAR_P (x) instead of TREE_CODE (x) == VAR_DECL.
* config/i386/i386.c (ix86_in_large_data_p, ix86_expand_builtin): Use
VAR_P (x) instead of TREE_CODE (x) == VAR_DECL.
From-SVN: r241481
Jakub Jelinek [Mon, 24 Oct 2016 16:04:01 +0000 (18:04 +0200)]
cxx-pretty-print.c (pp_cxx_check_constraint): Use VAR_P (x) instead of TREE_CODE (x) == VAR_DECL.
* cxx-pretty-print.c (pp_cxx_check_constraint): Use VAR_P (x)
instead of TREE_CODE (x) == VAR_DECL.
* constraint.cc (get_concept_definition): Likewise.
(finish_shorthand_constraint): Likewise.
* init.c (warn_placement_new_too_small): Likewise.
* cp-gimplify.c (cp_genericize_r): Likewise.
From-SVN: r241480
Ville Voutilainen [Mon, 24 Oct 2016 13:22:11 +0000 (16:22 +0300)]
Cross-port exception-safety and move fixes of std::any to std::experimental::any.
Cross-port exception-safety and move fixes of std::any to
std::experimental::any.
* include/experimental/any (operator=(const any&)):
Make strongly exception-safe.
(operator=(any&&)): clear() unconditionally in the case where
rhs has a value.
(_Manager_internal<_Tp>::_S_manage): Move in _Op_xfer, don't copy.
* testsuite/experimental/any/assign/2.cc: Adjust.
* testsuite/experimental/any/assign/exception.cc: New.
* testsuite/experimental/any/cons/2.cc: Adjust.
* testsuite/experimental/any/misc/any_cast_neg.cc: Ajust.
From-SVN: r241479
Richard Biener [Mon, 24 Oct 2016 12:58:20 +0000 (12:58 +0000)]
re PR testsuite/71491 (gcc.dg/vect/slp-43.c FAILs)
2016-10-24 Richard Biener <rguenther@suse.de>
PR testsuite/71491
* gcc.dg/vect/slp-43.c: Adjust for !vect_hw_misalign.
* gcc.dg/vect/slp-45.c: Likewise.
From-SVN: r241478
Ville Voutilainen [Mon, 24 Oct 2016 12:46:44 +0000 (15:46 +0300)]
Cross-port the latest resolution of LWG2756 and some bug-fixes to experimental::optional.
Cross-port the latest resolution of LWG2756 and some
bug-fixes to experimental::optional.
PR libstdc++/77288
PR libstdc++/77727
* include/experimental/optional (_Optional_base):
Remove constructors that take a _Tp.
(__is_optional_impl, __is_optional): Remove.
(__converts_from_optional): New.
(optional(_Up&&)): Fix constraints, call base with in_place.
(optional(const optional<_Up>&)): Fix constraints, use emplace.
(optional(optional<_Up>&&)): Likewise.
(operator=(_Up&&)): Fix constraints.
(operator=(const optional<_Up>&)): Likewise.
(operator=(optional<_Up>&&)): Likewise.
(emplace(_Args&&...)): Constrain.
(emplace(initializer_list<_Up>, _Args&&...)): Likewise.
* testsuite/experimental/optional/77288.cc: New.
* testsuite/experimental/optional/assignment/5.cc: Adjust.
* testsuite/experimental/optional/cons/77727.cc: New.
* testsuite/experimental/optional/cons/value.cc: Adjust.
From-SVN: r241476
Jonathan Wakely [Mon, 24 Oct 2016 12:25:28 +0000 (13:25 +0100)]
Make vector::data() return type consistent in C++98
* include/bits/stl_vector.h (vector::_M_data_ptr, vector::data):
Change return type of non-standard C++98 extension to match C++11.
From-SVN: r241475
Ximin Luo [Mon, 24 Oct 2016 11:57:27 +0000 (12:57 +0100)]
re PR debug/77985 (DW_AT_comp_dir is omitted when filename is absolute and the file does not contain a specific typedef)
2016-10-24 Ximin Luo <infinity0@pwned.gg>
PR debug/77985
* dwarf2out.c (file_table_relative_p): Remove.
(gen_compile_unit_die, dwarf2out_early_finish): Emit DW_AT_comp_dir
also for absolute paths.
* doc/tm.texi: Update.
* doc/tm.texi.in (SDB and DWARF) <TARGET_FORCE_AT_COMP_DIR>: Remove.
* target.def (force_at_comp_dir): Remove hook.
* config/darwin.h (TARGET_FORCE_AT_COMP_DIR): Remove define.
From-SVN: r241473
Paul Thomas [Mon, 24 Oct 2016 11:45:17 +0000 (11:45 +0000)]
Remove dead wood from trans-expr.c
From-SVN: r241472
Kyrylo Tkachov [Mon, 24 Oct 2016 11:23:36 +0000 (11:23 +0000)]
[check_GNU_style.sh] More aggressively ignore dg-xxx directives
* check_GNU_style.sh (remove_testsuite): New function.
Use it to remove testsuite from the diff.
From-SVN: r241471
Richard Biener [Mon, 24 Oct 2016 11:22:42 +0000 (11:22 +0000)]
tree-vrp.c (evrp_dom_walker::before_dom_children): Ignore backedges when identifying the single predecessor to take conditional...
2016-10-24 Richard Biener <rguenther@suse.de>
* tree-vrp.c (evrp_dom_walker::before_dom_children): Ignore
backedges when identifying the single predecessor to take
conditional info from. Use SCEV to get at ranges for loop IVs.
* lto-streamer-out.c (lto_write_mode_table): CSE inner mode to
avoid false warning.
* gcc.dg/tree-ssa/cunroll-13.c: Disable EVRP.
* gcc.dg/tree-ssa/pr21458.c: Likewise.
* gcc.dg/tree-ssa/pr21458-2.c: New testcase for EVRP.
From-SVN: r241470
Rainer Orth [Mon, 24 Oct 2016 11:18:21 +0000 (11:18 +0000)]
Parallelize check-gnat
* gcc-interface/Make-lang.in (lang_checks_parallelized): New target.
(check_gnat_parallelize): Likewise.
From-SVN: r241469
Georg-Johann Lay [Mon, 24 Oct 2016 11:02:51 +0000 (11:02 +0000)]
re PR target/78093 ([avr] New variable attribute "absdata" and option "-mabsdata" to enable LDS / STS on Reduced Tiny)
gcc/
PR target/78093
* doc/extend.texi (AVR Variable Attributes) [absdata]: Document it.
* config/avr/avr.c (AVR_SYMBOL_FLAG_TINY_ABSDATA): New macro.
(avr_address_tiny_absdata_p): New static function.
(avr_legitimate_address_p, avr_legitimize_address) [AVR_TINY]: Use
it to determine validity of constant addresses.
(avr_attribute_table) [absdata]: New variable attribute...
(avr_handle_absdata_attribute): ...and handler.
(avr_decl_absdata_p): New static function.
(avr_encode_section_info) [AVR_TINY]: Use it to add flag
AVR_SYMBOL_FLAG_TINY_ABSDATA to respective symbols_refs.
(avr_address_cost) [AVR_TINY]: absdata addresses cost 2.
gcc/testsuite/
PR target/78093
* lib/target-supports.exp (check_effective_target_avr_tiny): New proc.
* gcc.target/avr/torture/tiny-absdata-1.c: New test.
From-SVN: r241468
Richard Biener [Mon, 24 Oct 2016 10:31:03 +0000 (10:31 +0000)]
re PR tree-optimization/78076 (Conditional jump or move depends on uninitialised value @ tree-vect-loop.c:2307)
2016-10-24 Richard Biener <rguenther@suse.de>
PR tree-optimization/78076
* tree-ssa-loop-split.c (tree_ssa_split_loops): Reset aux
also on the loop tree root.
From-SVN: r241467
Andre Vieira [Mon, 24 Oct 2016 08:57:45 +0000 (08:57 +0000)]
pure-code.exp: Restore saved globals.
2016-10-24 Andre Vieira <andre.simoesdiasvieira@arm.com>
* gcc.target/arm/pure-code/pure-code.exp: Restore saved globals.
From-SVN: r241466
Jakub Jelinek [Mon, 24 Oct 2016 08:29:42 +0000 (10:29 +0200)]
i386.c (ix86_fold_builtin): Handle IX86_BUILTIN_BEXTR{,I}{32,64}...
* config/i386/i386.c (ix86_fold_builtin): Handle
IX86_BUILTIN_BEXTR{,I}{32,64}, IX86_BUILTIN_BZHI{32,64},
IX86_BUILTIN_PDEP{32,64} and IX86_BUILTIN_PEXT{32,64}.
(ix86_gimple_fold_builtin): Handle IX86_BUILTIN_BZHI{32,64},
IX86_BUILTIN_PDEP{32,64} and IX86_BUILTIN_PEXT{32,64}.
* gcc.target/i386/bmi2-pext-1.c: New test.
* gcc.target/i386/bmi2-pdep-1.c: New test.
* gcc.target/i386/bmi2-bzhi-3.c: New test.
* gcc.target/i386/tbm-bextri-1.c: New test.
* gcc.target/i386/bmi-bextr-6.c: New test.
From-SVN: r241465
Rainer Orth [Mon, 24 Oct 2016 08:07:27 +0000 (08:07 +0000)]
Work around 32-bit i386 STV testcases failing with -mstackrealign (PR target/77483)
PR target/77483
* gcc.target/i386/mask-unpack.c (dg-options): Add -mno-stackrealign.
* gcc.target/i386/pr65105-1.c: Likewise.
* gcc.target/i386/pr65105-2.c: Likewise.
* gcc.target/i386/pr65105-3.c: Likewise.
* gcc.target/i386/pr65105-5.c: Likewise.
* gcc.target/i386/pr67761.c: Likewise.
* gcc.target/i386/pr70799-1.c: Likewise.
From-SVN: r241464
Martin Liska [Mon, 24 Oct 2016 07:00:53 +0000 (09:00 +0200)]
Do not disable aggressive loop opts for
PR sanitizer/77966
* opts.c (finish_options): Skip conditionally.
PR sanitizer/77966
* c-c++-common/ubsan/unreachable-3.c: New test.
From-SVN: r241463
GCC Administrator [Mon, 24 Oct 2016 00:16:14 +0000 (00:16 +0000)]
Daily bump.
From-SVN: r241460
Martin Sebor [Sun, 23 Oct 2016 22:38:24 +0000 (22:38 +0000)]
PR target/77837 - missing -Wformat-length warning for %p with null argument on powerpc64
gcc/ChangeLog:
PR target/77837
* config/rs6000/linux.h (TARGET_PRINTF_POINTER_FORMAT): Define.
* config/rs6000/linux64.h (TARGET_PRINTF_POINTER_FORMAT): Likewise.
From-SVN: r241457
Steven G. Kargl [Sun, 23 Oct 2016 21:26:44 +0000 (21:26 +0000)]
re PR fortran/77763 (ICE in parse_struct_map, at fortran/parse.c:3064)
2016-10-23 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/77763
* parse.c (parse_spec): Allow STRUCTURE in BLOCK DATA. Sort
case labels.
2016-10-23 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/77763
* gfortran.dg/pr77763.f90
From-SVN: r241454
Eric Botcazou [Sun, 23 Oct 2016 20:31:41 +0000 (20:31 +0000)]
sparc.md (cpu_feature): Minor tweak.
* config/sparc/sparc.md (cpu_feature): Minor tweak.
(enabled): Likewise.
(movsi_insn, movdi_insn_sp32, movdi_insn_sp64, movsf_insn,
movdf_insn_sp32, movdf_insn_sp64, zero_extendsidi2_insn_sp64,
sign_extendsidi2_insn, mov<VM32:mode>_insn, mov<VM64:mode>_insn_sp64,
mov<VM64:mode>_insn_sp32, not_<code><mode>, nand<mode>_vis,
<code>_not1<mode>_vi, <code>_not2<mode>_vis, one_cmpl<mode>2,
fcmp<code><GCM:gcm_name>, pdistn<mode>_vis): Likewise.
From-SVN: r241452
Steven G. Kargl [Sun, 23 Oct 2016 18:12:28 +0000 (18:12 +0000)]
re PR fortran/54730 (ICE in gfc_typenode_for_spec, at fortran/trans-types.c:1066)
2016-10-23 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/54730
PR fortran/78033
* array.c (gfc_match_array_constructor): Remove checkpointing
introduced in r196416 (original fix for PR fortran/54730). Move
initialization to top of function.
* match.c (gfc_match_type_spec): Special case matching for REAL.
2016-10-23 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/54730
PR fortran/78033
* gfortran.dg/pr78033.f90: New test.
From-SVN: r241451
Paul Thomas [Sun, 23 Oct 2016 18:09:14 +0000 (18:09 +0000)]
re PR fortran/69834 ([OOP] Collision in derived type hashes)
2016-10-23 Paul Thomas <pault@gcc.gnu.org>
PR fortran/69834
* class.c (gfc_find_derived_vtab): Obtain the gsymbol for the
derived type's module. If the gsymbol is present and the top
level namespace corresponds to a module, use the gsymbol name
space. In the search to see if the vtable exists, try the gsym
namespace first.
* dump-parse-tree (show_code_node): Modify select case dump to
show select type construct.
* resolve.c (build_loc_call): New function.
(resolve_select_type): Add check for repeated type is cases.
Retain selector expression and use it later instead of expr1.
Exclude deferred length TYPE IS cases and emit error message.
Store the address for the vtable in the 'low' expression and
the hash value in the 'high' expression, for each case. Do not
call resolve_select.
* trans.c(trans_code) : Call gfc_trans_select_type.
* trans-stmt.c (gfc_trans_select_type_cases): New function.
(gfc_trans_select_type): New function.
* trans-stmt.h : Add prototype for gfc_trans_select_type.
2016-10-23 Paul Thomas <pault@gcc.gnu.org>
PR fortran/69834
* gfortran.dg/select_type_1.f03: Change error for overlapping
TYPE IS cases.
* gfortran.dg/select_type_36.f03: New test.
From-SVN: r241450
Eric Botcazou [Sun, 23 Oct 2016 10:55:04 +0000 (10:55 +0000)]
sparc-c.c (sparc_target_macros): Replace TARGET_64BIT with TARGET_ARCH64.
* config/sparc/sparc-c.c (sparc_target_macros): Replace TARGET_64BIT
with TARGET_ARCH64. Define __VIS to 0x400 if TARGET_VIS4.
From-SVN: r241446
François Dumont [Sun, 23 Oct 2016 10:26:59 +0000 (10:26 +0000)]
2016-10-22 François Dumont <fdumont@gcc.gnu.org>
* include/bits/c++config (_GLIBCXX_BEGIN_NAMESPACE_ALGO)
(_GLIBCXX_END_NAMESPACE_ALGO): Default to respectively
_GLIBCXX_BEGIN_NAMESPACE_VERSION and _GLIBCXX_END_NAMESPACE_VERSION.
(_GLIBCXX_BEGIN_NAMESPACE_CONTAINER, _GLIBCXX_END_NAMESPACE_CONTAINER):
Likewise.
From-SVN: r241445
GCC Administrator [Sun, 23 Oct 2016 00:16:18 +0000 (00:16 +0000)]
Daily bump.
From-SVN: r241444
Eric Botcazou [Sat, 22 Oct 2016 18:23:39 +0000 (18:23 +0000)]
* gcc.dg/tree-ssa/pr71347.c: Remove XFAIL on SPARC.
From-SVN: r241441
Thomas Koenig [Sat, 22 Oct 2016 14:04:46 +0000 (14:04 +0000)]
re PR fortran/78021 (Wrong result with optimization on character constant)
2016-10-22 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/78021
* gfc_compare_functions: Strings with different lengths in
argument lists compare unequal.
2016-10-22 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/78021
* gfortran.dg/string_length_3.f90: New test.
From-SVN: r241440
Andre Vehreschild [Sat, 22 Oct 2016 12:33:38 +0000 (14:33 +0200)]
re PR fortran/43366 ([OOP][F08] Intrinsic assign to polymorphic variable)
gcc/fortran/ChangeLog:
2016-10-22 Andre Vehreschild <vehre@gcc.gnu.org>
PR fortran/43366
PR fortran/51864
PR fortran/57117
PR fortran/61337
PR fortran/61376
* primary.c (gfc_expr_attr): For transformational functions on classes
get the attrs from the class argument.
* resolve.c (resolve_ordinary_assign): Remove error message due to
feature implementation. Rewrite POINTER_ASSIGNS to ordinary ones when
the right-hand side is scalar class object (with some restrictions).
* trans-array.c (trans_array_constructor): Create the temporary from
class' inner type, i.e., the derived type.
(build_class_array_ref): Add support for class array's storage of the
class object or the array descriptor in the decl saved descriptor.
(gfc_conv_expr_descriptor): When creating temporaries for class objects
add the class object's handle into the decl saved descriptor.
(structure_alloc_comps): Use the common way to get the _data component.
(gfc_is_reallocatable_lhs): Add notion of allocatable class objects.
* trans-expr.c (gfc_find_and_cut_at_last_class_ref): Remove the only ref
only when the expression's type is BT_CLASS.
(gfc_trans_class_init_assign): Correctly handle class arrays.
(gfc_trans_class_assign): Joined into gfc_trans_assignment_1.
(gfc_conv_procedure_call): Support for class types as arguments.
(trans_get_upoly_len): For unlimited polymorphics retrieve the _len
component's tree.
(trans_class_vptr_len_assignment): Catch all ways to assign the _vptr
and _len components of a class object correctly.
(pointer_assignment_is_proc_pointer): Identify assignments of
procedure pointers.
(gfc_trans_pointer_assignment): Enhance support for class object pointer
assignments.
(gfc_trans_scalar_assign): Removed assert.
(trans_class_assignment): Assign to a class object.
(gfc_trans_assignment_1): Treat class objects correctly.
(gfc_trans_assignment): Propagate flags to trans_assignment_1.
* trans-stmt.c (gfc_trans_allocate): Use gfc_trans_assignment now
instead of copy_class_to_class.
* trans-stmt.h: Function prototype removed.
* trans.c (trans_code): Less special casing for class objects.
* trans.h: Added flags to gfc_trans_assignment () prototype.
gcc/testsuite/ChangeLog:
2016-10-22 Andre Vehreschild <vehre@gcc.gnu.org>
Forgot to add on original commit.
* gfortran.dg/coarray_alloc_comp_2.f08: New test.
2016-10-22 Andre Vehreschild <vehre@gcc.gnu.org>
PR fortran/43366
PR fortran/57117
PR fortran/61337
* gfortran.dg/alloc_comp_class_5.f03: New test.
* gfortran.dg/class_allocate_21.f90: New test.
* gfortran.dg/class_allocate_22.f90: New test.
* gfortran.dg/realloc_on_assign_27.f08: New test.
From-SVN: r241439
Jonathan Wakely [Sat, 22 Oct 2016 11:42:16 +0000 (12:42 +0100)]
Ignore perms::symlink_nofollow on non-symlinks
* src/filesystem/ops.cc (permissions(const path&, perms, error_code&)):
Ignore symlink_nofollow flag if file is not a symlink.
* testsuite/experimental/filesystem/operations/permissions.cc: Test
symlink_nofollow on non-symlinks.
From-SVN: r241438
Andrew Pinski [Sat, 22 Oct 2016 03:40:06 +0000 (03:40 +0000)]
aarch64-cores.def: Rewrite so IMP and PART are integer constants.
2016-10-21 Andrew Pinski <apinski@cavium.com>
* config/aarch64/aarch64-cores.def: Rewrite so IMP and PART are
integer constants.
* config/aarch64/driver-aarch64.c (struct aarch64_core_data): Change
implementer_id to unsigned char.
Change part_no to unsigned int.
(AARCH64_BIG_LITTLE): New define.
(INVALID_IMP): New define.
(INVALID_CORE): New define.
(cpu_data): Change the last element's implementer_id and part_no to
integers.
(valid_bL_string_p): Rewrite to ..
(valid_bL_core_p): this for integers instead of strings.
(parse_field): New function.
(contains_string_p): Rewrite to ...
(contains_core_p): this for integers and only for the part_no.
(host_detect_local_cpu): Rewrite handling of implementation and
par num to be integers; simplifying the code.
From-SVN: r241437