Skip to content
Snippets Groups Projects
  1. May 20, 2021
    • Christophe Lyon's avatar
      c: Add support for __FILE_NAME__ macro (PR c/42579) · 1a9b3f04
      Christophe Lyon authored
      The toolchain provided by ST for stm32 has had support for
      __FILENAME__ for a while, but clang/llvm has recently implemented
      support for __FILE_NAME__, so it seems better to use the same macro
      name in GCC.
      
      It happens that the ST patch is similar to the one proposed in PR
      c/42579.
      
      Given these input files:
      ::::::::::::::
      mydir/myinc.h
      ::::::::::::::
      char* mystringh_file = __FILE__;
      char* mystringh_filename = __FILE_NAME__;
      char* mystringh_base_file = __BASE_FILE__;
      ::::::::::::::
      mydir/mysrc.c
      ::::::::::::::
      
      char* mystring_file = __FILE__;
      char* mystring_filename = __FILE_NAME__;
      char* mystring_base_file = __BASE_FILE__;
      
      we produce:
      $ gcc mydir/mysrc.c -I . -E
      char* mystringh_file = "./mydir/myinc.h";
      char* mystringh_filename = "myinc.h";
      char* mystringh_base_file = "mydir/mysrc.c";
      
      char* mystring_file = "mydir/mysrc.c";
      char* mystring_filename = "mysrc.c";
      char* mystring_base_file = "mydir/mysrc.c";
      
      2021-05-20  Christophe Lyon  <christophe.lyon@linaro.org>
      	    Torbjörn Svensson  <torbjorn.svensson@st.com>
      
      	PR c/42579
      	libcpp/
      	* include/cpplib.h (cpp_builtin_type): Add BT_FILE_NAME entry.
      	* init.c (builtin_array): Likewise.
      	* macro.c (_cpp_builtin_macro_text): Add support for BT_FILE_NAME.
      
      	gcc/
      	* doc/cpp.texi (Common Predefined Macros): Document __FILE_NAME__.
      
      	gcc/testsuite/
      	* c-c++-common/spellcheck-reserved.c: Add tests for __FILE_NAME__.
      	* c-c++-common/cpp/file-name-1.c: New test.
      1a9b3f04
    • Tobias Burnus's avatar
      Testsuite/Fortran: gfortran.dg/pr96711.f90 - fix expected value for PowerPC [PR96983] · 9e0a5e3e
      Tobias Burnus authored
      gcc/testsuite/ChangeLog:
      
      	PR fortran/96983
      	* gfortran.dg/pr96711.f90: Use 2**digit(x) instead of a hard-coded value;
      	add comments regarding what the code does.
      9e0a5e3e
    • Jakub Jelinek's avatar
      openmp: Handle explicit linear clause properly in combined constructs with target [PR99928] · 94fa4c67
      Jakub Jelinek authored
      linear clause should have the effect of firstprivate+lastprivate (or for IVs
      not declared in the construct lastprivate) on outer constructs and eventually
      map(tofrom:) on target when combined with it.
      
      2021-05-20  Jakub Jelinek  <jakub@redhat.com>
      
      	PR middle-end/99928
      	* gimplify.c (gimplify_scan_omp_clauses) <case OMP_CLAUSE_LINEAR>: For
      	explicit linear clause when combined with target, make it map(tofrom:)
      	instead of no clause or firstprivate.
      
      	* c-c++-common/gomp/pr99928-4.c: Remove all xfails.
      	* c-c++-common/gomp/pr99928-5.c: Likewise.
      94fa4c67
    • Jakub Jelinek's avatar
      phiopt: Simplify (X & Y) == X -> (X & ~Y) == 0 even in presence of integral conversions [PR94589] · 2b536797
      Jakub Jelinek authored
      On Wed, May 19, 2021 at 10:15:53AM +0200, Christophe Lyon via Gcc-patches wrote:
      > After this update, the test fails on arm and aarch64: according to the
      > logs, the optimization is still performed 14 times.
      
      Seems this is because
                    if (change
                        && !flag_syntax_only
                        && (load_extend_op (TYPE_MODE (TREE_TYPE (and0)))
                            == ZERO_EXTEND))
                      {
                        tree uns = unsigned_type_for (TREE_TYPE (and0));
                        and0 = fold_convert_loc (loc, uns, and0);
                        and1 = fold_convert_loc (loc, uns, and1);
                      }
      in fold-const.c adds on these targets extra casts that prevent the
      optimizations.
      
      2021-05-20  Jakub Jelinek  <jakub@redhat.com>
      
      	PR tree-optimization/94589
      	* match.pd ((X & Y) == X -> (X & ~Y) == 0): Simplify even in presence
      	of integral conversions.
      2b536797
    • Jakub Jelinek's avatar
      libcpp: Fix up -fdirectives-only handling of // comments on last line not... · d15a2d26
      Jakub Jelinek authored
      libcpp: Fix up -fdirectives-only handling of // comments on last line not terminated with newline [PR100646]
      
      As can be seen on the testcases, before the -fdirectives-only preprocessing
      rewrite the preprocessor would assume // comments are terminated by the
      end of file even when newline wasn't there, but now we error out.
      The following patch restores the previous behavior.
      
      2021-05-20  Jakub Jelinek  <jakub@redhat.com>
      
      	PR preprocessor/100646
      	* lex.c (cpp_directive_only_process): Treat end of file as termination
      	for !is_block comments.
      
      	* gcc.dg/cpp/pr100646-1.c: New test.
      	* gcc.dg/cpp/pr100646-2.c: New test.
      d15a2d26
    • Jason Merrill's avatar
      c++: _Complex template parameter [PR100634] · 75ab8b48
      Jason Merrill authored
      We were crashing because invalid_nontype_parm_type_p allowed _Complex
      template parms, but convert_nontype_argument didn't know what to do for
      them.  Let's just disallow it, people can and should use std::complex
      instead.
      
      	PR c++/100634
      
      gcc/cp/ChangeLog:
      
      	* pt.c (invalid_nontype_parm_type_p): Return true for COMPLEX_TYPE.
      
      gcc/testsuite/ChangeLog:
      
      	* g++.dg/cpp2a/nontype-complex1.C: New test.
      75ab8b48
    • Jason Merrill's avatar
      c++: ICE with using and enum [PR100659] · fe9a6614
      Jason Merrill authored
      Here the code for 'using enum' is confused by the combination of a
      using-decl and an enum that are not from 'using enum'; this CONST_DECL is
      from the normal unscoped enum scoping.
      
      	PR c++/100659
      
      gcc/cp/ChangeLog:
      
      	* cp-tree.h (CONST_DECL_USING_P): Check for null TREE_TYPE.
      
      gcc/testsuite/ChangeLog:
      
      	* g++.dg/parse/access13.C: New test.
      fe9a6614
    • GCC Administrator's avatar
      Daily bump. · 65f32e5d
      GCC Administrator authored
      65f32e5d
  2. May 19, 2021
    • Martin Sebor's avatar
      PR c/100619 - ICE on a VLA parameter with too many dimensions · eb2a917f
      Martin Sebor authored
      gcc/c-family/ChangeLog:
      
      	PR c/100619
      	* c-attribs.c (build_attr_access_from_parms): Handle arbitrarily many
      	bounds.
      
      gcc/testsuite/ChangeLog:
      
      	PR c/100619
      	* gcc.dg/pr100619.c: New test.
      eb2a917f
    • Andrew MacLeod's avatar
      Split gimple range folding with ranges into a stand alone class. · dc6758f0
      Andrew MacLeod authored
      Introduces fold_using_range which folds any kind of gimple statement by
      querying argument ranges thru a generic range_query.
      This pulls all the statement processing into a client neutral location.
      
      	* gimple-range.cc (fur_source::get_operand): New.
      	(gimple_range_fold): Delete.
      	(fold_using_range::fold_stmt): Move from gimple_ranger::calc_stmt.
      	(fold_using_range::range_of_range_op): Move from gimple_ranger.
      	(fold_using_range::range_of_address): Ditto.
      	(fold_using_range::range_of_phi): Ditto.
      	(fold_using_range::range_of_call): Ditto.
      	(fold_using_range::range_of_builtin_ubsan_call): Move from
      	range_of_builtin_ubsan_call.
      	(fold_using_range::range_of_builtin_call): Move from
      	range_of_builtin_call.
      	(gimple_ranger::range_of_builtin_call): Delete.
      	(fold_using_range::range_of_cond_expr): Move from gimple_ranger.
      	(gimple_ranger::fold_range_internal): New.
      	(gimple_ranger::range_of_stmt): Use new fold_using_range API.
      	(fold_using_range::range_of_ssa_name_with_loop_info): Move from
      	gimple_ranger.  Improve ranges of SSA_NAMES when possible.
      	* gimple-range.h (gimple_ranger): Remove various range_of routines.
      	(class fur_source): New.
      	(class fold_using_range): New.
      	(fur_source::fur_source): New.
      	(fold_range): New.
      	* vr-values.c (vr_values::extract_range_basic): Use fold_using_range
      	instead of range_of_builtin_call.
      dc6758f0
    • Jason Merrill's avatar
      c++: ICE with <=> fallback [PR100367] · cd673437
      Jason Merrill authored
      Here, when genericizing lexicographical_compare_three_way, we haven't yet
      walked the operands, so (a == a) still sees ADDR_EXPR <a>, but this is after
      we've changed the type of a to REFERENCE_TYPE.  When we try to fold (a == a)
      by constexpr evaluation, the constexpr code doesn't understand trying to
      take the address of a reference, and we end up crashing.
      
      Fixed by avoiding constexpr evaluation in genericize_spaceship, by using
      fold_build2 instead of build_new_op on scalar operands.  Class operands
      should have been expanded during parsing.
      
      	PR c++/100367
      	PR c++/96299
      
      gcc/cp/ChangeLog:
      
      	* method.c (genericize_spaceship): Use fold_build2 for scalar
      	operands.
      
      gcc/testsuite/ChangeLog:
      
      	* g++.dg/cpp2a/spaceship-fallback1.C: New test.
      cd673437
    • Jonathan Wakely's avatar
      doc: Update description of __GXX_EXPERIMENTAL_CXX0X__ · 9b50282b
      Jonathan Wakely authored
      This macro has been obsolete for years, and C++0x features are no longer
      experimental or liable to be removed.
      
      gcc/ChangeLog:
      
      	* doc/cpp.texi (Common Predefined Macros): Update documentation
      	for the __GXX_EXPERIMENTAL_CXX0X__ macro.
      9b50282b
    • Jason Merrill's avatar
      c++: implicit deduction guides, protected access · 873c5188
      Jason Merrill authored
      Jonathan raised this issue with CWG, and there seems to be general agreement
      that a deduction guide generated from a constructor should have access to
      the same names that the constructor has access to.  That seems to be as easy
      as setting DECL_CONTEXT.
      
      gcc/cp/ChangeLog:
      
      	* pt.c (build_deduction_guide): Treat the implicit deduction guide
      	as a member of the class.
      
      gcc/testsuite/ChangeLog:
      
      	* g++.dg/cpp1z/class-deduction-access1.C: New test.
      	* g++.dg/cpp1z/class-deduction-access2.C: New test.
      873c5188
    • Marek Polacek's avatar
      c++: Relax attribute on friend declaration checking [PR100596] · adcb497b
      Marek Polacek authored
      It turned out that there are codebases that profusely use GNU attributes
      on friend declarations, so we have to dial back our checking and allow
      them.  And for C++11 attributes let's just warn instead of giving
      errors.
      
      	PR c++/100596
      
      gcc/cp/ChangeLog:
      
      	* cp-tree.h (any_non_type_attribute_p): Remove.
      	* decl.c (grokdeclarator): Turn an error into a warning and only
      	warn for standard attributes.
      	* decl2.c (any_non_type_attribute_p): Remove.
      	* parser.c (cp_parser_elaborated_type_specifier): Turn an error
      	into a warning and only warn for standard attributes.
      	(cp_parser_member_declaration): Likewise.
      
      gcc/testsuite/ChangeLog:
      
      	* g++.dg/cpp0x/friend7.C: Turn a few dg-warnings into dg-errors.
      	Remove dg-errors for GNU attributes.
      	* g++.dg/ext/attrib63.C: Remove dg-error.
      	* g++.dg/cpp0x/friend8.C: New test.
      adcb497b
    • Kito Cheng's avatar
      testuite: Check pthread for omp module testing · a911287e
      Kito Cheng authored
      gcc/testsuite/ChangeLog:
      
      	* g++.dg/modules/omp-1_a.C: Check pthread is available.
      	* g++.dg/modules/omp-1_b.C: Ditto.
      	* g++.dg/modules/omp-1_c.C: Ditto.
      	* g++.dg/modules/omp-2_a.C: Ditto.
      	* g++.dg/modules/omp-2_b.C: Ditto.
      a911287e
    • Alex Coplan's avatar
      arm: Fix ICE with CMSE nonsecure calls on Armv8.1-M [PR100333] · 5b953740
      Alex Coplan authored
      As the PR shows, we ICE shortly after expanding nonsecure calls for Armv8.1-M.
      For Armv8.1-M, we have TARGET_HAVE_FPCXT_CMSE. As it stands, the expander
      (arm.md:nonsecure_call_internal) moves the callee's address to a register (with
      copy_to_suggested_reg) only if !TARGET_HAVE_FPCXT_CMSE.
      
      However, looking at the pattern which the insn appears to be intended to
      match (thumb2.md:*nonsecure_call_reg_thumb2_fpcxt), it requires the
      callee's address to be in a register.
      
      This patch therefore just forces the callee's address into a register in
      the expander.
      
      gcc/ChangeLog:
      
      	PR target/100333
      	* config/arm/arm.md (nonsecure_call_internal): Always ensure
      	callee's address is in a register.
      
      gcc/testsuite/ChangeLog:
      
      	PR target/100333
      	* gcc.target/arm/cmse/pr100333.c: New test.
      5b953740
    • Christophe Lyon's avatar
      arm/testsuite: Fix testcase for PR99977 · beeb0154
      Christophe Lyon authored
      Some targets (eg arm-none-uclinuxfdpiceabi) do not support Thumb-1,
      and since the testcase forces -march=armv8-m.base, we need to check
      whether this option is actually supported.
      
      Using dg-add-options arm_arch_v8m_base ensure that we pass -mthumb as
      needed too.
      
      2021-05-19  Christophe Lyon  <christophe.lyon@linaro.org>
      
      	PR target/99977
      	gcc/testsuite/
      	* gcc.target/arm/pr99977.c: Require arm_arch_v8m_base.
      beeb0154
    • Geng Qi's avatar
      RISC-V: Properly parse the letter 'p' in '-march'. · 1e664807
      Geng Qi authored
      gcc/ChangeLog:
      	* common/config/riscv/riscv-common.c
      	(riscv_subset_list::parsing_subset_version): Properly parse the letter
      	'p' in '-march'.
      	(riscv_subset_list::parse_std_ext,
      	 riscv_subset_list::parse_multiletter_ext): To handle errors generated
      	in riscv_subset_list::parsing_subset_version.
      
      gcc/testsuite/ChangeLog:
      	* gcc.target/riscv/arch-12.c: New.
      	* gcc.target/riscv/attribute-19.c: New.
      1e664807
    • Jonathan Wright's avatar
      aarch64: Use correct type attributes for RTL generating XTN(2) · 45364338
      Jonathan Wright authored
      Use the correct "neon_move_narrow_q" type attribute in RTL patterns
      that generate XTN/XTN2 instructions.
      
      This makes a material difference because these instructions can be
      executed on both SIMD pipes in the Cortex-A57 core model, whereas the
      "neon_shift_imm_narrow_q" attribute (in use until now) would suggest
      to the scheduler that they could only execute on one of the two
      pipes.
      
      gcc/ChangeLog:
      
      2021-05-18  Jonathan Wright  <jonathan.wright@arm.com>
      
      	* config/aarch64/aarch64-simd.md: Use "neon_move_narrow_q"
      	type attribute in patterns generating XTN(2).
      45364338
    • Jonathan Wright's avatar
      aarch64: Use an expander for quad-word vec_pack_trunc pattern · 577d5819
      Jonathan Wright authored
      The existing vec_pack_trunc RTL pattern emits an opaque two-
      instruction assembly code sequence that prevents proper instruction
      scheduling. This commit changes the pattern to an expander that emits
      individual xtn and xtn2 instructions.
      
      This commit also consolidates the duplicate truncation patterns.
      
      gcc/ChangeLog:
      
      2021-05-17  Jonathan Wright  <jonathan.wright@arm.com>
      
      	* config/aarch64/aarch64-simd.md (aarch64_simd_vec_pack_trunc_<mode>):
      	Remove as duplicate of...
      	(aarch64_xtn<mode>): This.
      	(aarch64_xtn2<mode>_le): Move position in file.
      	(aarch64_xtn2<mode>_be): Move position in file.
      	(aarch64_xtn2<mode>): Move position in file.
      	(vec_pack_trunc_<mode>): Define as an expander.
      577d5819
    • Jonathan Wright's avatar
      testsuite: aarch64: Add tests for high-half narrowing instructions · a680be25
      Jonathan Wright authored
      Add tests to confirm that a *2 (write to high-half) Neon instruction
      is generated from vcombine* of a narrowing intrinsic sequence.
      
      gcc/testsuite/ChangeLog:
      
      2021-05-14  Jonathan Wright  <jonathan.wright@arm.com>
      
      	* gcc.target/aarch64/narrow_high_combine.c: New test.
      a680be25
    • Jonathan Wright's avatar
      aarch64: Refactor aarch64_<sur>q<r>shr<u>n_n<mode> RTL pattern · ddbdb9a3
      Jonathan Wright authored
      Split the aarch64_<sur>q<r>shr<u>n_n<mode> pattern into separate
      scalar and vector variants. Further split the vector pattern into
      big/little endian variants that model the zero-high-half semantics
      of the underlying instruction - allowing for more combinations with
      the write-to-high-half variant (aarch64_<sur>q<r>shr<u>n2_n<mode>.)
      
      gcc/ChangeLog:
      
      2021-05-14  Jonathan Wright  <jonathan.wright@arm.com>
      
      	* config/aarch64/aarch64-simd-builtins.def: Split builtin
      	generation for aarch64_<sur>q<r>shr<u>n_n<mode> pattern into
      	separate scalar and vector generators.
      	* config/aarch64/aarch64-simd.md
      	(aarch64_<sur>q<r>shr<u>n_n<mode>): Define as an expander and
      	split into...
      	(aarch64_<sur>q<r>shr<u>n_n<mode>_insn_le): This and...
      	(aarch64_<sur>q<r>shr<u>n_n<mode>_insn_be): This.
      	* config/aarch64/iterators.md: Define SD_HSDI iterator.
      ddbdb9a3
    • Jonathan Wright's avatar
      aarch64: Relax aarch64_sqxtun2<mode> RTL pattern · 778ac63f
      Jonathan Wright authored
      Use UNSPEC_SQXTUN instead of UNSPEC_SQXTUN2 in aarch64_sqxtun2<mode>
      patterns. This allows for more more aggressive combinations and
      ultimately better code generation. The now redundant UNSPEC_SQXTUN2
      is removed.
      
      gcc/ChangeLog:
      
      2021-05-14  Jonathn Wright  <jonathan.wright@arm.com>
      
      	* config/aarch64/aarch64-simd.md: Use UNSPEC_SQXTUN instead
      	of UNSPEC_SQXTUN2.
      	* config/aarch64/iterators.md: Remove UNSPEC_SQXTUN2.
      778ac63f
    • Jonathan Wright's avatar
      aarch64: Relax aarch64_<sur>q<r>shr<u>n2_n<mode> RTL pattern · 4e26303e
      Jonathan Wright authored
      Implement saturating right-shift and narrow high Neon intrinsic RTL
      patterns using a vec_concat of a register_operand and a VQSHRN_N
      unspec - instead of just a VQSHRN_N unspec. This more relaxed pattern
      allows for more aggressive combinations and ultimately better code
      generation.
      
      gcc/ChangeLog:
      
      2021-03-04  Jonathan Wright  <jonathan.wright@arm.com>
      
      	* config/aarch64/aarch64-simd.md (aarch64_<sur>q<r>shr<u>n2_n<mode>):
      	Implement as an expand emitting a big/little endian
      	instruction pattern.
      	(aarch64_<sur>q<r>shr<u>n2_n<mode>_insn_le): Define.
      	(aarch64_<sur>q<r>shr<u>n2_n<mode>_insn_be): Define.
      4e26303e
    • Jonathan Wright's avatar
      aarch64: Relax aarch64_<sur><addsub>hn2<mode> RTL pattern · 3eddaad0
      Jonathan Wright authored
      Implement v[r]addhn2 and v[r]subhn2 Neon intrinsic RTL patterns using
      a vec_concat of a register_operand and an ADDSUBHN unspec - instead
      of just an ADDSUBHN2 unspec. This more relaxed pattern allows for
      more aggressive combinations and ultimately better code generation.
      
      This patch also removes the now redundant [R]ADDHN2 and [R]SUBHN2
      unspecs and their iterator.
      
      gcc/ChangeLog:
      
      2021-03-03  Jonathan Wright  <jonathan.wright@arm.com>
      
      	* config/aarch64/aarch64-simd.md (aarch64_<sur><addsub>hn2<mode>):
      	Implement as an expand emitting a big/little endian
      	instruction pattern.
      	(aarch64_<sur><addsub>hn2<mode>_insn_le): Define.
      	(aarch64_<sur><addsub>hn2<mode>_insn_be): Define.
      	* config/aarch64/iterators.md: Remove UNSPEC_[R]ADDHN2 and
      	UNSPEC_[R]SUBHN2 unspecs and ADDSUBHN2 iterator.
      3eddaad0
    • Richard Biener's avatar
      middle-end/100672 - fix bogus right shift folding · 8d51039c
      Richard Biener authored
      This fixes the bogus use of TYPE_PRECISION on vector types
      from optimizing -((int)x >> 31) into (unsigned)x >> 31.
      
      2021-05-19  Richard Biener  <rguenther@suse.de>
      
      	PR middle-end/100672
      	* fold-const.c (fold_negate_expr_1): Use element_precision.
      	(negate_expr_p): Likewise.
      
      	* gcc.dg/torture/pr100672.c: New testcase.
      8d51039c
    • Martin Liska's avatar
      Fix typos. · 32bd0353
      Martin Liska authored
      	PR testsuite/100658
      
      gcc/cp/ChangeLog:
      
      	* mangle.c (write_encoding): Fix typos.
      
      gcc/jit/ChangeLog:
      
      	* libgccjit.c (gcc_jit_context_new_function): Fix typos.
      
      gcc/testsuite/ChangeLog:
      
      	* gcc.dg/local1.c: Fix typos.
      	* gcc.dg/ucnid-5-utf8.c: Likewise.
      	* gcc.dg/ucnid-5.c: Likewise.
      32bd0353
    • Andre Simoes Dias Vieira's avatar
      aarch64: Enable aarch64_load to use UNSPEC_PRED_X loads · 7bb4b7a5
      Andre Simoes Dias Vieira authored
      This patch will enable the use of loads using the UNSPEC_PRED_X enum in the
      aarch64_load pattern, thus enabling combine to combine such loads with extends.
      
      gcc/ChangeLog:
      2021-05-19  Andre Vieira  <andre.simoesdiasvieira@arm.com>
      
      	* config/aarch64/iterators.md (SVE_PRED_LOAD): New iterator.
      	(pred_load): New int attribute.
      	* config/aarch64/aarch64-sve.md
      	(aarch64_load_<ANY_EXTEND:optab><SVE_HSDI:mode><SVE_PARTIAL_I:mode>): Use
      	SVE_PRED_LOAD enum iterator and corresponding pred_load attribute.
      	* config/aarch64/aarch64-sve-builtins-base.cc (expand): Update call to
      	code_for_aarch64_load.
      
      gcc/testsuite/ChangeLog:
      2021-05-19  Andre Vieira  <andre.simoesdiasvieira@arm.com>
      
      	* gcc.target/aarch64/sve/logical_unpacked_and_2.c: Change
      	scan-assembly-times to scan-assembly not for superfluous uxtb.
      	* gcc.target/aarch64/sve/logical_unpacked_and_3.c: Likewise.
      	* gcc.target/aarch64/sve/logical_unpacked_and_4.c: Likewise.
      	* gcc.target/aarch64/sve/logical_unpacked_and_6.c: Likewise.
      	* gcc.target/aarch64/sve/logical_unpacked_and_7.c: Likewise.
      	* gcc.target/aarch64/sve/logical_unpacked_eor_2.c: Likewise.
      	* gcc.target/aarch64/sve/logical_unpacked_eor_3.c: Likewise.
      	* gcc.target/aarch64/sve/logical_unpacked_eor_4.c: Likewise.
      	* gcc.target/aarch64/sve/logical_unpacked_eor_6.c: Likewise.
      	* gcc.target/aarch64/sve/logical_unpacked_eor_7.c: Likewise.
      	* gcc.target/aarch64/sve/logical_unpacked_orr_2.c: Likewise.
      	* gcc.target/aarch64/sve/logical_unpacked_orr_3.c: Likewise.
      	* gcc.target/aarch64/sve/logical_unpacked_orr_4.c: Likewise.
      	* gcc.target/aarch64/sve/logical_unpacked_orr_6.c: Likewise.
      	* gcc.target/aarch64/sve/logical_unpacked_orr_7.c: Likewise.
      	* gcc.target/aarch64/sve/ld1_extend.c: New test.
      7bb4b7a5
    • Richard Biener's avatar
      Avoid marking TARGET_MEM_REF bases addressable · 35a16e4b
      Richard Biener authored
      The following does no longer mark TARGET_MEM_REF bases addressable,
      mimicing MEM_REFs beahvior here.  In contrast to the latter,
      TARGET_MEM_REF RTL expansion expects to always operate on memory
      though, so make sure we expand them so.
      
      2021-05-19  Richard Biener  <rguenther@suse.de>
      
      	* cfgexpand.c (discover_nonconstant_array_refs_r): Make
      	sure TARGET_MEM_REF bases are expanded as memory.
      	* tree-ssa-operands.c (operands_scanner::get_tmr_operands):
      	Do not mark TARGET_MEM_REF bases addressable.
      	* tree-ssa.c (non_rewritable_mem_ref_base): Handle
      	TARGET_MEM_REF bases as never rewritable.
      	* gimple-walk.c (walk_stmt_load_store_addr_ops): Do not
      	walk TARGET_MEM_REF bases as address-takens.
      	* tree-ssa-dce.c (ref_may_be_aliased): Handle TARGET_MEM_REF.
      35a16e4b
    • Richard Biener's avatar
      Enable more WITH_SIZE_EXPR processing · 2e6ad1ba
      Richard Biener authored
      This enables the alias machinery for WITH_SIZE_EXPR which can appear
      in call LHS and arguments.  In particular this drops the NULL
      return from get_base_address and it adjusts get_ref_base_and_extent
      and friends to use the size information in WITH_SIZE_EXPR and
      look through it for further processing.
      
      2021-05-19  Richard Biener  <rguenther@suse.de>
      
      	* builtins.c (get_object_alignment_1): Strip outer
      	WITH_SIZE_EXPR.
      	* tree-dfa.c (get_ref_base_and_extent): Handle outer
      	WITH_SIZE_EXPR for size processing and process the
      	containing ref.
      	* tree-ssa-alias.c (ao_ref_base_alias_set): Strip
      	outer WITH_SIZE_EXPR.
      	(ao_ref_base_alias_ptr_type): Likewise.
      	(refs_may_alias_p_2): Allow WITH_SIZE_EXPR in ref->ref
      	and handle that accordingly, stripping it for the
      	core alias workers.
      	* tree.c (get_base_address): Handle WITH_SIZE_EXPR by
      	looking through it instead of returning NULL.
      2e6ad1ba
    • Thomas Schwinge's avatar
      Add 'libgomp.oacc-c-c++-common/private-atomic-1.c' [PR83812] · 1467100f
      Thomas Schwinge authored
      ... to at least document/test/XFAIL nvptx offloading: PR83812 "operation not
      supported on global/shared address space".
      
      	libgomp/
      	PR target/83812
      	* testsuite/libgomp.oacc-c-c++-common/private-atomic-1.c: New.
      1467100f
    • Julian Brown's avatar
      Add 'libgomp.oacc-c-c++-common/loop-gwv-2.c' · 5a16fb19
      Julian Brown authored
      	libgomp/
      	* testsuite/libgomp.oacc-c-c++-common/loop-gwv-2.c: New.
      5a16fb19
    • Jakub Jelinek's avatar
      builtins: Fix ICE with unprototyped builtin call [PR100576] · e6683450
      Jakub Jelinek authored
      For unprototyped builtins the checking we perform is only about whether
      the used argument is integral, pointer etc., not the exact precision.
      We emit a warning about the problem though:
      pr100576.c: In function ‘foo’:
      pr100576.c:9:11: warning: implicit declaration of function ‘memcmp’ [-Wimplicit-function-declaration]
          9 |   int n = memcmp (p, v, b);
            |           ^~~~~~
      pr100576.c:1:1: note: include ‘<string.h>’ or provide a declaration of ‘memcmp’
        +++ |+#include <string.h>
          1 | /* PR middle-end/100576 */
      pr100576.c:9:25: warning: ‘memcmp’ argument 3 type is ‘int’ where ‘long unsigned int’ is expected in a call to built-in function declared without prototype
      +[-Wbuiltin-declaration-mismatch]
          9 |   int n = memcmp (p, v, b);
            |                         ^
      It means in the testcase below where the user incorrectly called memcmp
      with last argument int rather then size_t, the warning stuff in builtins.c
      ICEs because it compares a wide_int from such a bound with another wide_int
      which has precision of size_t/sizetype and wide_int asserts the compared
      wide_ints are compatible.
      
      Fixed by forcing the bound to have the right type.
      
      2021-05-19  Jakub Jelinek  <jakub@redhat.com>
      
      	PR middle-end/100576
      	* builtins.c (check_read_access): Convert bound to size_type_node if
      	non-NULL.
      
      	* gcc.c-torture/compile/pr100576.c: New test.
      e6683450
    • Richard Biener's avatar
      apply TLC to GIMPLE reference verification · a73a5af2
      Richard Biener authored
      This inlines verify_types_in_gimple_min_lval and makes sure we
      also verify call lhs and arguments.  It also asserts that
      WITH_SIZE_EXPR in plain assignments does not happen, instead
      those should have become memcpy/memset.
      
      2021-05-18  Richard Biener  <rguenther@suse.de>
      
      	* tree-cfg.c (verify_types_in_gimple_min_lval): Inline...
      	(verify_types_in_gimple_reference): ... here.  Sanitize.
      	(verify_gimple_call): Verify references in LHS and arguments.
      	(verify_gimple_assign_single): Reject WITH_SIZE_EXPR.
      a73a5af2
    • Uros Bizjak's avatar
      i386: Allow 64bit vector modes in general registers · ea30c7bd
      Uros Bizjak authored
      Allow V8QI, V4HI and V2SI modes in 64bit general registers for
      TARGET_64BIT and add alternatives using general registers
      to 64bit vector logic instructions.
      
      2021-05-19  Uroš Bizjak  <ubizjak@gmail.com>
      
      gcc/
      	* config/i386/i386.h (VALID_INT_MODE_P):
      	Add V8QI, V4HI and V2SI modes for TARGET_64BIT.
      	* config/i386/i386.md (isa): Add x64_bmi.
      	(enabled): Handle x64_bmi.
      	* config/i386/mmx.md (mmx_andnot<MMXMODEI:mode>3):
      	Add alternative using 64bit general registers.
      	(*mmx_<any_logic:code><MMXMODEI:mode>3): Ditto.
      ea30c7bd
    • Bernd Edlinger's avatar
      Fix commit mistake in testcase gcc.dg/tree-ssa/ssa-sink-3.c · 51cfa554
      Bernd Edlinger authored
      the test case was accidenally changed to empty file.
      
      2021-05-19  Bernd Edlinger  <bernd.edlinger@hotmail.de>
      
      	* gcc.dg/tree-ssa/ssa-sink-3.c: Fix test case.
      51cfa554
    • Jakub Jelinek's avatar
      openmp: Handle lastprivate on combined target correctly [PR99928] · 780e5d4a
      Jakub Jelinek authored
      This patch deals with 2 issues:
      1) the gimplifier couldn't differentiate between
       #pragma omp parallel master
       #pragma omp taskloop simd
      and
       #pragma omp parallel master taskloop simd
      when there is a significant difference for clause handling between
      the two; as master construct doesn't have any clauses, we don't currently
      represent it during gimplification by an gimplification omp context at all,
      so this patch makes sure we don't set OMP_PARALLEL_COMBINED on parallel master
      when not combined further.  If we ever add a separate master context during
      gimplification, we'd use ORT_COMBINED_MASTER vs. ORT_MASTER (or MASKED probably).
      2) lastprivate when combined with target should be map(tofrom:) on the target,
      this change handles it only when not combined with firstprivate though, that
      will need further work (similarly to linear or reduction).
      
      2021-05-19  Jakub Jelinek  <jakub@redhat.com>
      
      	PR middle-end/99928
      gcc/
      	* tree.h (OMP_MASTER_COMBINED): Define.
      	* gimplify.c (gimplify_scan_omp_clauses): Rewrite lastprivate
      	handling for outer combined/composite constructs to a loop.
      	Handle lastprivate on combined target.
      	(gimplify_expr): Formatting fix.
      gcc/c/
      	* c-parser.c (c_parser_omp_master): Set OMP_MASTER_COMBINED on
      	master when combined with taskloop.
      	(c_parser_omp_parallel): Don't set OMP_PARALLEL_COMBINED on
      	parallel master when not combined with taskloop.
      gcc/cp/
      	* parser.c (cp_parser_omp_master): Set OMP_MASTER_COMBINED on
      	master when combined with taskloop.
      	(cp_parser_omp_parallel): Don't set OMP_PARALLEL_COMBINED on
      	parallel master when not combined with taskloop.
      gcc/testsuite/
      	* c-c++-common/gomp/pr99928-2.c: Remove all xfails.
      	* c-c++-common/gomp/pr99928-12.c: New test.
      780e5d4a
    • Ian Lance Taylor's avatar
    • Ian Lance Taylor's avatar
      gofrontend: revert startswith change · 2ebddf2e
      Ian Lance Taylor authored
      This file is copied from a different repo and should not be changed
      directly in the GCC repo.
      2ebddf2e
    • Ian Lance Taylor's avatar
      libgo: update configure to current sources · c922c653
      Ian Lance Taylor authored
      Change-Id: I12766baf02bfdf2233f1c5bde1a270f06b020aa7
      Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/321076
      
      
      Trust: Ian Lance Taylor <iant@golang.org>
      Reviewed-by: default avatarCherry Mui <cherryyz@google.com>
      Reviewed-by: default avatarThan McIntosh <thanm@google.com>
      c922c653
Loading