aboutsummaryrefslogtreecommitdiff
path: root/gcc
AgeCommit message (Collapse)AuthorFilesLines
2018-03-30Fix designated initializer for anonymous union.Jason Merrill3-1/+21
* typeck2.c (process_init_constructor_record): Use init_list_type_node for the CONSTRUCTOR around an anonymous union designated initializer. From-SVN: r258982
2018-03-30re PR c++/84791 (ICE with broken OpenMP reduction clause)Jakub Jelinek4-1/+32
PR c++/84791 * semantics.c (finish_omp_reduction_clause): If OMP_CLAUSE_REDUCTION_PLACEHOLDER is error_mark_node, return true even if processing_template_decl. * g++.dg/gomp/pr84791.C: New test. From-SVN: r258981
2018-03-30re PR fortran/84931 (Expansion of array constructor with constant ↵Paul Thomas4-33/+57
implied-do-object goes sideways) 2018-03-30 Paul Thomas <pault@gcc.gnu.org> PR fortran/84931 * simplify.c (gfc_convert_constant): Handle case of array constructors within an array that has no iterator and improve the conciseness of this section of code. 2018-03-30 Paul Thomas <pault@gcc.gnu.org> PR fortran/84931 * gfortran.dg/array_constructor_53.f90: New test. From-SVN: r258977
2018-03-30re PR fortran/85130 (Substrings out of range are not rejected)Thomas Koenig2-2/+6
2018-03-30 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/85130 * gfortran.dg/substr_6.f90: Remove illegal test for out-of-bounds substring. From-SVN: r258976
2018-03-30re PR target/83822 (trunk/gcc/config/rs6000/rs6000-string.c:970]: (style) ↵Aaron Sawdey3-4/+10
Redundant condition) 2018-03-30 Aaron Sawdey <acsawdey@linux.vnet.ibm.com> PR target/83822 * config/rs6000/rs6000-string.c (expand_compare_loop): Fix redundant condition. * config/rs6000/rs6000-c.c (rs6000_cpu_cpp_builtins): Fix redundant condition. From-SVN: r258975
2018-03-30re PR fortran/85111 (ICE in min_max_choose, at fortran/simplify.c:4884 (and ↵Thomas Koenig2-0/+14
others)) 2017-03-30 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/85111 * array.c (gfc_resolve_character_array_constructor): Early exit for zero-size arrays. * simplify.c (simplify_transformation_to_array): Exit early if the result size is zero. (simplify_minmaxloc_to_array): Likewise. 2017-03-30 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/85111 * gfortran.dg/zero_sized_10.f90: New test. Add ChangeLog entries for r258973. From-SVN: r258974
2018-03-30re PR fortran/85111 (ICE in min_max_choose, at fortran/simplify.c:4884 (and ↵Thomas Koenig3-2/+26
others)) 2017-03-30 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/85111 * array.c (gfc_resolve_character_array_constructor): Early exit for zero-size arrays. * simplify.c (simplify_transformation_to_array): Exit early if the result size is zero. (simplify_minmaxloc_to_array): Likewise. 2017-03-30 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/85111 * gfortran.dg/zero_sized_10.f90: New test. From-SVN: r258973
2018-03-30Enable tuning options for skylake-avx512.Julia Koval2-2/+8
gcc/ PR target/84413 * x86-tune.def (movx, partial_reg_dependency): Enable for m_SKYLAKE_AVX512. From-SVN: r258972
2018-03-30Daily bump.GCC Administrator1-1/+1
From-SVN: r258970
2018-03-30* gcc.pot: Regenerate.Joseph Myers2-7454/+7808
From-SVN: r258967
2018-03-29More #include suggestions (PR c++/84269)David Malcolm9-1/+213
PR c++/84269 reports a number of names in the C and C++ standard libraries for which we don't yet offer #include fix-it hints. This patch adds them (up to comment #9). gcc/c-family/ChangeLog: PR c++/84269 * known-headers.cc (get_stdlib_header_for_name): Add various names from <assert.h>, <string.h>, and <memory.h>; add more names from <stdio.h>. gcc/cp/ChangeLog: PR c++/84269 * name-lookup.c (get_std_name_hint): Add names from <memory>, <tuple>, and <utility>. gcc/testsuite/ChangeLog: PR c++/84269 * g++.dg/lookup/missing-std-include-6.C: New test. * g++.dg/lookup/missing-std-include.C: Add std::pair and std::tuple tests. * g++.dg/spellcheck-reswords.C: Expect a hint about <cstring>. * g++.dg/spellcheck-stdlib.C: Add tests for names in <cstdio>, <cstring>, <cassert>, and <cstdlib>. From-SVN: r258966
2018-03-29PR c++/85093 - too many template args with pack expansion.Jason Merrill3-0/+35
* pt.c (coerce_template_parms): Keep pack expansion args that will need to be empty. From-SVN: r258964
2018-03-29* pt.c (build_non_dependent_expr): Propagate expr location.Jason Merrill2-1/+6
From-SVN: r258963
2018-03-29PR c++/85060 - wrong-code with call to base member in template.Jason Merrill3-1/+33
* search.c (any_dependent_bases_p): Check uses_template_parms rather than processing_template_decl. From-SVN: r258962
2018-03-29re PR inline-asm/84985 (ICE in match_reload, at lra-constraints.c:1068)Vladimir Makarov4-1/+18
2018-03-29 Vladimir Makarov <vmakarov@redhat.com> PR inline-asm/84985 * lra-constraints.c (process_alt_operands): Move setting this_alternative_matches below. 2018-03-29 Vladimir Makarov <vmakarov@redhat.com> PR inline-asm/84985 * gcc.target/i386/pr84985.c: New. From-SVN: r258961
2018-03-29More underlining of bad arguments (PR c++/85110)David Malcolm4-2/+190
As of r256448, the C++ frontend underlines many bad arguments in its diagnostics; those where perform_overload_resolution returns a non-NULL candidate, but there's a failure in convert_like_real. However, for the case where perform_overload_resolution fails, but there's a single non-viable candidate, the error is diagnosed by cp_build_function_call_vec, and that currently doesn't underline the bad argument: $ cat test.cc void callee (int one, const char **two, int three); void caller (const char *fmt) { callee (1, fmt, 3); } We emit: $ g++ test.cc test.cc: In function 'void caller(const char*)': test.cc:6:20: error: cannot convert 'const char*' to 'const char**' for argument '2' to 'void callee(int, const char**, int)' callee (1, fmt, 3); ^ It's going through convert_for_assignment, and implicitly using input_location. This patch updates convert_for_assignment for this case, using an EXPR_LOCATION if there is one, or falling back to input_location otherwise, underlining the argument in question: test.cc: In function 'void caller(const char*)': test.cc:6:14: error: cannot convert 'const char*' to 'const char**' for argument '2' to 'void callee(int, const char**, int)' callee (1, fmt, 3); ^~~ gcc/cp/ChangeLog: PR c++/85110 * typeck.c (convert_for_assignment): When complaining due to conversions for an argument, attempt to use the location of the argument. gcc/testsuite/ChangeLog: PR c++/85110 * g++.dg/diagnostic/param-type-mismatch-2.C: New test. From-SVN: r258957
2018-03-29Documentation tweaks.Martin Liska2-3/+17
2018-03-29 Martin Liska <mliska@suse.cz> PR lto/84995. * doc/invoke.texi: Document how LTO works with debug info. Describe auto-load support of binutils. Mention 'x86-64' as valid option value of -march option. From-SVN: r258953
2018-03-29re PR c++/85108 (Incorrect warning for constexpr lambda with ↵Jakub Jelinek2-0/+14
-Wunused-but-set-variable) PR c++/85108 * g++.dg/warn/Wunused-var-31.C: New test. From-SVN: r258952
2018-03-29* config/i386/sse.md (<avx512>_blendm<mode>): Use <sseintprefix>.Jakub Jelinek2-1/+3
From-SVN: r258951
2018-03-29re PR c/85094 (-g with any optimization suppresses -Wduplicated-branches)Jakub Jelinek4-1/+35
PR c/85094 * fold-const.c (operand_equal_p): Handle DEBUG_BEGIN_STMT. For STATEMENT_LIST, pass down OEP_LEXICOGRAPHIC and maybe OEP_NO_HASH_CHECK for recursive call, to avoid exponential checking. * c-c++-common/Wduplicated-branches-14.c: New test. From-SVN: r258950
2018-03-29re PR c++/84606 (internal compiler error: Segmentation fault ↵Paolo Carlini2-1/+16
(enclosing_instantiation_of())) 2018-03-29 Paolo Carlini <paolo.carlini@oracle.com> PR c++/84606 * g++.dg/cpp0x/pr84606.C: New. From-SVN: r258947
2018-03-29Daily bump.GCC Administrator1-1/+1
From-SVN: r258946
2018-03-28re PR target/84912 (__builtin_divde* produce Internal Compiler Error when ↵Peter Bergner4-3/+35
compiled -m32) PR target/84912 * config/rs6000/rs6000.h (RS6000_BTM_POWERPC64): New define. (RS6000_BTM_COMMON): Add RS6000_BTM_POWERPC64. * config/rs6000/rs6000.c (rs6000_builtin_mask_calculate): Add support for RS6000_BTM_POWERPC64. (rs6000_invalid_builtin): Add handling for RS6000_BTM_POWERPC64 (rs6000_builtin_mask_names): Add RS6000_BTM_POWERPC64. * config/rs6000/rs6000-builtin.def (BU_P7_POWERPC64_MISC_2): New macro definition. (DIVDE): Use it. (DIVDEU): Likewise. From-SVN: r258943
2018-03-28revert: rs6000-builtin.def (BU_FP_1MISC_1): Add define macro.Carl Love5-159/+18
gcc/ChangeLog: 2018-03-20 Carl Love <cel@us.ibm.com> Revert 2017-09-27 Carl Love <cel@us.ibm.com> * config/rs6000/rs6000-builtin.def (BU_FP_1MISC_1): Add define macro. (FCTID, FCTIW): Add BU_FP_MISC_1 macro expansion for builtins. * config/rs6000/rs6000.md (lrintsfsi2): Add define_insn for the fctiw instruction. gcc/testsuite/ChangeLog: 2018-03-20 Carl Love <cel@us.ibm.com> Revert 2017-09-27 Carl Love <cel@us.ibm.com> * gcc.target/powerpc/builtin-fctid-fctiw-runnable.c: New test file for the __builtin_fctid and __builtin_fctiw. From-SVN: r258942
2018-03-28xmmintrin.h (_mm_max_pi16): Use __vector __bool instead of __vector bool.Bill Schmidt2-8/+15
2018-03-28 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * config/rs6000/xmmintrin.h (_mm_max_pi16): Use __vector __bool instead of __vector bool. (_mm_max_pu8): Likewise. (_mm_min_pi16): Likewise. From-SVN: r258936
2018-03-28re PR fortran/69497 (ICE in gfc_free_namespace, at fortran/symbol.c:3701)Mikael Morin2-4/+18
PR fortran/69497 * symbol.c (gfc_symbol_done_2): Start freeing namespaces from the root. (gfc_free_namespace): Restore assert (revert r258839). From-SVN: r258935
2018-03-28Fix typo in last ChangeLog entryPeter Bergner1-1/+1
From-SVN: r258934
2018-03-28re PR target/84912 (__builtin_divde* produce Internal Compiler Error when ↵Peter Bergner8-49/+31
compiled -m32) gcc/ PR target/84912 * config/rs6000/rs6000-builtin.def (DIVWEO): Delete macro expansion. (DIVWEUO): Likewise. (DIVDEO): Likewise. (DIVDEUO): Likewise. * config/rs6000/rs6000.c (builtin_function_type): Remove support for DIVWEUO and DIVDEUO. * config/rs6000/rs6000.md (UNSPEC_DIVEO, UNSPEC_DIVEUO): Delete unspecs. (UNSPEC_DIV_EXTEND): Remove deleted unspecs. (div_extend): Likewise. * doc/extend.texi (__builtin_divweo): Remove documention for deleted builtin function. (__builtin_divweuo): Likewise. (__builtin_divdeo): Likewise. (__builtin_divdeuo): Likewise. gcc/testsuite/ PR target/84912 * gcc.target/powerpc/extend-divide-1.c (div_weo): Remove test for deleted builtin function. (div_weuo): Likewise. * gcc.target/powerpc/extend-divide-2.c (div_deo): Likewise. (div_deuo): Likewise. From-SVN: r258933
2018-03-28re PR c++/85028 (ICE on invalid C++ code: in tsubst_default_argument, at ↵Paolo Carlini4-0/+25
cp/pt.c:12340) /cp 2018-03-28 Paolo Carlini <paolo.carlini@oracle.com> PR c++/85028 * pt.c (tsubst_default_argument): Early return if the type of the parameter is erroneous. /testsuite 2018-03-28 Paolo Carlini <paolo.carlini@oracle.com> PR c++/85028 * g++.dg/other/default13.C: New. From-SVN: r258932
2018-03-28re PR target/85095 (worse code generated)Jakub Jelinek6-0/+205
PR target/85095 * config/i386/i386.md (*add<mode>3_carry_0, *addsi3_carry_zext_0, *sub<mode>3_carry_0, *subsi3_carry_zext_0): New patterns. * gcc.target/i386/pr85095-1.c: New test. * gcc.target/i386/pr85095-2.c: New test. * gcc.c-torture/execute/pr85095.c: New test. From-SVN: r258931
2018-03-28re PR middle-end/82004 (SPEC CPU2017 628.pop2_s miscompare)Jakub Jelinek5-1/+116
PR tree-optimization/82004 * gimple-match-head.c (optimize_pow_to_exp): New function. * match.pd (pow(C,x) -> exp(log(C)*x)): Wrap with #if GIMPLE. Don't fold to exp if optimize_pow_to_exp is false. * gcc.dg/pr82004.c: New test. From-SVN: r258930
2018-03-28Fix typos (PR other/84819).Martin Liska4-5/+13
2018-03-28 Martin Liska <mliska@suse.cz> PR other/84819 * calls.c (initialize_argument_information): Fix trailing space. * common.opt: Fix typo and provide better explanation for -fsanitize-coverage option. * config/i386/i386.opt: Fix typo. From-SVN: r258925
2018-03-28Fix wrong use-after-scope sanitization for omp variable (PR sanitizer/85081).Jakub Jelinek4-6/+39
2018-03-28 Jakub Jelinek <jakub@redhat.com> Martin Liska <mliska@suse.cz> PR sanitizer/85081 * gimplify.c (asan_poison_variable): Don't do the check for gimplify_omp_ctxp here. (gimplify_decl_expr): Do it here. (gimplify_target_expr): Likewise. 2018-03-28 Jakub Jelinek <jakub@redhat.com> Martin Liska <mliska@suse.cz> PR sanitizer/85081 * g++.dg/asan/pr85081.C: New test. Co-Authored-By: Martin Liska <mliska@suse.cz> From-SVN: r258924
2018-03-28Do not call chkp_type_bounds_count if MPX is not enabled (PR target/84988).Martin Liska2-1/+8
2018-03-28 Martin Liska <mliska@suse.cz> PR target/84988 * config/i386/i386.c (ix86_function_arg_advance): Do not call chkp_type_bounds_count if MPX is not enabled. From-SVN: r258923
2018-03-28[NDS32] Adjust BRANCH_COST to prevent too much jump when compile with -Os.Chung-Ju Wu2-1/+5
gcc/ * config/nds32/nds32.h (BRANCH_COST): Adjust cost. From-SVN: r258921
2018-03-28gfortran.h (gfc_dt): Rename default_exp field to dec_ext.Jakub Jelinek5-6/+16
* gfortran.h (gfc_dt): Rename default_exp field to dec_ext. * ioparm.def (IOPARM_dt_default_exp): Rename to ... (IOPARM_dt_dec_ext): ... this. * trans-io.c (build_dt): Adjust for default_exp renaming to dec_ext and IOPARM_dt_default_exp renaming to IOPARM_dt_dec_ext. * io.c (match_io): Likewise. * io/io.h (IOPARM_DT_DEFAULT_EXP): Rename to ... (IOPARM_DT_DEC_EXT): ... this. * io/list_read.c (parse_real): Adjust for IOPARM_DT_DEFAULT_EXP renaming to IOPARM_DT_DEC_EXT. (read_real): Likewise. * io/read.c (read_f): Likewise. From-SVN: r258920
2018-03-28[PR c++/84789] adjust testcase for -fconceptsAlexandre Oliva2-1/+5
When compiling with -fconcepts, cp_parser_template_declaration_after_export calls cp_parser_template_introduction and that preparses qualified-ids not preceded by typename in such a way that, when we get to cp_parser_parse_and_diagnose_invalid_type_name and then cp_parser_diagnose_invalid_type_name, the nested name specifier no longer carries the previous template-dependent context, so we don't stand a chance to suggest the use of 'typename' any more. Thus, tolerate in the testcase the poorer error messages we get. for gcc/testsuite/ChangeLog PR c++/84789 * g++.dg/template/pr84789.C: Adjust for testing with -fconcepts too. From-SVN: r258915
2018-03-28[PR c++/84973] don't defer output of uninstantiated templatesAlexandre Oliva6-0/+46
When an anon struct gets a name through a typedef, we reset its linkage and that of its members. Member functions may get vague linkage, which schedules them for deferred output, but we don't want to add them to the queue if they're uninstantiated templates, e.g. because the enclosing function is a template. They will be added as needed when the enclosing template is instantiated. for gcc/cp/ChangeLog PR c++/84973 * decl2.c (note_vague_linkage_fn): Don't defer uninstantiated templates. for gcc/testsuite/ChangeLog PR c++/84973 * g++.dg/template/pr84973.C: New. * g++.dg/template/pr84973-2.C: New. * g++.dg/template/pr84973-3.C: New. From-SVN: r258914
2018-03-28[PR c++/84968] reject stmt-exprs in noexcept constexprsAlexandre Oliva4-0/+29
We reject extended statement-expressions in template parameters, so we might as well reject them in constant expressions used in noexcept specifications. for gcc/cp/ChangeLog PR c++/84968 * tree.c (strip_typedefs_expr): Reject STATEMENT_LISTs. for gcc/testsuite/ChangeLog PR c++/84968 * g++.dg/eh/pr84968.C: New. From-SVN: r258913
2018-03-28Daily bump.GCC Administrator1-1/+1
From-SVN: r258912
2018-03-27re PR target/84914 (PowerPC complex multiply/divide calls the wrong function ↵Michael Meissner7-0/+122
when -mabi=ieeelongdouble) [gcc] 2018-03-27 Michael Meissner <meissner@linux.vnet.ibm.com> PR target/84914 * config/rs6000/rs6000.c (create_complex_muldiv): New helper function to create the function decl for complex long double multiply and divide for -mabi=ieeelongdouble. (init_float128_ieee): Call it. [gcc/testsuite] 2018-03-27 Michael Meissner <meissner@linux.vnet.ibm.com> PR target/84914 * gcc.target/powerpc/mulkc-2.c: New tests to make sure complex long double multiply/divide uses the correct function. * gcc.target/powerpc/mulkc-3.c: Likewise. * gcc.target/powerpc/divkc-2.c: Likewise. * gcc.target/powerpc/divkc-3.c: Likewise. From-SVN: r258908
2018-03-27re PR c++/85067 (ICE with volatile parameter in defaulted copy-constructor)Paolo Carlini5-2/+28
/cp 2018-03-27 Paolo Carlini <paolo.carlini@oracle.com> PR c++/85067 * method.c (defaulted_late_check): Partially revert r253321 changes, do not early return upon error. /testsuite 2018-03-27 Paolo Carlini <paolo.carlini@oracle.com> PR c++/85067 * g++.dg/cpp0x/defaulted51.C: New. * g++.dg/cpp0x/constexpr-68754.C: Adjust. From-SVN: r258904
2018-03-27re PR c++/85077 (V[248][SD]F abs not optimized to)Jakub Jelinek4-0/+31
PR c++/85077 * cp-gimplify.c (cp_fold) <case CONSTRUCTOR>: For ctors with vector type call fold to generate VECTOR_CSTs when possible. * g++.dg/ext/vector35.C: New test. From-SVN: r258903
2018-03-27re PR c++/85061 (ICE with __builtin_offsetof applied to static member)Jakub Jelinek4-1/+25
PR c++/85061 * c-common.c (fold_offsetof_1) <case COMPOUND_EXPR>: Assert that get_base_address of the second operand is a VAR_P, rather than the operand itself, and use gcc_checking_assert instead of gcc_assert. * g++.dg/ext/builtin-offsetof3.C: New test. From-SVN: r258902
2018-03-27re PR c++/85076 (ICE with invalid template used as lambda argument)Jakub Jelinek4-0/+20
PR c++/85076 * tree.c (cp_build_reference_type): If to_type is error_mark_node, return it right away. * g++.dg/cpp1y/pr85076.C: New test. From-SVN: r258901
2018-03-27re PR fortran/85084 (ICE: out of memory allocating 18446744073709551600 ↵Thomas Koenig4-4/+24
bytes ...) 2018-03-27 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/85084 * frontend-passes.c (gfc_run_passes): Do not run front-end optimizations if a previous error occurred. 2018-03-27 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/85084 * gfortran.dg/matmul_rank_1.f90: New test. From-SVN: r258900
2018-03-27re PR fortran/85083 (ICE in gfc_convert_to_structure_constructor, at ↵Thomas Koenig4-0/+25
fortran/primary.c:2915) 2018-03-27 Thomas Koenig <tkoenig@gcc.gnu.org> Harald Anlauf <anlauf@gmx.de> PR fortran/85083 * primary.c (gfc_convert_to_structure_constructor): Check conformance of argument types in structure constructor. 2018-03-27 Thomas Koenig <tkoenig@gcc.gnu.org> Harald Anlauf <anlauf@gmx.de> * gfortran.dg/structure_constructor_15.f90: New test. Co-Authored-By: Harald Anlauf <anlauf@gmx.de> From-SVN: r258899
2018-03-27search.c (check_final_overrider): Use inform instead of error for the ↵Volker Reichelt20-38/+73
diagnostics of the overridden functions. 2018-03-27 Volker Reichelt <v.reichelt@netcologne.de> * search.c (check_final_overrider): Use inform instead of error for the diagnostics of the overridden functions. Tweak wording. * g++.dg/cpp0x/defaulted2.C: Use dg-message instead of dg-error for the diagnostics of overridden functions. Adjust for new wording. * g++.dg/cpp0x/implicit1.C: Likewise. * g++.dg/cpp0x/override1.C: Likewise. * g++.dg/cpp1y/auto-fn18.C: Likewise. * g++.dg/eh/shadow1.C: Likewise. * g++.dg/inherit/covariant12.C: Likewise. * g++.dg/inherit/covariant14.C: Likewise. * g++.dg/inherit/covariant15.C: Likewise. * g++.dg/inherit/covariant16.C: Likewise. * g++.dg/inherit/covariant22.C: Likewise. * g++.dg/inherit/crash3.C: Likewise. * g++.dg/inherit/error2.C: Likewise. * g++.dg/template/crash100.C: Likewise. * g++.old-deja/g++.eh/spec6.C: Likewise. * g++.old-deja/g++.mike/p811.C: Likewise. * g++.old-deja/g++.other/virtual11.C: Likewise. * g++.old-deja/g++.other/virtual4.C: Likewise. From-SVN: r258898
2018-03-27i386: Insert ENDBR to trampoline for -fcf-protection=branch -mibtH.J. Lu5-1/+54
When -fcf-protection=branch -mibt are used, we need to insert ENDBR to trampoline. TRAMPOLINE_SIZE is creased by 4 bytes to accommodate 4-byte ENDBR instruction. gcc/ PR target/85044 * config/i386/i386.c (ix86_trampoline_init): Insert ENDBR for -fcf-protection=branch -mibt. * config/i386/i386.h (TRAMPOLINE_SIZE): Increased by 4 bytes. gcc/testsuite/ PR target/85044 * gcc.target/i386/pr85044.c: New test. From-SVN: r258897
2018-03-27PR testsuite/83462 - c-c++-common/Warray-bounds-3.c fails on arm-none-eabiMartin Sebor2-1/+12
gcc/testsuite/ChangeLog: * c-c++-common/Warray-bounds-4.c: Disable assertion for targets other than x86. From-SVN: r258896