- 17 Feb, 2020 10 commits
-
-
* include/std/type_traits (__is_standard_integer): New helper trait. * include/std/utility (cmp_equal, cmp_not_equal, cmp_less, cmp_greater) (cmp_less_equal, cmp_greater_equal, in_range): Define for C++20. * include/std/version (__cpp_lib_integer_comparison_functions): Define. * testsuite/20_util/integer_comparisons/1.cc: New test. * testsuite/20_util/integer_comparisons/2.cc: New test. * testsuite/20_util/integer_comparisons/equal.cc: New test. * testsuite/20_util/integer_comparisons/equal_neg.cc: New test. * testsuite/20_util/integer_comparisons/greater_equal.cc: New test. * testsuite/20_util/integer_comparisons/greater_equal_neg.cc: New test. * testsuite/20_util/integer_comparisons/greater_neg.cc: New test. * testsuite/20_util/integer_comparisons/in_range.cc: New test. * testsuite/20_util/integer_comparisons/in_range_neg.cc: New test. * testsuite/20_util/integer_comparisons/less.cc: New test. * testsuite/20_util/integer_comparisons/less_equal.cc: New test. * testsuite/20_util/integer_comparisons/less_equal_neg.cc: New test. * testsuite/20_util/integer_comparisons/less_neg.cc: New test. * testsuite/20_util/integer_comparisons/not_equal.cc: New test. * testsuite/20_util/integer_comparisons/not_equal_neg.cc: New test.
Jonathan Wakely committed -
PR ipa/93760 * ipa-devirt.c (odr_types_equivalent_p): Fix grammar. PR ipa/93760 * g++.dg/lto/odr-8_1.C: Fix grammar.
Martin Liska committed -
PR translation/93755 * config/rs6000/rs6000.c (rs6000_option_override_internal): Fix double quotes.
Martin Liska committed -
PR other/93756 * config/rx/elf.opt: Fix typo. PR other/93756 * src/std/algorithm/iteration.d: Fix typo.
Martin Liska committed -
This makes sure to not promote diagnostics about unrecognized -Wno- options to errors and make the intent of the diagnostic clearer. 2020-02-17 Richard Biener <rguenther@suse.de> PR c/86134 * opts-global.c (print_ignored_options): Use inform and amend message. * gcc.dg/pr86134.c: New testcase. * gcc.dg/pr28322-2.c: Adjust.
Richard Biener committed -
There have been various ICEs with -fanalyzer involving unhandled tree codes in region_model::get_lvalue_1; PR analyzer/93388 reports various others e.g. for IMAGPART_EXPR, REALPART_EXPR, and VIEW_CONVERT_EXPR seen when running the testsuite with -fanalyzer forcibly enabled. Whilst we could implement lvalue-handling in the region model for every tree code, for some of these we're straying far from my primary goal for GCC 10 of implementing a double-free checker for C. This patch implements a fallback for unimplemented tree codes: create a dummy region, but mark the new state as being invalid, and stop exploring state along this path. It also implements VIEW_CONVERT_EXPR. Doing so fixes the ICEs, whilst effectively turning off the analyzer along code paths that use such tree codes. Hopefully this compromise is sensible for GCC 10. gcc/analyzer/ChangeLog: PR analyzer/93388 * engine.cc (impl_region_model_context::on_unknown_tree_code): New. (exploded_graph::get_or_create_node): Reject invalid states. * exploded-graph.h (impl_region_model_context::on_unknown_tree_code): New decl. (point_and_state::point_and_state): Assert that the state is valid. * program-state.cc (program_state::program_state): Initialize m_valid to true. (program_state::operator=): Copy m_valid. (program_state::program_state): Likewise for move constructor. (program_state::print): Print m_valid. (program_state::dump_to_pp): Likewise. * program-state.h (program_state::m_valid): New field. * region-model.cc (region_model::get_lvalue_1): Implement the default case by returning a new symbolic region and calling the context's on_unknown_tree_code, rather than issuing an internal_error. Implement VIEW_CONVERT_EXPR. * region-model.h (region_model_context::on_unknown_tree_code): New vfunc. (test_region_model_context::on_unknown_tree_code): New. gcc/testsuite/ChangeLog: PR analyzer/93388 * gcc.dg/analyzer/torture/20060625-1.c: New test. * gcc.dg/analyzer/torture/pr51628-30.c: New test. * gcc.dg/analyzer/torture/pr59037.c: New test.
David Malcolm committed -
This patch improves the wording of the state-transition event (1) in the -Wanalyzer-null-dereference diagnostic for: void test (void) { int *p = NULL; *p = 1; } taking the path description from: ‘test’: events 1-2 | | 5 | int *p = NULL; | | ^ | | | | | (1) assuming ‘p’ is NULL | 6 | *p = 1; | | ~~~~~~ | | | | | (2) dereference of NULL ‘p’ | to: ‘test’: events 1-2 | | 5 | int *p = NULL; | | ^ | | | | | (1) ‘p’ is NULL | 6 | *p = 1; | | ~~~~~~ | | | | | (2) dereference of NULL ‘p’ | since the "assuming" at (1) only makes sense for state transitions due to comparisons, not for assignments. gcc/analyzer/ChangeLog: * sm-malloc.cc (malloc_diagnostic::describe_state_change): For transition to the "null" state, only say "assuming" when transitioning from the "unchecked" state. gcc/testsuite/ChangeLog: * gcc.dg/analyzer/malloc-1.c (test_48): New.
David Malcolm committed -
gcc/analyzer/ChangeLog: * diagnostic-manager.h (diagnostic_manager::get_saved_diagnostic): Add const overload. * engine.cc (exploded_node::dump_dot): Dump saved_diagnostics. * exploded-graph.h (exploded_graph::get_diagnostic_manager): Add const overload.
David Malcolm committed -
As PR93047 said, __builtin_apply/__builtin_return does not work well with -frename-registers. This is caused by return register(e.g. r3) is used to rename another register, before return register is stored to stack. This patch fix this issue by emitting clobber for those egisters which maybe changed by untyped call. gcc/ 2020-02-17 Jiufu Guo <guojiufu@linux.ibm.com> PR target/93047 * config/rs6000/rs6000.md (untyped_call): Add emit_clobber. gcc/testsuite 2020-02-17 Jiufu Guo <guojiufu@linux.ibm.com> PR target/93047 * gcc.dg/torture/stackalign/builtin-return-2.c: New test case.
Jiufu Guo committed -
GCC Administrator committed
-
- 16 Feb, 2020 5 commits
-
-
PR target/93743 * config/i386/i386.md (atan2xf3): Swap operands 1 and 2. (atan2<mode>3): Update operand order in the call to gen_atan2xf3. testsuite/ChangeLog: PR target/93743 * gcc.target/i386/pr93743.c : New test.
Uros Bizjak committed -
This makes it possible to use gccgo to bootstrap Go 1.14. If we don't install this, gccgo can't compile the sort package. Fixes GCC PR go/93679 Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/219617
Ian Lance Taylor committed -
* ztest.c (test_large): Update file to current libgo test file.
Ian Lance Taylor committed -
This avoids instantiating dead code when the true branch of the constexpr if is taken. libstdc++-v3/ChangeLog: * include/bits/ranges_algo.h (__lexicographical_compare_fn::operator()): Move code after an early exit constexpr if to under an else branch. * include/bits/ranges_algobase.h (__equal_fn::operator()): Likewise.
Patrick Palka committed -
GCC Administrator committed
-
- 15 Feb, 2020 16 commits
-
-
A small improvement for an error in build_user_type_conversion_1: instead of array-init1.C:11:1: error: conversion from ‘long int’ to ‘A’ is ambiguous 11 | }; | ^ we will print array-init1.C:8:3: error: conversion from ‘long int’ to ‘A’ is ambiguous 8 | 0L, | ^~ 2020-02-12 Marek Polacek <polacek@redhat.com> PR c++/93710 - poor diagnostic for array initializer. * call.c (build_user_type_conversion_1): Use cp_expr_loc_or_input_loc for an error call. * g++.dg/diagnostic/array-init1.C: New test.
Marek Polacek committed -
It's probably past time for this, but definitely now that we're done with the final committee meeting of C++20. This patch only adds the option and adjusts the testsuite to recognize it; more extensive changes can wait for the published standard. gcc/ChangeLog 2020-02-15 Jason Merrill <jason@redhat.com> * doc/invoke.texi (C Dialect Options): Add -std=c++20. gcc/c-family/ChangeLog 2020-02-15 Jason Merrill <jason@redhat.com> * c.opt: Add -std=c++20. gcc/testsuite/ChangeLog 2020-02-15 Jason Merrill <jason@redhat.com> * lib/target-supports.exp (check_effective_target_c++2a_only): Also look for -std=*++20. (check_effective_target_concepts): Use check_effective_target_c++2a.
Jason Merrill committed -
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/218017
Ian Lance Taylor committed -
Otherwise we can easily run out of stack space for threads. The user can still override by setting GOMAXPROCS. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/219278
Ian Lance Taylor committed -
libstdc++-v3/ChangeLog: * include/bits/ranges_algo.h: Adjust whitespace and formatting. * include/bits/ranges_algobase.h: Likewise. * include/bits/ranges_uninitialized.h: Likewise.
Patrick Palka committed -
This is the standard way to inhibit ADL for these entities, which is required as per [algorithms.requirements] p2 and [specialized.algorithms] p4. The conversion was done mostly mechanically with a custom Vim macro. libstdc++-v3/ChangeLog: * include/bits/ranges_algo.h: (adjacent_find, all_of, any_of, binary_search, copy_if, count, count_if, equal_range, find, find_end, find_first_of, find_if, find_if_not, for_each, generate, generate_n, includes, inplace_merge, is_heap, is_heap_until, is_partitioned, is_permutation, is_sorted, is_sorted_until, lexicographical_compare, lower_bound, make_heap, max, max_element, merge, min, min_element, minmax, minmax_element, mismatch, next_permutation, none_of, nth_element, partial_sort, partial_sort_copy, partition, partition_copy, partition_point, pop_heap, prev_permutation, push_heap, remove, remove_copy, remove_copy_if, remove_if, replace, replace_copy, replace_copy_if, replace_if, reverse, reverse_copy, rotate, rotate_copy, search, search_n, set_difference, set_intersection, set_symmetric_difference, set_union, shuffle, sort, sort_heap, stable_partition, stable_sort, swap_ranges, transform, unique, unique_copy, upper_bound): Convert into function objects. * include/bits/ranges_algobase.h: (equal, copy, move, copy_n, fill_n, fill, move_backward, copy_backward): Likewise. * include/bits/ranges_uninitialized.h (uninitialized_default_construct, uninitialized_default_construct_n, uninitialized_value_construct, uninitialized_value_construct_n, uninitialized_copy, uninitialized_copy_n, uninitialized_move, uninitialized_move_n, uninitialized_fill, uninitialized_fill_n, construct_at, destroy_at, destroy, destroy_n): Likewise.
Patrick Palka committed -
These subroutines have only a single call site, so it might be best and simplest to eliminate them before we convert the algos into function objects. libstdc++-v3/ChangeLog: * include/bits/ranges_algo.h (ranges::__find_end): Fold into ... (ranges::find_end): ... here. (ranges::__lexicographical_compare): Fold into ... (ranges::lexicographical_compare): ... here. * include/bits/ranges_algobase.h (ranges::__equal): Fold into ... (ranges::equal): ... here.
Patrick Palka committed -
PR c++/68061 * g++.dg/concepts/attrib1.C: New.
Jason Merrill committed -
find_template_parameters needs to find the mention of T in the lambda. Fixing that leaves this as a hard error, which may be surprising but is consistent with lambdas in other SFINAE contexts like template argument deduction. gcc/cp/ChangeLog 2020-02-15 Jason Merrill <jason@redhat.com> PR c++/92556 * pt.c (any_template_parm_r): Look into lambda body.
Jason Merrill committed -
gcc/cp/ChangeLog 2020-02-15 Jason Merrill <jason@redhat.com> PR c++/92583 * pt.c (any_template_parm_r): Remove CONSTRUCTOR handling.
Jason Merrill committed -
PR c++/90764 * g++.dg/cpp1z/class-deduction69.C: New.
Jason Merrill committed -
As the following testcases show (the first one reported, last two found by code inspection), we need to disallow side-effects in simplifications that turn some unconditional expression into conditional one. From my little understanding of genmatch.c, it is able to automatically disallow side effects if the same operand is used multiple times in the match pattern, maybe if it is used multiple times in the replacement pattern, and if it is used in conditional contexts in the match pattern, could it be taught to handle this case too? If yes, perhaps just the first hunk could be usable for 8/9 backports (+ the testcases). 2020-02-15 Jakub Jelinek <jakub@redhat.com> PR tree-optimization/93744 * match.pd (((m1 >/</>=/<= m2) * d -> (m1 >/</>=/<= m2) ? d : 0, A - ((A - B) & -(C cmp D)) -> (C cmp D) ? B : A, A + ((B - A) & -(C cmp D)) -> (C cmp D) ? B : A): For GENERIC, make sure @2 in the first and @1 in the other patterns has no side-effects. * gcc.c-torture/execute/pr93744-1.c: New test. * gcc.c-torture/execute/pr93744-2.c: New test. * gcc.c-torture/execute/pr93744-3.c: New test.
Jakub Jelinek committed -
Now that this feature has been approved for C++20 we can define the macro to the official value. * include/bits/erase_if.h (__cpp_lib_erase_if): Define to 202002L. * include/std/deque: Likewise. * include/std/forward_list: Likewise. * include/std/list: Likewise. * include/std/string: Likewise. * include/std/vector: Likewise. * include/std/version: Likewise. * testsuite/23_containers/deque/erasure.cc: Test for new value. * testsuite/23_containers/forward_list/erasure.cc: Likewise. * testsuite/23_containers/list/erasure.cc: Likewise. * testsuite/23_containers/map/erasure.cc: Likewise. * testsuite/23_containers/set/erasure.cc: Likewise. * testsuite/23_containers/unordered_map/erasure.cc: Likewise. * testsuite/23_containers/unordered_set/erasure.cc: Likewise. * testsuite/23_containers/vector/erasure.cc: Likewise.
Jonathan Wakely committed -
* include/bits/random.h (uniform_random_bit_generator): Require min() and max() to be constant expressions and min() to be less than max(). * testsuite/26_numerics/random/concept.cc: Check additional cases. * testsuite/26_numerics/random/pr60037-neg.cc: Adjust dg-error lineno.
Jonathan Wakely committed -
2020-02-15 David Malcolm <dmalcolm@redhat.com> Bernd Edlinger <bernd.edlinger@hotmail.de> PR 87488 PR other/93168 * config.in (DIAGNOSTICS_URLS_DEFAULT): New define. * configure.ac (--with-diagnostics-urls): New configuration option, based on --with-diagnostics-color. (DIAGNOSTICS_URLS_DEFAULT): New define. * config.h: Regenerate. * configure: Regenerate. * diagnostic.c (diagnostic_urls_init): Handle -1 for DIAGNOSTICS_URLS_DEFAULT from configure-time --with-diagnostics-urls=auto-if-env by querying for a GCC_URLS and TERM_URLS environment variable. * diagnostic-url.h (diagnostic_url_format): New enum type. (diagnostic_urls_enabled_p): rename to... (determine_url_format): ... this, and change return type. * diagnostic-color.c (parse_env_vars_for_urls): New helper function. (auto_enable_urls): Disable URLs on xfce4-terminal, gnome-terminal, the linux console, and mingw. (diagnostic_urls_enabled_p): rename to... (determine_url_format): ... this, and adjust. * pretty-print.h (pretty_printer::show_urls): rename to... (pretty_printer::url_format): ... this, and change to enum. * pretty-print.c (pretty_printer::pretty_printer, pp_begin_url, pp_end_url, test_urls): Adjust. * doc/install.texi (--with-diagnostics-urls): Document the new configuration option. (--with-diagnostics-color): Document the existing interaction with GCC_COLORS better. * doc/invoke.texi (-fdiagnostics-urls): Add GCC_URLS and TERM_URLS vindex reference. Update description of defaults based on the above. (-fdiagnostics-color): Update description of how -fdiagnostics-color interacts with GCC_COLORS.
Bernd Edlinger committed -
gcc/ChangeLog: * doc/extend.texi (attribute alias): Mention type requirement. (attribute weak): Same. (attribute weakref): Correct invalid example.
Martin Sebor committed
-
- 14 Feb, 2020 9 commits
-
-
This fixes a weakness in the way -fdump-ada-spec builds names for anonymous structures in the C/C++ code, resulting in duplicate identifiers under specific circumstances. c-family/ * c-ada-spec.c: Include bitmap.h. (dump_ada_double_name): Rename into... (dump_anonymous_type_name): ...this. Always use the TYPE_UID. (dump_ada_array_type): Adjust to above renaming. Robustify. (dump_nested_types_1): New function copied from... Add dumped_types parameter and pass it down to dump_nested_type. (dump_nested_types): ...this. Remove parent parameter. Just call dump_nested_types_1 on an automatic bitmap. (dump_nested_type): Add dumped_types parameter. <ARRAY_TYPE>: Do not dump it if already present in dumped_types. Adjust recursive calls and adjust to above renaming. (dump_ada_declaration): Adjust call to dump_nested_types. Tidy up and adjust to above renaming. (dump_ada_specs): Initialize and release bitmap obstack.
Eric Botcazou committed -
gcc/po: * be.po, da.po, de.po, el.po, es.po, fi.po, fr.po, hr.po, id.po, ja.po, nl.po, ru.po, sr.po, sv.po, tr.po, uk.po, vi.po, zh_CN.po, zh_TW.po: Update. libcpp/po: * be.po, ca.po, da.po, de.po, el.po, eo.po, es.po, fi.po, fr.po, id.po, ja.po, nl.po, pt_BR.po, ru.po, sr.po, sv.po, tr.po, uk.po, vi.po, zh_CN.po, zh_TW.po: Update.
Joseph Myers committed -
This is an old thinko pertaining to the interaction between TLS sequences and delay slot filling: the compiler knows that it cannot put instructions with TLS relocations into delay slots with the original Sun TLS model, but it tests TARGET_SUN_TLS in this context, which depends only on the assembler. So if the compiler is configured with the GNU assembler and the Solaris linker, then TARGET_GNU_TLS is set instead and the limitation is not enforced. PR target/93704 * config/sparc/sparc.c (eligible_for_call_delay): Test HAVE_GNU_LD in conjunction with TARGET_GNU_TLS in early return.
Eric Botcazou committed -
There's a costly signed 64-bit division in rtx_cost on x86 as well as any other target where UNITS_PER_WORD expands to TARGET_64BIT ? 8 : 4. It's also evident that rtx_cost does redundant work for a SET. Obviously the variable named 'factor' rarely exceeds 1, so in the majority of cases it can be computed with a well-predictable branch rather than a division. This patch makes rtx_cost do the division only in case mode is wider than UNITS_PER_WORD, and also moves a test for a SET up front to avoid redundancy. No functional change. * rtlanal.c (rtx_cost): Handle a SET up front. Avoid division if the mode is not wider than UNITS_PER_WORD.
Alexander Monakov committed -
When backporting the PR61414 fix to 8.4, I've noticed that the caching of prec is actually broken, as it would fail to actually store the computed precision into the hash_map's value and so next time we'd think the enum needs 0 bits. 2020-02-14 Jakub Jelinek <jakub@redhat.com> PR c++/61414 * class.c (enum_min_precision): Change prec type from int to int &. * g++.dg/cpp0x/enum39.C: New test.
Jakub Jelinek committed -
get_ref_base_and_extent can return different sizes for COMPONENT_REFs and DECLs of the same type, with the latter including (more?) padding. When in the IL there is an assignment between such a COMPONENT_REF and a DECL, SRA will try to propagate the access from the former as a child of the latter, creating an artificial reference that does not match the access's declared size, which triggers a verifier assert. Fixed by teaching the propagation functions about this special situation so that they don't do it. The condition is the same that build_user_friendly_ref_for_offset uses so the artificial reference causing the verifier is guaranteed not to be created. 2020-02-14 Martin Jambor <mjambor@suse.cz> PR tree-optimization/93516 * tree-sra.c (propagate_subaccesses_from_rhs): Do not create access of the same type as the parent. (propagate_subaccesses_from_lhs): Likewise. gcc/testsuite/ * g++.dg/tree-ssa/pr93516.C: New test.
Martin Jambor committed -
liuhongt committed
-
2020-02-14 Hongtao Liu <hongtao.liu@intel.com> gcc/ PR target/93724 * config/i386/avx512vbmi2intrin.h (_mm512_shrdi_epi16, _mm512_mask_shrdi_epi16, _mm512_maskz_shrdi_epi16, _mm512_shrdi_epi32, _mm512_mask_shrdi_epi32, _mm512_maskz_shrdi_epi32, _m512_shrdi_epi64, _m512_mask_shrdi_epi64, _m512_maskz_shrdi_epi64, _mm512_shldi_epi16, _mm512_mask_shldi_epi16, _mm512_maskz_shldi_epi16, _mm512_shldi_epi32, _mm512_mask_shldi_epi32, _mm512_maskz_shldi_epi32, _mm512_shldi_epi64, _mm512_mask_shldi_epi64, _mm512_maskz_shldi_epi64): Fix typo of lacking a closing parenthesis. * config/i386/avx512vbmi2vlintrin.h (_mm256_shrdi_epi16, _mm256_mask_shrdi_epi16, _mm256_maskz_shrdi_epi16, _mm256_shrdi_epi32, _mm256_mask_shrdi_epi32, _mm256_maskz_shrdi_epi32, _m256_shrdi_epi64, _m256_mask_shrdi_epi64, _m256_maskz_shrdi_epi64, _mm256_shldi_epi16, _mm256_mask_shldi_epi16, _mm256_maskz_shldi_epi16, _mm256_shldi_epi32, _mm256_mask_shldi_epi32, _mm256_maskz_shldi_epi32, _mm256_shldi_epi64, _mm256_mask_shldi_epi64, _mm256_maskz_shldi_epi64, _mm_shrdi_epi16, _mm_mask_shrdi_epi16, _mm_maskz_shrdi_epi16, _mm_shrdi_epi32, _mm_mask_shrdi_epi32, _mm_maskz_shrdi_epi32, _mm_shrdi_epi64, _mm_mask_shrdi_epi64, _m_maskz_shrdi_epi64, _mm_shldi_epi16, _mm_mask_shldi_epi16, _mm_maskz_shldi_epi16, _mm_shldi_epi32, _mm_mask_shldi_epi32, _mm_maskz_shldi_epi32, _mm_shldi_epi64, _mm_mask_shldi_epi64, _mm_maskz_shldi_epi64): Ditto. gcc/testsuite/ * gcc.target/i386/avx512vbmi2-vpshld-1.c: New test. * gcc.target/i386/avx512vbmi2-vpshrd-1.c: Ditto. * gcc.target/i386/sse-12.c: Add -mavx512vbmi2. * gcc.target/i386/sse-13.c: Ditto. * gcc.target/i386/sse-14.c: Add -mavx512vbmi2 and tests. * gcc.target/i386/sse-22.c: Ditto.
liuhongt committed -
I've noticed we claim in cxx-status.html that we implement P1042R1, but it seems we don't implement any of the changes from there. The following patch implements just the change that __VA_OPT__ determines whether to expand to nothing or the enclosed tokens no longer based on whether there were any tokens passed to __VA_ARGS__, but whether __VA_ARGS__ expands to any tokens (from testing apparently it has to be non-CPP_PADDING tokens). I'm afraid I'm completely lost about the padding preservation/removal changes that are also in the paper, so haven't touched that part. 2020-02-14 Jakub Jelinek <jakub@redhat.com> Partially implement P1042R1: __VA_OPT__ wording clarifications PR preprocessor/92319 * macro.c (expand_arg): Move declarations before vaopt_state definition. (class vaopt_state): Move enum update_type definition earlier. Remove m_allowed member, add m_arg and m_update members. (vaopt_state::vaopt_state): Change last argument from bool any_args to macro_arg *arg, initialize m_arg and m_update instead of m_allowed. (vaopt_state::update): When bumping m_state from 1 to 2 and m_update is ERROR, determine if __VA_ARGS__ expansion has any non-CPP_PADDING tokens and set m_update to INCLUDE if it has any, DROP otherwise. Return m_update instead of m_allowed ? INCLUDE : DROP in m_state >= 2. (replace_args, create_iso_definition): Adjust last argument to vaopt_state ctor. * c-c++-common/cpp/va-opt-4.c: New test.
Jakub Jelinek committed
-