- 16 Aug, 2018 3 commits
-
-
This patch replaces the "Common" attribute in some aarch64 options with "Target" to make them target-dependent. This doesn't affect their behaviour or how they are documented with "--help", but does mean that they follow the option specification that target-specific options are given the "Target" attribute. Tested by ensuring the changed options are still accepted as before and that they aren't invokable from an invalid target. Bootstrapped and regression tested on aarch64-none-elf with ... regressions. 2018-08-16 Sam Tebbs <sam.tebbs@arm.com> * config/aarch64/aarch64.opt (mlow-precision-recip-sqrt) (mlow-precision-sqrt, mlow-precision-div, mverbose-cost-dump): Replace "Common" with "Target". From-SVN: r263578
Sam Tebbs committed -
2018-08-16 Iain Sandoe <iain@sandoe.co.uk> gcc/testsuite * gcc.dg/asan/pr81923.c: Stringify __USER_LABEL_PREFIX__. From-SVN: r263577
Iain Sandoe committed -
From-SVN: r263576
GCC Administrator committed
-
- 15 Aug, 2018 22 commits
-
-
* config/i386/i386.opt (mmitigate-rop): Mark as deprecated. * doc/invoke.texi (mmitigate-rop): Remove. * config/i386/i386.c: Do not include "regrename.h". (ix86_rop_should_change_byte_p, reg_encoded_number) (ix86_get_modrm_for_rop, set_rop_modrm_reg_bits, ix86_mitigate_rop): Remove. (ix86_reorg): Remove call to ix86_mitigate_rop. * config/i386/i386.md (attr "modrm_class"): Remove. (cmp<mode>_ccno_1, mov<mode>_xor, movstrict<mode>_xor) (x86_mov<mode>cc_0_m1. x86_mov<mode>cc_0_m1_se) (x86_mov<mode>cc_0_m1_neg): Remove modrm_class attribute override. testsuite/Changelog: * gcc.target/i386/rop1.c: Remove. * gcc.target/i386/pr83554 (dg-options): Remove -mmitigate-rop. From-SVN: r263572
Uros Bizjak committed -
* ChangeLog: Fix whitespace. * testsuite/ChangeLog: Ditto. From-SVN: r263571
Uros Bizjak committed -
[testsuite] 2018-08-13 Will Schmidt <will_schmidt@vnet.ibm.com> * gcc.target/powerpc/fold-vec-splat-char.c: New. * gcc.target/powerpc/fold-vec-splat-floatdouble.c: New. * gcc.target/powerpc/fold-vec-splat-int.c: New. * gcc.target/powerpc/fold-vec-splat-longlong.c: New. * gcc.target/powerpc/fold-vec-splat-pixel.c: New. * gcc.target/powerpc/fold-vec-splat-short.c: New. From-SVN: r263570
Will Schmidt committed -
rs600.c (rs6000_gimple_fold_builtin): Add entries to allow folding of mergeh() and mergel() for the float and double... [gcc] 2018-08-07 Will Schmidt <will_schmidt@vnet.ibm.com> * config/rs6000/rs600.c (rs6000_gimple_fold_builtin): Add entries to allow folding of mergeh() and mergel() for the float and double types. (fold_mergehl_helper): Rework to handle building a permute tree for float vectors. From-SVN: r263569
Will Schmidt committed -
The typedefs in <experimental/regex> and <experimental/string> don't need to be in the __cxx11 namespace, because they are only aliases and so will have the same mangled name as the underlying types. * include/experimental/regex: Remove begin/end macros for namespace. * include/experimental/string: Likewise. * testsuite/experimental/polymorphic_allocator/pmr_typedefs_deque.cc: New test. * testsuite/experimental/polymorphic_allocator/ pmr_typedefs_forward_list.cc: New test. * testsuite/experimental/polymorphic_allocator/pmr_typedefs_list.cc: New test. * testsuite/experimental/polymorphic_allocator/pmr_typedefs_map.cc: New test. * testsuite/experimental/polymorphic_allocator/pmr_typedefs_match.cc: New test. * testsuite/experimental/polymorphic_allocator/ pmr_typedefs_multimap.cc: New test. * testsuite/experimental/polymorphic_allocator/ pmr_typedefs_multiset.cc: New test. * testsuite/experimental/polymorphic_allocator/pmr_typedefs_set.cc: New test. * testsuite/experimental/polymorphic_allocator/pmr_typedefs_string.cc: New test. * testsuite/experimental/polymorphic_allocator/ pmr_typedefs_unordered_map.cc: New test. * testsuite/experimental/polymorphic_allocator/ pmr_typedefs_unordered_multimap.cc: New test. * testsuite/experimental/polymorphic_allocator/ pmr_typedefs_unordered_multiset.cc: New test. * testsuite/experimental/polymorphic_allocator/ pmr_typedefs_unordered_set.cc: New test. * testsuite/experimental/polymorphic_allocator/pmr_typedefs_vector.cc: New test. From-SVN: r263568
Jonathan Wakely committed -
* config/i386/i386.c (expand_vec_perm_movs): Enable V4SFmode for TARGET_SSE. From-SVN: r263567
Uros Bizjak committed -
Remove duplicated logic in experimental::pmr::polymorphic_allocator by calling the __uses_allocator_construct helper. Fix bugs in std::pmr::polymorphic_allocator with incorrect SFINAE constraint and incorrect argument order. * include/bits/uses_allocator.h (__uses_allocator_construct): Qualify calls to __uses_allocator_construct_impl and __use_alloc. * include/experimental/memory_resource (polymorphic_allocator::_M_construct): Remove. (polymorphic_allocator::construct): Call __uses_allocator_construct. Qualify calls to __use_alloc. * include/std/memory_resource (polymorphic_allocator::construct): Fix type in SFINAE constraint. Use constexpr if instead of tag dispatching to _S_construct overloads. (polymorphic_allocator::construct(pair<T1, T2>*, ...)): Fix order of arguments to _S_construct_p. (polymorphic_allocator::_S_construct): Remove. (polymorphic_allocator::_S_construct_p): Return allocators by value not by reference. * include/std/scoped_allocator (scoped_allocator_adaptor::construct): Qualify calls to __use_alloc. * testsuite/20_util/polymorphic_allocator/construct_pair.cc: New test, copied from testsuite/20_util/scoped_allocator/construct_pair.cc. * testsuite/experimental/polymorphic_allocator/1.cc: New test. * testsuite/experimental/polymorphic_allocator/construct_pair.cc: New test. From-SVN: r263566
Jonathan Wakely committed -
This patch adds the ability to label source ranges within a rich_location, to be printed by diagnostic_show_locus. For example: pr69554-1.c:11:18: error: invalid operands to binary + (have 'const char *' and 'const char *') 11 | return (p + 1) + (q + 1); | ~~~~~~~ ^ ~~~~~~~ | | | | | const char * | const char * The patch implements labels for various type mismatch errors in the C and C++ frontends, and in -Wformat. I implemented it wherever accurate location information was guaranteed (there are other places that could benefit, but we need better location information in those places). The labels can be disabled via -fno-diagnostics-show-labels. Similarly: param-type-mismatch.C: In function 'int test_1(int, int, float)': param-type-mismatch.C:11:27: error: invalid conversion from 'int' to 'const char*' [-fpermissive] 11 | return callee_1 (first, second, third); | ^~~~~~ | | | int param-type-mismatch.C:7:43: note: initializing argument 2 of 'int callee_1(int, const char*, float)' 7 | extern int callee_1 (int one, const char *two, float three); | ~~~~~~~~~~~~^~~ where the first "error" describing the bad argument gets a label describing the type inline (since it's non-obvious from "second"). The "note" describing the type of the param of the callee *doesn't* get a label, since that information is explicit there in the source ("const char *two"). The idea is that in any diagnostic where two aspects of the source aren't in sync it ought to be easier for the user if we directly show them the mismatching aspects inline (e.g. types). As well as type mismatch errors, perhaps labels could also be used for buffer overflow warnings, for describing the capacity of the destination buffer vs the size of what's being written: sprintf (buf, "filename: %s\n", file); ^~~ ~~~~~~~~~~~^~~ | | capacity: 32 10 + strlen(file) + 2 or somesuch. Another idea might be for macro expansion warnings: warning: repeated side effects in macro expansion... x = MIN (p++, q++); ~~~~^~~~~~~~~~ note: ...expanded here as #define MIN(X,Y) (X<Y?X:Y) ^~~ ~ ~ ~ ~ ~ ~ | | | | | | | | | | | q++ | | | | p++ | | | q++ | q++ p++ p++ The patch removes some logic from multiline.exp which special-cased lines ending with a '|' character (thus complicating testing of this patch). I believe that this was a vestige from experiments I did to support strippng dg directives from the output; it was present in the earliest version of multiline.exp I posted: "[RFC, stage1] Richer source location information for gcc 6 (location ranges etc)" https://gcc.gnu.org/ml/gcc-patches/2015-03/msg00837.html and I believe was neved used. gcc/c-family/ChangeLog: * c-format.c: Include "selftest-diagnostic.h" and "gcc-rich-location.h". (format_warning_at_char): Pass NULL for new label params of format_warning_va. (class indirection_suffix): New class. (class range_label_for_format_type_mismatch): New class. (format_type_warning): Move logic for generating "*" suffix to class indirection_suffix. Create "fmt_label" and "param_label" to show their types, and pass them to the format_warning_at_substring calls. (selftest::test_type_mismatch_range_labels): New test. (selftest::c_format_c_tests): Call it. gcc/c/ChangeLog: * c-objc-common.c: Include "gcc-rich-location.h". (c_tree_printer): Move implemenation of '%T' to... (print_type): ...this new function. (range_label_for_type_mismatch::get_text): New function. * c-typeck.c (convert_for_assignment): Add type labels to the rhs range for the various ic_argpass cases. (class maybe_range_label_for_tree_type_mismatch): New class. (build_binary_op): Use it when calling binary_op_error. gcc/cp/ChangeLog: * call.c: Include "gcc-rich-location.h". (convert_like_real): Add range label for "invalid conversion" diagnostic. (perform_implicit_conversion_flags): Add type label to the "could not convert" error. * error.c: Include "gcc-rich-location.h". (range_label_for_type_mismatch::get_text): New function. * typeck.c (convert_for_assignment): Add type label to the "cannot convert" error if a location is available. gcc/ChangeLog: * common.opt (fdiagnostics-show-labels): New option. * diagnostic-show-locus.c (class layout_range): Add field "m_label". (class layout): Add field "m_show_labels_p". (layout_range::layout_range): Add param "label" and use it to initialize m_label. (make_range): Pass in NULL for new "label" param of layout_range's ctor. (layout::layout): Initialize m_show_labels_p. (layout::maybe_add_location_range): Pass in loc_range->m_label when constructing layout_range instances. (struct line_label): New struct. (layout::print_any_labels): New member function. (layout::print_line): Call it if label-printing is enabled. (selftest::test_one_liner_labels): New test. (selftest::test_diagnostic_show_locus_one_liner): Call it. * diagnostic.c (diagnostic_initialize): Initialize context->show_labels_p. * diagnostic.h (struct diagnostic_context): Add field "show_labels_p". * doc/invoke.texi (Diagnostic Message Formatting Options): Add -fno-diagnostics-show-labels. * dwarf2out.c (gen_producer_string): Add OPT_fdiagnostics_show_labels to the ignored options. * gcc-rich-location.c (gcc_rich_location::add_expr): Add "label" param. (gcc_rich_location::maybe_add_expr): Likewise. * gcc-rich-location.h (gcc_rich_location::gcc_rich_location): Add label" param, defaulting to NULL. (gcc_rich_location::add_expr): Add "label" param. (gcc_rich_location::maybe_add_expr): Likewise. (class text_range_label): New class. (class range_label_for_type_mismatch): New class. * gimple-ssa-sprintf.c (fmtwarn): Pass NULL for new label params of format_warning_va. (fmtwarn_n): Likewise for new params of format_warning_n_va. * lto-wrapper.c (merge_and_complain): Add OPT_fdiagnostics_show_labels to the "pick one setting" options. (append_compiler_options): Likewise to the dropped options. (append_diag_options): Likewise to the passed-on options. * opts.c (common_handle_option): Handle the new option. * selftest-diagnostic.c (test_diagnostic_context::test_diagnostic_context): Enable show_labels_p. * substring-locations.c: Include "gcc-rich-location.h". (format_warning_n_va): Add "fmt_label" and "param_label" params and use them as appropriate. (format_warning_va): Add "fmt_label" and "param_label" params, passing them on to format_warning_n_va. (format_warning_at_substring): Likewise. (format_warning_at_substring_n): Likewise. * substring-locations.h (format_warning_va): Add "fmt_label" and "param_label" params. (format_warning_n_va): Likewise. (format_warning_at_substring): Likewise. (format_warning_at_substring_n): Likewise. * toplev.c (general_init): Initialize global_dc->show_labels_p. gcc/testsuite/ChangeLog: * g++.dg/diagnostic/aka3.C: New test. * g++.dg/diagnostic/param-type-mismatch-2.C: Update expected output to show range labels. * g++.dg/diagnostic/param-type-mismatch.C: Likewise. * g++.dg/plugin/plugin.exp (plugin_test_list): Add... * g++.dg/plugin/show-template-tree-color-labels.C: New test. * gcc.dg/bad-binary-ops.c: Update expected output to show range labels. Add an "aka" example. * gcc.dg/cpp/pr66415-1.c: Update expected output to show range labels. * gcc.dg/format/diagnostic-ranges.c: Likewise. * gcc.dg/format/pr72858.c: Likewise. * gcc.dg/format/pr78498.c: Likewise. * gcc.dg/param-type-mismatch.c: Add "-Wpointer-sign" to options. Update expected output to show range labels. Add examples of -Wincompatible-pointer-types and -Wpointer-sign for parameters. * gcc.dg/plugin/diagnostic-test-show-locus-bw-line-numbers.c: Update expected output to show range labels. * gcc.dg/plugin/diagnostic-test-show-locus-bw.c: Likewise. (test_very_wide_line): Adjust so that label is at left-clipping boundary. (test_very_wide_line_2): New test. * gcc.dg/plugin/diagnostic-test-show-locus-color-line-numbers.c: Update expected output to show range labels. * gcc.dg/plugin/diagnostic-test-show-locus-color.c: Likewise. * gcc.dg/plugin/diagnostic-test-show-locus-no-labels.c: New test. * gcc.dg/plugin/diagnostic_plugin_show_trees.c (show_tree): Update for new param to gcc_rich_location::add_expr. * gcc.dg/plugin/diagnostic_plugin_test_show_locus.c (add_range): Add "label" param. (test_show_locus): Add examples of labels to various tests. Tweak the "very wide_line" test case and duplicate it, to cover the boundary values for clipping of labels against the left-margin. * gcc.dg/plugin/plugin.exp (plugin_test_list): Add diagnostic-test-show-locus-no-labels.c. * gcc.dg/pr69554-1.c: Update expected output to show range labels. Update line numbers of dg-locus directives. * gcc.dg/pr69627.c: Update expected output to show range labels. * lib/multiline.exp (proc _build_multiline_regex): Remove special-case handling of lines with trailing '|'. libcpp/ChangeLog: * include/line-map.h (struct location_range): Add "m_label" field. (class rich_location): Add description of labels to leading comment. (rich_location::rich_location): Add "label" param, defaulting to NULL. (rich_location::add_range): Likewise. (struct label_text): New struct. (class range_label): New abstract base class. * line-map.c (rich_location::rich_location): Add "label" param; use it. (rich_location::add_range): Likewise. From-SVN: r263564
David Malcolm committed -
From-SVN: r263563
Qing Zhao committed -
2018-08-15 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org> c/ * c-decl.c (start_decl): Do not warn if variables is named as main and is a local variable. testsuite/ * gcc.dg/wmain.c: New test. From-SVN: r263562
Prathamesh Kulkarni committed -
PR tree-optimization/71625 - missing strlen optimization on different array initialization style (avoid compilation errors on aarch64) gcc/ChangeLog: * config/aarch64/aarch64-builtins.c (aarch64_init_simd_builtin_types): Clear Poly8_t's TYPE_STRING_FLAG. From-SVN: r263561
Martin Sebor committed -
Since there is no branch splitting anymore, the loop is no longer necessary: pool chunkification can be done in one step. gcc/ChangeLog: 2018-08-15 Ilya Leoshkevich <iii@linux.ibm.com> * config/s390/s390.c (s390_reorg): Remove loop. From-SVN: r263557
Ilya Leoshkevich committed -
2018-08-15 Iain Sandoe <iain@sandoe.co.uk> gcc/c: PR c/19315 * c-decl.c (finish_decl): Don't add the 'extern' storage class to objects of unknown size. gcc/testsuite: PR c/19315 gcc.dg/graphite/pr82451.c: Make array 'a' an extern. gcc.dg/redecl-10.c: Expect warnings for the static vars with unknown size. From-SVN: r263556
Iain Sandoe committed -
gcc/ 2018-08-15 Iain Sandoe <iain@sandoe.co.uk> * config/darwin.c (darwin_function_switched_text_sections): Delete. * gcc/config/darwin.h (TARGET_ASM_FUNCTION_SWITCHED_TEXT_SECTIONS): Likewise. From-SVN: r263555
Iain Sandoe committed -
* src/c++17/memory_resource.cc [!_GLIBCXX_HAS_GTHREADS] (atomic_mem_res): Add unsynchronized definition for single-threaded. From-SVN: r263554
Jonathan Wakely committed -
gcc/ 2018-08-15 Iain Sandoe <iain@sandoe.co.uk> PR target/81685 * config/darwin.h: (DEBUG_STR_OFFSETS_SECTION, DEBUG_LOCLISTS_SECTION, DEBUG_RNGLISTS_SECTION) new macros. (DEBUG_PUBNAMES_SECTION, DEBUG_PUBTYPES_SECTION) update to include GNU variant. From-SVN: r263553
Iain Sandoe committed -
2018-08-15 Martin Liska <mliska@suse.cz> PR tree-optimization/86925 * predict.c (expr_expected_value_1): When taking later predictor, assign also probability. Use fold_build2_initializer_loc in order to fold the expression in -frounding-math. 2018-08-15 Martin Liska <mliska@suse.cz> PR tree-optimization/86925 * gcc.dg/predict-20.c: New test. * gcc.dg/predict-21.c: New test. From-SVN: r263552
Martin Liska committed -
decl.c (check_previous_goto_1): When decl_jump_unsafe returns 2 emit an error instead of a permerror. /cp 2018-08-15 Paolo Carlini <paolo.carlini@oracle.com> * decl.c (check_previous_goto_1): When decl_jump_unsafe returns 2 emit an error instead of a permerror. /testsuite 2018-08-15 Paolo Carlini <paolo.carlini@oracle.com> * g++.dg/init/goto3.C: Adjust for error instead of permerror. From-SVN: r263551
Paolo Carlini committed -
Backport of RISC-V support for libffi go closures * src/riscv/ffi.c (ffi_call_go, ffi_prep_go_closure): New functions. (ffi_call_int): Renamed from ffi_call. (ffi_call_asm, ffi_closure_inner): Adjust interface. * src/riscv/ffitarget.h (FFI_GO_CLOSURES): Define. * src/riscv/sysv.S (ffi_go_closure_asm): New function. (ffi_closure_asm, ffi_call_asm): Update for adjusted interfaces. From-SVN: r263550
Andreas Schwab committed -
* config/i386/i386.c (expand_vec_perm_movs): New method matching movs patterns. (expand_vec_perm_1): Try the new method. * gcc.target/i386/sse2-movs.c: New test. From-SVN: r263549
Allan Sandfeld Jensen committed -
re PR target/86547 (s390x: Maximum number of LRA assignment passes is achieved (30) when compiling a small inline assembler snippet) PR target/86547 * lra-lives.c (remove_some_program_points_and_update_live_ranges): Check whether lra_live_max_point is 0 before dividing. From-SVN: r263548
Ilya Leoshkevich committed -
From-SVN: r263547
GCC Administrator committed
-
- 14 Aug, 2018 11 commits
-
-
* configure.ac: Check for <sys/random.h>. * configure, config.h.in: Regenerate. * intrinsics/random.c [HAVE_SYS_RANDOM_H]: Include <sys/random.h>. From-SVN: r263543
Rainer Orth committed -
As explained in the PR, there's no reason to call the nothrow delete, we can just use the normal one. PR libstdc++/86954 * include/bits/stl_tempbuf.h (return_temporary_buffer): Use non-placement delete. From-SVN: r263542
Jonathan Wakely committed -
gcc/ChangeLog: PR tree-optimization/86650 * tree-vrp.c (vrp_prop::check_array_ref): Print an inform message. (vrp_prop::check_mem_ref): Same. gcc/testsuite/ChangeLog: PR tree-optimization/86650 * gcc.dg/Warray-bounds-34.c: New test. From-SVN: r263541
Martin Sebor committed -
2018-08-14 Janus Weil <janus@gcc.gnu.org> PR fortran/86116 * interface.c (compare_type): Remove a CLASS/TYPE check. (compare_type_characteristics): New function that behaves like the old 'compare_type'. (gfc_check_dummy_characteristics, gfc_check_result_characteristics): Call 'compare_type_characteristics' instead of 'compare_type'. 2018-08-14 Janus Weil <janus@gcc.gnu.org> PR fortran/86116 * gfortran.dg/generic_34.f90: New test case. From-SVN: r263540
Janus Weil committed -
* include/std/chrono (__check_overflow): Simplify definition. (_Checked_integral_constant): Remove. From-SVN: r263537
Jonathan Wakely committed -
Define a class using std::mutex for when std::atomic<memory_resource*> cannot be used to implement the default memory resource. When std::mutex constructor is not constexpr the constant_init trick won't work, so just define a global and use init_priority for it. The compiler warns about using reserved priority, so put the definition in a header file using #pragma GCC system_header to suppress the warning. PR libstdc++/86846 * src/c++17/default_resource.h: New file, defining default_res. * src/c++17/memory_resource.cc [ATOMIC_POINTER_LOCK_FREE != 2] (atomic_mem_res): Define alternative for atomic<memory_resource*> using a mutex instead of atomics. From-SVN: r263536
Jonathan Wakely committed -
[ios::failure] p2: "When throwing ios_base::failure exceptions, implementations should provide values of ec that identify the specific reason for the failure." This adds a new overload of __throw_ios_failure that can be passed errno, to store error_code(errno, system_category()) in the exception object. PR libstdc++/85343 * acinclude.m4 (libtool_VERSION): Bump version. * config/abi/pre/gnu.ver (GLIBCXX_3.4.26): Add new symbol version. Export new symbol. * configure: Regenerate. * doc/xml/manual/abi.xml: Document new versions. * include/bits/fstream.tcc (basic_filebuf<C, T>::underflow) (basic_filebuf<C, T>::xsgetn): Pass errno to __throw_ios_failure. * include/bits/functexcept.h (__throw_ios_failure(const char*, int)): Declare new overload. * src/c++11/cxx11-ios_failure.cc (__ios_failure): Add new constructor and static member function. (__throw_ios_failure(const char*, int)): Define. * src/c++98/ios_failure.cc [!_GLIBCXX_USE_DUAL_ABI] (__throw_ios_failure(const char*, int)): Define. * testsuite/util/testsuite_abi.cc: Update known and latest versions. From-SVN: r263535
Jonathan Wakely committed -
Rope iterators sometimes contain pointers to an internal buffer inside the iterator itself. When such an iterator is copied, the copy incorrectly retains pointers to the original. This patch takes the simple approach of not copying the cached information when the internal buffer is being used, instead requiring it to be recomputed when the copied iterator is dereferenced. An alternative would be to adjust the pointers so they refer to the buffer in the copy. 2018-08-14 Jeremy Sawicki <jeremy-gcc@sawicki.us> * include/ext/rope (_Rope_iterator_base(const _Rope_iterator_base&)) (_Rope_const_iterator::operator=(const _Rope_const_iterator&)) (_Rope_iterator::operator=(const _Rope_iterator&)): Ensure copied/assigned rope iterators don't retain pointers to the iterator they were copied/assigned from. * testsuite/ext/rope/7.cc: New. From-SVN: r263534
Jeremy Sawicki committed -
* gcc/pretty-print.c (eat_esc_sequence): Swap the foreground and background colors if the COMMON_LVB_REVERSE_VIDEO flag is set, and clear it thereafter, as it only works for DBCS. From-SVN: r263531
Liu Hao committed -
pretty-print.c (mingw_ansi_fputs): Do not call _close() on the handle returned by _get_osf_handle(). * gcc/pretty-print.c (mingw_ansi_fputs): Do not call _close() on the handle returned by _get_osf_handle(). From-SVN: r263530
Liu Hao committed -
From-SVN: r263527
GCC Administrator committed
-
- 13 Aug, 2018 4 commits
-
-
PR c++/57891 * call.c (struct conversion): Add check_narrowing_const_only. (build_converted_constant_expr): Set check_narrowing and check_narrowing_const_only. Give error if expr is error node. (convert_like_real): Pass it to check_narrowing. * cp-tree.h (check_narrowing): Add a default parameter. * decl.c (compute_array_index_type): Use input_location instead of location_of. * pt.c (convert_nontype_argument): Return NULL_TREE if tf_error. * typeck2.c (check_narrowing): Don't warn for instantiation-dependent expressions. Call maybe_constant_value instead of fold_non_dependent_expr. Don't mention { } in diagnostic. Only check narrowing for constants if CONST_ONLY. * g++.dg/cpp0x/Wnarrowing6.C: New test. * g++.dg/cpp0x/Wnarrowing7.C: New test. * g++.dg/cpp0x/Wnarrowing8.C: New test. * g++.dg/cpp0x/Wnarrowing9.C: New test. * g++.dg/cpp0x/Wnarrowing10.C: New test. * g++.dg/cpp0x/constexpr-47969.C: Adjust dg-error. * g++.dg/cpp0x/constexpr-ex2.C: Likewise. * g++.dg/cpp0x/constexpr-targ.C: Likewise. * g++.dg/cpp0x/scoped_enum2.C: Likewise. * g++.dg/ext/stmtexpr15.C: Likewise. * g++.dg/gomp/pr47963.C: Likewise. * g++.dg/init/new37.C: Likewise. * g++.dg/init/new43.C: Likewise. * g++.dg/other/fold1.C: Likewise. * g++.dg/parse/array-size2.C: Likewise. * g++.dg/template/dependent-name3.C: Likewise. * g++.dg/cpp0x/constexpr-data2.C: Add dg-error. * g++.dg/other/vrp1.C: Likewise. * g++.dg/template/char1.C: Likewise. From-SVN: r263523
Marek Polacek committed -
The getentropy function, found on Linux, OpenBSD, and recently also FreeBSD, can be used to get random bytes to initialize the PRNG. It is similar to the traditional way of reading from /dev/urandom, but being a system call rather than a special file, it doesn't suffer from problems like running out of file descriptors, or failure when running in a container where /dev/urandom may not be available. Regtested on x86_64-pc-linux-gnu, Ok for trunk? 2018-08-13 Janne Blomqvist <jb@gcc.gnu.org> * configure.ac: Check for getentropy. * intrinsics/random.c (getosrandom): Use getentropy if available. * config.h.in: Regenerated. * configure: Regenerated. From-SVN: r263522
Janne Blomqvist committed -
After the combine 2-2 changes, this testcase does not have a ZERO_EXTEND in the intermediate code, but an AND instead. gcc/testsuite/ * gcc.target/powerpc/pr56605.c: The generated code can have an AND instead of a ZERO_EXTEND. From-SVN: r263521
Segher Boessenkool committed -
[gcc] 2018-07-06 Will Schmidt <will_schmidt@vnet.ibm.com> * gcc/config/rs6000/rs6000.c (rs6000_gimple_fold_builtin): Add support for folding vec_perm. From-SVN: r263520
Will Schmidt committed
-