Skip to content
Snippets Groups Projects
  1. Sep 09, 2024
    • Eric Botcazou's avatar
      Silence warning for 32-bit targets · 0171793a
      Eric Botcazou authored
      gcc/testsuite
      	PR ada/115250
      	* gnat.dg/opt58_pkg.ads: Convert to Unix line ending.
      	* gnat.dg/opt58.adb: Likewise and pass -gnatws to the compiler.
      0171793a
    • Eric Botcazou's avatar
      Remove problematic declaration for 32-bit targets · 4645aa79
      Eric Botcazou authored
      gcc/testsuite
      	PR ada/115246
      	* gnat.dg/alignment14.adb (My_Int2): Delete.
      	(Arr2): Likewise.
      4645aa79
    • Andrew Pinski's avatar
      gimple-fold: Move optimizing memcpy to memset to fold_stmt from fab · 2067df80
      Andrew Pinski authored
      
      I noticed this folding inside fab could be done else where and could
      even improve inlining decisions and a few other things so let's
      move it to fold_stmt.
      It also fixes PR 116601 because places which call fold_stmt already
      have to deal with the stmt becoming a non-throw statement.
      
      For the fix for PR 116601 on the branches should be the original patch
      rather than a backport of this one.
      
      Bootstrapped and tested on x86_64-linux-gnu.
      
      	PR tree-optimization/116601
      
      gcc/ChangeLog:
      
      	* gimple-fold.cc (optimize_memcpy_to_memset): Move
      	from tree-ssa-ccp.cc and rename. Also return true
      	if the optimization happened.
      	(gimple_fold_builtin_memory_op): Call
      	optimize_memcpy_to_memset.
      	(fold_stmt_1): Call optimize_memcpy_to_memset for
      	load/store copies.
      	* tree-ssa-ccp.cc (optimize_memcpy): Delete.
      	(pass_fold_builtins::execute): Remove code that
      	calls optimize_memcpy.
      
      gcc/testsuite/ChangeLog:
      
      	* gcc.dg/pr78408-1.c: Adjust dump scan to match where
      	the optimization now happens.
      	* g++.dg/torture/except-2.C: New test.
      
      Signed-off-by: default avatarAndrew Pinski <quic_apinski@quicinc.com>
      2067df80
    • Richard Biener's avatar
      Amend gcc.dg/vect/fast-math-vect-call-2.c · 924855da
      Richard Biener authored
      There was a reported regression on x86-64 with -march=cascadelake
      and -m32 where epilogue vectorization causes a different number of
      SLPed loops.  Fixed by disabling epilogue vectorization for the
      testcase.
      
      	* gcc.dg/vect/fast-math-vect-call-2.c: Disable epilogue
      	vectorization.
      924855da
    • Jakub Jelinek's avatar
      testsuite: Fix up pr116588.c test [PR116588] · 765875e2
      Jakub Jelinek authored
      The test as committed without the tree-vrp.cc change only FAILs with
      FAIL: gcc.dg/pr116588.c scan-tree-dump-not vrp2 "0 != 0"
      The DEBUG code in there was just to make it easier to debug, but doesn't
      actually fail when the test is miscompiled.
      We don't need such debugging code in simple tests like that, but it is
      useful if they abort when miscompiled.
      
      With this patch without the tree-vrp.cc change I see
      FAIL: gcc.dg/pr116588.c execution test
      FAIL: gcc.dg/pr116588.c scan-tree-dump-not vrp2 "0 != 0"
      and with it it passes.
      
      2024-09-09  Jakub Jelinek  <jakub@redhat.com>
      
      	PR tree-optimization/116588
      	* gcc.dg/pr116588.c: Remove -DDEBUG from dg-options.
      	(main): Remove debugging code and simplify.
      765875e2
    • Thomas Schwinge's avatar
      Match: Fix ordered and nonequal: Fix 'gcc.dg/opt-ordered-and-nonequal-1.c' re... · 00b35424
      Thomas Schwinge authored
      Match: Fix ordered and nonequal: Fix 'gcc.dg/opt-ordered-and-nonequal-1.c' re 'LOGICAL_OP_NON_SHORT_CIRCUIT' [PR116635]
      
      Fix up to make 'gcc.dg/opt-ordered-and-nonequal-1.c' of
      commit 91421e21
      "Match: Fix ordered and nonequal" work for default
      'LOGICAL_OP_NON_SHORT_CIRCUIT == false' configurations.
      
      	PR testsuite/116635
      	gcc/testsuite/
      	* gcc.dg/opt-ordered-and-nonequal-1.c: Fix re
      	'LOGICAL_OP_NON_SHORT_CIRCUIT'.
      00b35424
    • Andrew Pinski's avatar
      phiopt: Small refactoring/cleanup of non-ssa name case of factor_out_conditional_operation · d1b3d099
      Andrew Pinski authored
      
      This small cleanup removes a redundant check for gimple_assign_cast_p and reformats
      based on that. Also changes the if statement that checks if the integral type and the
      check to see if the constant fits into the new type such that it returns null
      and reformats based on that.
      
      Also moves the check for has_single_use earlier so it is less complex still a cheaper
      check than some of the others (like the check on the integer side).
      
      This was noticed when adding a few new things to factor_out_conditional_operation
      but those are not ready to submit yet.
      
      Note there are no functional difference with this change.
      
      Bootstrapped and tested on x86_64-linux-gnu.
      
      gcc/ChangeLog:
      
      	* tree-ssa-phiopt.cc (factor_out_conditional_operation): Move the has_single_use
      	checks much earlier. Remove redundant check for gimple_assign_cast_p.
      	Change around the check if the integral consts fits into the new type.
      
      Signed-off-by: default avatarAndrew Pinski <quic_apinski@quicinc.com>
      d1b3d099
    • Haochen Jiang's avatar
      doc: Enhance Intel CPU documentation · 91bc2ad2
      Haochen Jiang authored
      This patch will add those recent aliased CPU names into documentation
      for clearness.
      
      gcc/ChangeLog:
      
      	PR target/116617
      	* doc/invoke.texi: Add meteorlake, raptorlake and lunarlake.
      91bc2ad2
    • GCC Administrator's avatar
      Daily bump. · 39a01fcf
      GCC Administrator authored
      39a01fcf
  2. Sep 08, 2024
    • H.J. Lu's avatar
      x86-64: Don't use temp for argument in a TImode register · fa7bbb06
      H.J. Lu authored
      
      Don't use temp for a PARALLEL BLKmode argument of an EXPR_LIST expression
      in a TImode register.  Otherwise, the TImode variable will be put in
      the GPR save area which guarantees only 8-byte alignment.
      
      gcc/
      
      	PR target/116621
      	* config/i386/i386.cc (ix86_gimplify_va_arg): Don't use temp for
      	a PARALLEL BLKmode container of an EXPR_LIST expression in a
      	TImode register.
      
      gcc/testsuite/
      
      	PR target/116621
      	* gcc.target/i386/pr116621.c: New test.
      
      Signed-off-by: default avatarH.J. Lu <hjl.tools@gmail.com>
      fa7bbb06
    • Jørgen Kvalsvik's avatar
      gcov: Cache source files · 1e17a111
      Jørgen Kvalsvik authored
      Cache the source files as they are read, rather than discarding them at
      the end of output_lines (), and move the reading of the source file to
      the new function slurp.
      
      This patch does not really change anything other than moving the file
      reading out of output_file, but set gcov up for more interaction with
      the source file. The motvating example is reporting coverage on
      functions from different source files, notably C++ headers and
      ((always_inline)).
      
      Here is an example of what gcov does today:
      
      hello.h:
      inline __attribute__((always_inline))
      int hello (const char *s)
      {
        if (s)
          printf ("hello, %s!\n", s);
        else
          printf ("hello, world!\n");
        return 0;
      }
      
      hello.c:
      int notmain(const char *entity)
      {
        return hello (entity);
      }
      
      int main()
      {
        const char *empty = 0;
        if (!empty)
          hello (empty);
        else
          puts ("Goodbye!");
      }
      
      $ gcov -abc hello
      function notmain called 0 returned 0% blocks executed 0%
          #####:    4:int notmain(const char *entity)
          %%%%%:    4-block 2
      branch  0 never executed (fallthrough)
      branch  1 never executed
              -:    5:{
          #####:    6:  return hello (entity);
          %%%%%:    6-block 7
              -:    7:}
      
      Clearly there is a branch in notmain, but the branch comes from the
      inlining of hello. This is not very obvious from looking at the output.
      Here is hello.h.gcov:
      
              -:    3:inline __attribute__((always_inline))
              -:    4:int hello (const char *s)
              -:    5:{
          #####:    6:  if (s)
          %%%%%:    6-block 3
      branch  0 never executed (fallthrough)
      branch  1 never executed
          %%%%%:    6-block 2
      branch  2 never executed (fallthrough)
      branch  3 never executed
          #####:    7:    printf ("hello, %s!\n", s);
          %%%%%:    7-block 4
      call    0 never executed
          %%%%%:    7-block 3
      call    1 never executed
              -:    8:  else
          #####:    9:    printf ("hello, world!\n");
          %%%%%:    9-block 5
      call    0 never executed
          %%%%%:    9-block 4
      call    1 never executed
          #####:   10:  return 0;
          %%%%%:   10-block 6
          %%%%%:   10-block 5
              -:   11:}
      
      The blocks from the different call sites have all been interleaved.
      
      The reporting could tuned be to list the inlined function, too, like
      this:
      
              1:    4:int notmain(const char *entity)
              -: == inlined from hello.h ==
              1:    6:  if (s)
      branch  0 taken 0 (fallthrough)
      branch  1 taken 1
          #####:    7:    printf ("hello, %s!\n", s);
          %%%%%:    7-block 3
      call    0 never executed
              -:    8:  else
              1:    9:    printf ("hello, world!\n");
              1:    9-block 4
      call    0 returned 1
              1:   10:  return 0;
              1:   10-block 5
              -: == inlined from hello.h (end) ==
              -:    5:{
              1:    6:  return hello (entity);
              1:    6-block 7
              -:    7:}
      
      Implementing something to this effect relies on having the sources for
      both files (hello.c, hello.h) available, which is what this patch sets
      up.
      
      Note that the previous reading code would leak the source file content,
      and explicitly storing them is not a huge departure nor performance
      implication. I verified this with valgrind:
      
      With slurp:
      
      $ valgrind gcov ./hello
      == == Memcheck, a memory error detector
      == == Copyright (C) 2002-2022, and GNU GPL'd, by Julian Seward et al.
      == == Using Valgrind-3.19.0 and LibVEX; rerun with -h for copyright info
      == == Command: ./gcc/gcov demo
      == ==
      File 'hello.c'
      Lines executed:100.00% of 4
      Creating 'hello.c.gcov'
      
      File 'hello.h'
      Lines executed:75.00% of 4
      Creating 'hello.h.gcov'
      == ==
      == == HEAP SUMMARY:
      == ==     in use at exit: 84,907 bytes in 54 blocks
      == ==   total heap usage: 254 allocs, 200 frees, 137,156 bytes allocated
      == ==
      == == LEAK SUMMARY:
      == ==    definitely lost: 1,237 bytes in 22 blocks
      == ==    indirectly lost: 562 bytes in 18 blocks
      == ==      possibly lost: 0 bytes in 0 blocks
      == ==    still reachable: 83,108 bytes in 14 blocks
      == ==                       of which reachable via heuristic:
      == ==                         newarray           : 1,544 bytes in 1 blocks
      == ==         suppressed: 0 bytes in 0 blocks
      == == Rerun with --leak-check=full to see details of leaked memory
      == ==
      == == For lists of detected and suppressed errors, rerun with: -s
      == == ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
      
      Without slurp:
      
      $ valgrind gcov ./demo
      == == Memcheck, a memory error detector
      == == Copyright (C) 2002-2022, and GNU GPL'd, by Julian Seward et al.
      == == Using Valgrind-3.19.0 and LibVEX; rerun with -h for copyright info
      == == Command: ./gcc/gcov demo
      == ==
      File 'hello.c'
      Lines executed:100.00% of 4
      Creating 'hello.c.gcov'
      
      File 'hello.h'
      Lines executed:75.00% of 4
      Creating 'hello.h.gcov'
      
      Lines executed:87.50% of 8
      == ==
      == == HEAP SUMMARY:
      == ==     in use at exit: 85,316 bytes in 82 blocks
      == ==   total heap usage: 250 allocs, 168 frees, 137,084 bytes allocated
      == ==
      == == LEAK SUMMARY:
      == ==    definitely lost: 1,646 bytes in 50 blocks
      == ==    indirectly lost: 562 bytes in 18 blocks
      == ==      possibly lost: 0 bytes in 0 blocks
      == ==    still reachable: 83,108 bytes in 14 blocks
      == ==                       of which reachable via heuristic:
      == ==                         newarray           : 1,544 bytes in 1 blocks
      == ==         suppressed: 0 bytes in 0 blocks
      == == Rerun with --leak-check=full to see details of leaked memory
      == ==
      == == For lists of detected and suppressed errors, rerun with: -s
      == == ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
      
      gcc/ChangeLog:
      
      	* gcov.cc (release_structures): Release source_lines.
      	(slurp): New function.
      	(output_lines): Read sources with slurp.
      1e17a111
    • Jørgen Kvalsvik's avatar
      testsuite: Use dg-compile, not gcc -c · b8cd236c
      Jørgen Kvalsvik authored
      Since this is a pure compile test it makes sense to inform dejagnu of
      it.
      
      gcc/testsuite/ChangeLog:
      
      	* gcc.misc-tests/gcov-23.c: Use dg-compile, not gcc -c
      b8cd236c
    • GCC Administrator's avatar
      Daily bump. · bfb9105f
      GCC Administrator authored
      bfb9105f
  3. Sep 07, 2024
    • Andrew Pinski's avatar
      Fix pr116588.c for -m32 · 35c2bcb2
      Andrew Pinski authored
      
      This is a simple fix which adds the target supports requirement of int128
      to the testcase too.
      
      Pushed as obvious after testing to make sure the testcase is UNSUPPORTED now
      with -m32 but working with -m64 on x86_64-linux-gnu.
      
      gcc/testsuite/ChangeLog:
      
      	* gcc.dg/pr116588.c: Require int128.
      
      Signed-off-by: default avatarAndrew Pinski <quic_apinski@quicinc.com>
      35c2bcb2
    • Jason Merrill's avatar
      c++: exception spec and stdlib specialization · 7cebc638
      Jason Merrill authored
      We were silently accepting the pr65923.C specialization of std::swap with
      the wrong exception specification; it should be declared noexcept.  Let's
      limit ignoring mismatch with system headers to extern "C" functions so we
      get a diagnostic for the C++ library.
      
      In the case of an omitted exception-specification, let's also lower the
      error to a pedwarn, and copy the missing spec over, to avoid a hard break
      for code that accidentally relied on the old behavior.
      
      ...except extern "C" functions keep the new spec, to avoid breaking dubious
      code like noexcept-type19.C.
      
      gcc/cp/ChangeLog:
      
      	* decl.cc (check_redeclaration_exception_specification): Remove
      	OPT_Wsystem_headers from pedwarn when the old declaration is
      	in a system header.  Also check std namespace.
      
      gcc/testsuite/ChangeLog:
      
      	* g++.dg/diagnostic/pr65923.C: Add noexcept.
      	* g++.dg/cpp1z/aligned-new3.C: Expect pedwarn.
      	* g++.dg/cpp1z/noexcept-type19.C: Add comment.
      7cebc638
    • Andrew Pinski's avatar
      split-path: Fix dump wording about duplicating too many statements · 69d82c1d
      Andrew Pinski authored
      It was pointed out in https://gcc.gnu.org/pipermail/gcc-patches/2024-September/662183.html
      
      ,
      that the wording with this print has too many words.
      Fixed thusly.
      
      Pushed as obvious after a build and test for x86_64-linux-gnu.
      
      gcc/ChangeLog:
      
      	* gimple-ssa-split-paths.cc (is_feasible_trace): Fix wording
      	on the print.
      
      Signed-off-by: default avatarAndrew Pinski <quic_apinski@quicinc.com>
      69d82c1d
    • Patrick Palka's avatar
      c++: deferring partial substitution into lambda [PR116567] · dfb63765
      Patrick Palka authored
      
      Here we correctly defer partial substitution into the lambda used as
      a default template argument, but then incorrectly perform the full
      substitution, because add_extra_args adds outer template arguments from
      the full substitution that are not related to the original template
      context of the lambda.  For example, the template depth of the first
      lambda is 1 but add_extra_args return a set of args with 3 levels, with
      the inner level corresponding to the parameters of v1 (good) and the
      outer levels corresponding to those of A and B (bad).
      
      For the cases that we're interested in, add_extra_args can assume that
      the deferred args are a full set of template arguments, and so it
      suffices to just substitute into the deferred args and not do any
      additional merging.
      
      This patch refines add_extra_args accordingly, and additionally
      makes it look for the tf_partial flag instead of for dependent args to
      decide if the deferred substitution is a partial one.  This reveals we
      were neglecting to set tf_partial when substituting into a default
      template argument in a template context.
      
      	PR c++/116567
      
      gcc/cp/ChangeLog:
      
      	* pt.cc (coerce_template_parms): Set tf_partial when substituting
      	into a default template argument in a template context.
      	(build_extra_args): Set TREE_STATIC on the deferred args if this
      	is a partial substitution.
      	(add_extra_args): Check TREE_STATIC instead of dependence of args.
      	Adjust merging behavior in that case.
      	(tsubst_lammda_expr): Check for tf_partial instead of dependence
      	of args when determining whether to defer substitution.
      	(tsubst_expr) <case LAMBDA_EXPR>: Remove tf_partial early exit.
      
      gcc/testsuite/ChangeLog:
      
      	* g++.dg/cpp2a/lambda-targ7.C: New test.
      
      Reviewed-by: default avatarJason Merrill <jason@redhat.com>
      dfb63765
    • Andrew MacLeod's avatar
      Before running fast VRP, make sure all edges have EXECUTABLE set. · 506417db
      Andrew MacLeod authored
      	PR tree-optimization/116588
      	gcc/
      	* tree-vrp.cc (execute_fast_vrp): Start with all edges executable.
      	gcc/testsuite/
      	* gcc.dg/pr116588.c: New.
      506417db
    • Zhao Dingyi's avatar
      [PATCH] RISC-V: Add missing insn types for XiangShan Nanhu scheduler model · 6749c69a
      Zhao Dingyi authored
      This patch aims to add the missing instruction types to the XiangShan-Nanhu scheduler model.
      
      The current XiangShan -Nanhu model lacks the trap, atomic trap, fcvt_i2f, and fcvt_f2i instructions.
      
      The trap, atomic, and i2f instructions belong to xs_jmp_rs. [1]
      
      The f2i instruction belongs to xs_fmisc_rs.[2]
      
      [1]
      https://github.com/OpenXiangShan/XiangShan/blob/v2.0/src/main/scala/xiangshan/package.scala#L780
      
      [2]
      https://github.com/OpenXiangShan/XiangShan/blob/v2.0/src/main/scala/xiangshan/backend/decode/DecodeUnit.scala#L290
      
      gcc/ChangeLog:
      
      	* config/riscv/xiangshan.md: Add atomic, trap, fcvt_i2f, fcvt_f2i.
      6749c69a
    • Jin Ma's avatar
      [PATCH v4] [target/116592] RISC-V: Fix illegal operands "th.vsetvli zero,0,e32,m8" for XTheadVector · d620499b
      Jin Ma authored
      Since the THeadVector vsetvli does not support vl as an immediate, we
      need to convert 0 to zero when outputting asm.
      
      	PR target/116592
      
      gcc/ChangeLog:
      
      	* config/riscv/thead.cc (th_asm_output_opcode): Change '0' to
      	"zero"
      
      gcc/testsuite/ChangeLog:
      
      	* gcc.target/riscv/rvv/xtheadvector/pr116592.c: New test.
      d620499b
    • Thomas Koenig's avatar
      Implement first part of unsigned integers for Fortran. · 113a6da9
      Thomas Koenig authored
      gcc/fortran/ChangeLog:
      
      	* arith.cc (gfc_reduce_unsigned): New function.
      	(gfc_arith_error): Add ARITH_UNSIGNED_TRUNCATED and
      	ARITH_UNSIGNED_NEGATIVE.
      	(gfc_arith_init_1): Initialize unsigned types.
      	(gfc_check_unsigned_range): New function.
      	(gfc_range_check): Handle unsigned types.
      	(gfc_arith_uminus): Likewise.
      	(gfc_arith_plus): Likewise.
      	(gfc_arith_minus): Likewise.
      	(gfc_arith_times): Likewise.
      	(gfc_arith_divide): Likewise.
      	(gfc_compare_expr): Likewise.
      	(eval_intrinsic): Likewise.
      	(gfc_int2int): Also convert unsigned.
      	(gfc_uint2uint): New function.
      	(gfc_int2uint): New function.
      	(gfc_uint2int): New function.
      	(gfc_uint2real): New function.
      	(gfc_uint2complex): New function.
      	(gfc_real2uint): New function.
      	(gfc_complex2uint): New function.
      	(gfc_log2uint): New function.
      	(gfc_uint2log): New function.
      	* arith.h (gfc_int2uint, gfc_uint2uint, gfc_uint2int, gfc_uint2real):
      	Add prototypes.
      	(gfc_uint2complex, gfc_real2uint, gfc_complex2uint, gfc_log2uint):
      	Likewise.
      	(gfc_uint2log): Likewise.
      	* check.cc (gfc_boz2uint): New function
      	(type_check2): New function.
      	(int_or_real_or_unsigned_check): New function.
      	(less_than_bitsizekind): Adjust for unsingeds.
      	(less_than_bitsize2): Likewise.
      	(gfc_check_allocated): Likewise.
      	(gfc_check_mod): Likewise.
      	(gfc_check_bge_bgt_ble_blt): Likewise.
      	(gfc_check_bitfcn): Likewise.
      	(gfc_check_digits): Likewise.
      	(gfc_check_dshift): Likewise.
      	(gfc_check_huge): Likewise.
      	(gfc_check_iu): New function.
      	(gfc_check_iand_ieor_ior): Adjust for unsigneds.
      	(gfc_check_ibits): Likewise.
      	(gfc_check_uint): New function.
      	(gfc_check_ishft): Adjust for unsigneds.
      	(gfc_check_ishftc): Likewise.
      	(gfc_check_min_max): Likewise.
      	(gfc_check_merge_bits): Likewise.
      	(gfc_check_selected_int_kind): Likewise.
      	(gfc_check_shift): Likewise.
      	(gfc_check_mvbits): Likewise.
      	(gfc_invalid_unsigned_ops): Likewise.
      	* decl.cc (gfc_match_decl_type_spec): Likewise.
      	* dump-parse-tree.cc (show_expr): Likewise.
      	* expr.cc (gfc_get_constant_expr): Likewise.
      	(gfc_copy_expr): Likewise.
      	(gfc_extract_int): Likewise.
      	(numeric_type): Likewise.
      	* gfortran.h (enum arith): Extend with ARITH_UNSIGNED_TRUNCATED
      	and ARITH_UNSIGNED_NEGATIVE.
      	(enum gfc_isym_id): Extend with GFC_ISYM_SU_KIND and GFC_ISYM_UINT.
      	(gfc_check_unsigned_range): New prototype-
      	(gfc_arith_error): Likewise.
      	(gfc_reduce_unsigned): Likewise.
      	(gfc_boz2uint): Likewise.
      	(gfc_invalid_unsigned_ops): Likewise.
      	(gfc_convert_mpz_to_unsigned): Likewise.
      	* gfortran.texi: Add some rudimentary documentation.
      	* intrinsic.cc (gfc_type_letter): Adjust for unsigneds.
      	(add_functions): Add uint and adjust functions to be called.
      	(add_conversions): Add unsigned conversions.
      	(gfc_convert_type_warn): Adjust for unsigned.
      	* intrinsic.h (gfc_check_iu, gfc_check_uint, gfc_check_mod, gfc_simplify_uint,
      	gfc_simplify_selected_unsigned_kind, gfc_resolve_uint): New prototypes.
      	* invoke.texi: Add -funsigned.
      	* iresolve.cc (gfc_resolve_dshift): Handle unsigneds.
      	(gfc_resolve_iand): Handle unsigneds.
      	(gfc_resolve_ibclr): Handle unsigneds.
      	(gfc_resolve_ibits): Handle unsigneds.
      	(gfc_resolve_ibset): Handle unsigneds.
      	(gfc_resolve_ieor): Handle unsigneds.
      	(gfc_resolve_ior): Handle unsigneds.
      	(gfc_resolve_uint): Handle unsigneds.
      	(gfc_resolve_merge_bits): Handle unsigneds.
      	(gfc_resolve_not): Handle unsigneds.
      	* lang.opt: Add -funsigned.
      	* libgfortran.h: Add BT_UNSIGNED.
      	* match.cc (gfc_match_type_spec): Match UNSIGNED.
      	* misc.cc (gfc_basic_typename): Add UNSIGNED.
      	(gfc_typename): Likewise.
      	* primary.cc (convert_unsigned): New function.
      	(match_unsigned_constant): New function.
      	(gfc_match_literal_constant): Handle unsigned.
      	* resolve.cc (resolve_operator): Handle unsigned.
      	(resolve_ordinary_assign): Likewise.
      	* simplify.cc (convert_mpz_to_unsigned): Renamed to...
      	(gfc_convert_mpz_to_unsigned): and adjusted.
      	(gfc_simplify_bit_size): Adjusted for unsigned.
      	(compare_bitwise): Likewise.
      	(gfc_simplify_bge): Likewise.
      	(gfc_simplify_bgt): Likewise.
      	(gfc_simplify_ble): Likewise.
      	(gfc_simplify_blt): Likewise.
      	(simplify_cmplx): Likewise.
      	(gfc_simplify_digits): Likewise.
      	(simplify_dshift): Likewise.
      	(gfc_simplify_huge): Likewise.
      	(gfc_simplify_iand): Likewise.
      	(gfc_simplify_ibclr): Likewise.
      	(gfc_simplify_ibits): Likewise.
      	(gfc_simplify_ibset): Likewise.
      	(gfc_simplify_ieor): Likewise.
      	(gfc_simplify_uint): Likewise.
      	(gfc_simplify_ior): Likewise.
      	(simplify_shift): Likewise.
      	(gfc_simplify_ishftc): Likewise.
      	(gfc_simplify_merge_bits): Likewise.
      	(min_max_choose): Likewise.
      	(gfc_simplify_mod): Likewise.
      	(gfc_simplify_modulo): Likewise.
      	(gfc_simplify_popcnt): Likewise.
      	(gfc_simplify_range): Likewise.
      	(gfc_simplify_selected_unsigned_kind): Likewise.
      	(gfc_convert_constant): Likewise.
      	* target-memory.cc (size_unsigned): New function.
      	(gfc_element_size): Adjust for unsigned.
      	* trans-const.h (gfc_conv_mpz_unsigned_to_tree): Add prototype.
      	* trans-const.cc (gfc_conv_mpz_unsigned_to_tree): Handle unsigneds.
      	(gfc_conv_constant_to_tree): Likewise.
      	* trans-decl.cc (gfc_conv_cfi_to_gfc): Put in "not yet implemented".
      	* trans-expr.cc (gfc_conv_gfc_desc_to_cfi_desc): Likewise.
      	* trans-stmt.cc (gfc_trans_integer_select): Handle unsigned.
      	(gfc_trans_select): Likewise.
      	* trans-intrinsic.cc (gfc_conv_intrinsic_mod): Handle unsigned.
      	(gfc_conv_intrinsic_shift): Likewise.
      	(gfc_conv_intrinsic_function): Add GFC_ISYM_UINT.
      	* trans-io.cc (enum iocall): Add IOCALL_X_UNSIGNED and IOCALL_X_UNSIGNED_WRITE.
      	(gfc_build_io_library_fndecls): Add transfer_unsigned and transfer_unsigned_write.
      	(transfer_expr): Handle unsigneds.
      	* trans-types.cc (gfc_unsinged_kinds): New array.
      	(gfc_unsigned_types): Likewise.
      	(gfc_init_kinds): Handle them.
      	(validate_unsigned): New function.
      	(gfc_validate_kind): Use it.
      	(gfc_build_unsigned_type): New function.
      	(gfc_init_types): Use it.
      	(gfc_get_unsigned_type): New function.
      	(gfc_typenode_for_spec): Handle unsigned.
      	* trans-types.h (gfc_get_unsigned_type): New prototype.
      
      libgfortran/ChangeLog:
      
      	* gfortran.map: Add _gfortran_transfer_unsgned and
      	_gfortran_transfer-signed.
      	* io/io.h (set_unsigned): New prototype.
      	(us_max): New prototype.
      	(read_decimal_unsigned): New prototype.
      	(write_iu): New prototype.
      	* io/list_read.c (convert_unsigned): New function.
      	(read_integer): Also handle unsigneds.
      	(list_formatted_read_scalar): Handle unsigneds.
      	(nml_read_obj): Likewise.
      	* io/read.c (set_unsigned): New function.
      	(us_max): New function.
      	(read_utf8): Whitespace fixes.
      	(read_default_char1): Whitespace fixes.
      	(read_a_char4): Whitespace fixes.
      	(next_char): Whiltespace fixes.
      	(read_decimal_unsigned): New function.
      	(read_f): Whitespace fixes.
      	(read_x): Whitespace fixes.
      	* io/transfer.c (transfer_unsigned): New function.
      	(transfer_unsigned_write): New function.
      	(require_one_of_two_types): New function.
      	(formatted_transfer_scalar_read): Use it.
      	(formatted_transfer_scalar_write): Also use it.
      	* io/write.c (write_decimal_unsigned): New function.
      	(write_iu): New function.
      	(write_unsigned): New function.
      	(list_formatted_write_scalar): Adjust for unsigneds.
      	* libgfortran.h (GFC_UINTEGER_1_HUGE): Define.
      	(GFC_UINTEGER_2_HUGE): Define.
      	(GFC_UINTEGER_4_HUGE): Define.
      	(GFC_UINTEGER_8_HUGE): Define.
      	(GFC_UINTEGER_16_HUGE): Define.
      	(HAVE_GFC_UINTEGER_1): Undefine (done by mk-kind-h.sh)
      	(HAVE_GFC_UINTEGER_4): Likewise.
      	* mk-kinds-h.sh: Add GFC_UINTEGER_*_HUGE.
      
      gcc/testsuite/ChangeLog:
      
      	* gfortran.dg/unsigned_1.f90: New test.
      	* gfortran.dg/unsigned_10.f90: New test.
      	* gfortran.dg/unsigned_11.f90: New test.
      	* gfortran.dg/unsigned_12.f90: New test.
      	* gfortran.dg/unsigned_13.f90: New test.
      	* gfortran.dg/unsigned_14.f90: New test.
      	* gfortran.dg/unsigned_15.f90: New test.
      	* gfortran.dg/unsigned_16.f90: New test.
      	* gfortran.dg/unsigned_17.f90: New test.
      	* gfortran.dg/unsigned_18.f90: New test.
      	* gfortran.dg/unsigned_19.f90: New test.
      	* gfortran.dg/unsigned_2.f90: New test.
      	* gfortran.dg/unsigned_20.f90: New test.
      	* gfortran.dg/unsigned_21.f90: New test.
      	* gfortran.dg/unsigned_22.f90: New test.
      	* gfortran.dg/unsigned_23.f90: New test.
      	* gfortran.dg/unsigned_24.f: New test.
      	* gfortran.dg/unsigned_3.f90: New test.
      	* gfortran.dg/unsigned_4.f90: New test.
      	* gfortran.dg/unsigned_5.f90: New test.
      	* gfortran.dg/unsigned_6.f90: New test.
      	* gfortran.dg/unsigned_7.f90: New test.
      	* gfortran.dg/unsigned_8.f90: New test.
      	* gfortran.dg/unsigned_9.f90: New test.
      113a6da9
    • Jakub Jelinek's avatar
      libiberty: Fix up > 64K section handling in simple_object_elf_copy_lto_debug_section [PR116614] · bb8dd098
      Jakub Jelinek authored
      cat abc.C
        #define A(n) struct T##n {} t##n;
        #define B(n) A(n##0) A(n##1) A(n##2) A(n##3) A(n##4) A(n##5) A(n##6) A(n##7) A(n##8) A(n##9)
        #define C(n) B(n##0) B(n##1) B(n##2) B(n##3) B(n##4) B(n##5) B(n##6) B(n##7) B(n##8) B(n##9)
        #define D(n) C(n##0) C(n##1) C(n##2) C(n##3) C(n##4) C(n##5) C(n##6) C(n##7) C(n##8) C(n##9)
        #define E(n) D(n##0) D(n##1) D(n##2) D(n##3) D(n##4) D(n##5) D(n##6) D(n##7) D(n##8) D(n##9)
        E(1) E(2) E(3)
        int main () { return 0; }
      ./xg++ -B ./ -o abc{.o,.C} -flto -flto-partition=1to1 -O2 -g -fdebug-types-section -c
      ./xgcc -B ./ -o abc{,.o} -flto -flto-partition=1to1 -O2
      (not included in testsuite as it takes a while to compile) FAILs with
      lto-wrapper: fatal error: Too many copied sections: Operation not supported
      compilation terminated.
      /usr/bin/ld: error: lto-wrapper failed
      collect2: error: ld returned 1 exit status
      
      The following patch fixes that.  Most of the 64K+ section support for
      reading and writing was already there years ago (and especially reading used
      quite often already) and a further bug fixed in it in the PR104617 fix.
      
      Yet, the fix isn't solely about removing the
        if (new_i - 1 >= SHN_LORESERVE)
          {
            *err = ENOTSUP;
            return "Too many copied sections";
          }
      5 lines, the missing part was that the function only handled reading of
      the .symtab_shndx section but not copying/updating of it.
      If the result has less than 64K-epsilon sections, that actually wasn't
      needed, but e.g. with -fdebug-types-section one can exceed that pretty
      easily (reported to us on WebKitGtk build on ppc64le).
      Updating the section is slightly more complicated, because it basically
      needs to be done in lock step with updating the .symtab section, if one
      doesn't need to use SHN_XINDEX in there, the section should (or should be
      updated to) contain SHN_UNDEF entry, otherwise needs to have whatever would
      be overwise stored but couldn't fit.  But repeating due to that all the
      symtab decisions what to discard and how to rewrite it would be ugly.
      
      So, the patch instead emits the .symtab_shndx section (or sections) last
      and prepares the content during the .symtab processing and in a second
      pass when going just through .symtab_shndx sections just uses the saved
      content.
      
      2024-09-07  Jakub Jelinek  <jakub@redhat.com>
      
      	PR lto/116614
      	* simple-object-elf.c (SHN_COMMON): Align comment with neighbouring
      	comments.
      	(SHN_HIRESERVE): Use uppercase hex digits instead of lowercase for
      	consistency.
      	(simple_object_elf_find_sections): Formatting fixes.
      	(simple_object_elf_fetch_attributes): Likewise.
      	(simple_object_elf_attributes_merge): Likewise.
      	(simple_object_elf_start_write): Likewise.
      	(simple_object_elf_write_ehdr): Likewise.
      	(simple_object_elf_write_shdr): Likewise.
      	(simple_object_elf_write_to_file): Likewise.
      	(simple_object_elf_copy_lto_debug_section): Likewise.  Don't fail for
      	new_i - 1 >= SHN_LORESERVE, instead arrange in that case to copy
      	over .symtab_shndx sections, though emit those last and compute their
      	section content when processing associated .symtab sections.  Handle
      	simple_object_internal_read failure even in the .symtab_shndx reading
      	case.
      bb8dd098
    • GCC Administrator's avatar
      Daily bump. · a523c2ba
      GCC Administrator authored
      a523c2ba
  4. Sep 06, 2024
    • Jonathan Wakely's avatar
      libstdc++: Fix std::chrono::parse for TAI and GPS clocks · 222ff194
      Jonathan Wakely authored
      Howard Hinnant brought to my attention that chrono::parse was giving
      incorrect values for chrono::gps_clock, because it was applying the
      offset between the GPS clock and UTC. That's incorrect, because when we
      parse HH::MM::SS as a GPS time, the result should be that time, not
      HH:MM:SS+offset.
      
      The problem was that I was using clock_cast to convert from sys_time to
      utc_time and then using clock_time again to convert to gps_time. The
      solution is to convert the parsed time into an duration representing the
      time since the GPS clock's epoch, then construct a gps_time directly
      from that duration.
      
      As well as adding tests for correct round tripping of times for all
      clocks, this also adds some more tests for correct results with
      std::format.
      
      libstdc++-v3/ChangeLog:
      
      	* include/bits/chrono_io.h (from_stream): Fix conversions in
      	overloads for gps_time and tai_time.
      	* testsuite/std/time/clock/file/io.cc: Test round tripping using
      	chrono::parse. Add additional std::format tests.
      	* testsuite/std/time/clock/gps/io.cc: Likewise.
      	* testsuite/std/time/clock/local/io.cc: Likewise.
      	* testsuite/std/time/clock/tai/io.cc: Likewise.
      	* testsuite/std/time/clock/utc/io.cc: Likewise.
      222ff194
    • Jason Merrill's avatar
      c++: adjust testcase to reveal failure [PR107919] · 1fa45e77
      Jason Merrill authored
      This test appeared to be passing, but only because the warning was
      suppressed by #pragma system_header.
      
      	PR tree-optimization/107919
      
      gcc/testsuite/ChangeLog:
      
      	* g++.dg/warn/Wuninitialized-pr107919-1.C: Add -Wsystem-headers and
      	xfail.
      1fa45e77
    • Jason Merrill's avatar
      libstdc++: add missing __ · e4b64bea
      Jason Merrill authored
      I forgot the __ in my recent r15-3500-g1914ca8791ce4e.
      
      libstdc++-v3/ChangeLog:
      
      	* include/bits/regex_constants.h: Add __ to attribute.
      e4b64bea
    • Joseph Myers's avatar
      Update gcc uk.po · 1a1f818c
      Joseph Myers authored
      	* uk.po: Update.
      1a1f818c
    • Carl Love's avatar
      rs6000,extend and document built-ins vec_test_lsbb_all_ones and vec_test_lsbb_all_zeros · 6c9a714a
      Carl Love authored
      The built-ins currently support vector unsigned char arguments.  Extend the
      built-ins to also support vector signed char and vector bool char
      arguments.
      
      Add documentation for the Power 10 built-ins vec_test_lsbb_all_ones
      and vec_test_lsbb_all_zeros.  The vec_test_lsbb_all_ones built-in
      returns 1 if the least significant bit in each byte is a 1, returns
      0 otherwise.  Similarly, vec_test_lsbb_all_zeros returns a 1 if
      the least significant bit in each byte is a zero and 0 otherwise.
      
      Add addtional test cases for the built-ins in files:
        gcc/testsuite/gcc.target/powerpc/lsbb.c
        gcc/testsuite/gcc.target/powerpc/lsbb-runnable.c
      
      gcc/ChangeLog:
      	* config/rs6000/rs6000-overload.def (vec_test_lsbb_all_ones,
      	vec_test_lsbb_all_zeros): Add built-in instances for vector signed
      	char and vector bool char.
      	* doc/extend.texi (vec_test_lsbb_all_ones,
      	vec_test_lsbb_all_zeros): Add documentation for the
      	existing built-ins.
      
      gcc/testsuite/ChangeLog:gcc/testsuite/ChangeLog:
      	* gcc.target/powerpc/lsbb-runnable.c: Add test cases for the vector
      	signed char and vector bool char instances of
      	vec_test_lsbb_all_zeros and vec_test_lsbb_all_ones built-ins.
      	* gcc.target/powerpc/lsbb.c: Add compile test cases for the vector
      	signed char and vector bool char instances of
      	vec_test_lsbb_all_zeros and vec_test_lsbb_all_ones built-ins.
      6c9a714a
    • Tamar Christina's avatar
      middle-end: check that the lhs of a COND_EXPR is an SSA_NAME in cond_store recognition [PR116628] · 2c4438d3
      Tamar Christina authored
      Because the vect_recog_bool_pattern can at the moment still transition
      out of GIMPLE and back into GENERIC the vect_recog_cond_store_pattern can
      end up using an expression as a mask rather than an SSA_NAME.
      
      This adds an explicit check that we have a mask and not an expression.
      
      gcc/ChangeLog:
      
      	PR tree-optimization/116628
      	* tree-vect-patterns.cc (vect_recog_cond_store_pattern): Add SSA_NAME
      	check on expression.
      
      gcc/testsuite/ChangeLog:
      
      	PR tree-optimization/116628
      	* gcc.dg/vect/pr116628.c: New test.
      2c4438d3
    • Andrew Pinski's avatar
      aarch64: Use is_attribute_namespace_p and get_attribute_name inside... · 1247fa6e
      Andrew Pinski authored
      aarch64: Use is_attribute_namespace_p and get_attribute_name inside aarch64_lookup_shared_state_flags [PR116598]
      
      The code in aarch64_lookup_shared_state_flags all C++11 attributes on the function type
      had a namespace associated with them. But with the addition of reproducible/unsequenced,
      this is not true.
      
      This fixes the issue by using is_attribute_namespace_p instead of manually figuring out
      the namespace is named "arm" and uses get_attribute_name instead of manually grabbing
      the attribute name.
      
      Built and tested for aarch64-linux-gnu.
      
      gcc/ChangeLog:
      
      	PR target/116598
      	* config/aarch64/aarch64.cc (aarch64_lookup_shared_state_flags): Use
      	is_attribute_namespace_p and get_attribute_name instead of manually grabbing
      	the namespace and name of the attribute.
      
      Signed-off-by: default avatarAndrew Pinski <quic_apinski@quicinc.com>
      1247fa6e
    • Martin Jambor's avatar
      ipa: Move pass_ipa_cdtor_merge before pass_ipa_cp and pass_ipa_sra · db0fa0b3
      Martin Jambor authored
      When looking at PR 115815 we realized that it would make sense to make
      calls to functions originally declared static constructors and
      destructors created by pass_ipa_cdtor_merge visible to IPA-SRA.  This
      patch does that.
      
      gcc/ChangeLog:
      
      2024-07-25  Martin Jambor  <mjambor@suse.cz>
      
      	* passes.def: Move pass_ipa_cdtor_merge before pass_ipa_cp and
      	pass_ipa_sra.
      db0fa0b3
    • Martin Jambor's avatar
      ipa: Treat static constructors and destructors as non-local (PR 115815) · e98ad6a0
      Martin Jambor authored
      In PR 115815, IPA-SRA thought it had control over all invocations of a
      (recursive) static destructor but it did not see the implied
      invocation which led to the original being left behind and the
      clean-up code encountering uses of SSAs that definitely should have
      been dead.
      
      Fixed by teaching cgraph_node::can_be_local_p about static
      constructors and destructors.  Similar test is missing in
      cgraph_node::local_p so I added the check there as well.
      
      gcc/ChangeLog:
      
      2024-07-25  Martin Jambor  <mjambor@suse.cz>
      
      	PR ipa/115815
      	* cgraph.cc (cgraph_node_cannot_be_local_p_1): Also check
      	DECL_STATIC_CONSTRUCTOR and DECL_STATIC_DESTRUCTOR.
      	* ipa-visibility.cc (non_local_p): Likewise.
      	(cgraph_node::local_p): Delete extraneous line of tabs.
      
      gcc/testsuite/ChangeLog:
      
      2024-07-25  Martin Jambor  <mjambor@suse.cz>
      
      	PR ipa/115815
      	* gcc.dg/lto/pr115815_0.c: New test.
      e98ad6a0
    • Richard Biener's avatar
      Fix SLP double-reduction support · ea9d4bf4
      Richard Biener authored
      When doing SLP discovery I forgot to handle double reductions even
      though they are already queued in LOOP_VINFO_REDUCTIONS.
      
      	* tree-vect-slp.cc (vect_analyze_slp): Also handle discovery
      	for double reductions.
      ea9d4bf4
    • Jakub Jelinek's avatar
      c++: Partially implement CWG 2867 - Order of initialization for structured bindings [PR115769] · 964577c3
      Jakub Jelinek authored
      The following patch partially implements CWG 2867
      - Order of initialization for structured bindings.
      The DR requires that initialization of e is sequenced before r_i and
      that r_i initialization is sequenced before r_j for j > i, we already do it
      that way, the former ordering is a necessity so that the get calls are
      actually emitted on already initialized variable, the rest just because
      we implemented it that way, by going through the structured binding
      vars in ascending order and doing their initialization.
      
      The hard part not implemented yet is the lifetime extension of the
      temporaries from the e initialization to after the get calls (if any).
      Unlike the range-for lifetime extension patch which I've posted recently
      where IMO we can just ignore lifetime extension of reference bound
      temporaries because all the temporaries are extended to the same spot,
      here lifetime extension of reference bound temporaries should last until
      the end of lifetime of e, while other temporaries only after all the get
      calls.
      
      The patch just attempts to deal with automatic structured bindings for now,
      I'll post a patch for static locals incrementally and I don't have a patch
      for namespace scope structured bindings yet, this patch should just keep
      existing behavior for both static locals and namespace scope structured
      bindings.
      
      What GCC currently emits is a CLEANUP_POINT_EXPR around the e
      initialization, followed optionally by nested CLEANUP_STMTs for cleanups
      like the e dtor if any and dtors of lifetime extended temporaries from
      reference binding; inside of the CLEANUP_STMT CLEANUP_BODY then the
      initialization of the individual variables for the tuple case, again with
      optional CLEANUP_STMT if e.g. lifetime extended temporaries from reference
      binding are needed in those.
      
      The following patch drops that first CLEANUP_POINT_EXPR and instead
      wraps the whole sequence of the e initialization and the individual variable
      initialization with get calls after it into a single CLEANUP_POINT_EXPR.
      If there are any CLEANUP_STMTs needed, they are all emitted first, with
      the CLEANUP_POINT_EXPR for e initialization and the individual variable
      initialization inside of those, and a guard variable set after different
      phases in those expressions guarding the corresponding cleanups, so that
      they aren't invoked until the respective variables are constructed.
      This is implemented by cp_finish_decl doing cp_finish_decomp on its own
      when !processing_template_decl (otherwise we often don't cp_finish_decl
      or process it at a different time from when we want to call
      cp_finish_decomp) or unless the decl is erroneous (cp_finish_decl has
      too many early returns for erroneous cases, and for those we can actually
      call it even multiple times, for the non-erroneous cases
      non-processing_template_decl cases we need to call it just once).
      
      The two testcases try to construct various temporaries and variables and
      verify the order in which the temporaries and variables are constructed and
      destructed.
      
      2024-09-06  Jakub Jelinek  <jakub@redhat.com>
      
      	PR c++/115769
      	* cp-tree.h: Partially implement CWG 2867 - Order of initialization
      	for structured bindings.
      	(cp_finish_decomp): Add TEST_P argument defaulted to false.
      	* decl.cc (initialize_local_var): Add DECOMP argument, if true,
      	don't build cleanup and temporarily override stmts_are_full_exprs_p
      	to 0 rather than 1.  Formatting fix.
      	(cp_finish_decl): Invoke cp_finish_decomp for structured bindings
      	here, first with test_p.  For automatic structured binding bases
      	if the test cp_finish_decomp returned true wrap the initialization
      	together with what non-test cp_finish_decomp emits with a
      	CLEANUP_POINT_EXPR, and if there are any CLEANUP_STMTs needed, emit
      	them around the whole CLEANUP_POINT_EXPR with guard variables for the
      	cleanups.  Call cp_finish_decomp using RAII if not called with
      	decomp != NULL otherwise.
      	(cp_finish_decomp): Add TEST_P argument, change return type from
      	void to bool, if TEST_P is true, return true instead of emitting
      	actual code for the tuple case, otherwise return false.
      	* parser.cc (cp_convert_range_for): Don't call cp_finish_decomp
      	after cp_finish_decl.
      	(cp_parser_decomposition_declaration): Set DECL_DECOMP_BASE
      	before cp_finish_decl call.  Don't call cp_finish_decomp after
      	cp_finish_decl.
      	(cp_finish_omp_range_for): Don't call cp_finish_decomp after
      	cp_finish_decl.
      	* pt.cc (tsubst_stmt): Likewise.
      
      	* g++.dg/DRs/dr2867-1.C: New test.
      	* g++.dg/DRs/dr2867-2.C: New test.
      964577c3
    • Georg-Johann Lay's avatar
      AVR: lra/116321 - Add test case. · e8378231
      Georg-Johann Lay authored
      	PR rtl-optimization/116321
      gcc/testsuite/
      	* gcc.target/avr/torture/lra-pr116321.c: New test.
      e8378231
    • Jason Merrill's avatar
      libstdc++: avoid __GLIBCXX__ redefinition · c0da27f3
      Jason Merrill authored
      testsuite/lib/dg-options.exp defines __GLIBCXX__ to 9999999; avoid a macro
      redefinition warning in that case.
      
      libstdc++-v3/ChangeLog:
      
      	* include/bits/c++config: Avoid redefining __GLIBCXX__.
      c0da27f3
    • Tobias Burnus's avatar
      Fortran: Add OpenMP 'interop' directive parsing support · 4ce9e0a5
      Tobias Burnus authored
      Parse OpenMP's 'interop' directive but stop with a 'sorry, unimplemented'
      after resolving.
      
      Additionally, it moves some clause dumping away from the end directive as
      that lead to 'nowait' not being printed when it should as some cases were
      missed.
      
      gcc/fortran/ChangeLog:
      
      	* dump-parse-tree.cc (show_omp_namelist): Handle OMP_LIST_INIT.
      	(show_omp_clauses): Handle OMP_LIST_{INIT,USE,DESTORY}; move 'nowait'
      	from end-directive to the directive dump.
      	(show_omp_node, show_code_node): Handle EXEC_OMP_INTEROP.
      	* gfortran.h (enum gfc_statement): Add ST_OMP_INTEROP.
      	(OMP_LIST_INIT, OMP_LIST_USE, OMP_LIST_DESTROY): Add.
      	(enum gfc_exec_op): Add EXEC_OMP_INTEROP.
      	(struct gfc_omp_namelist): Add interop items to union.
      	(gfc_free_omp_namelist): Add boolean arg.
      	* match.cc (gfc_free_omp_namelist): Update to free
      	interop union members.
      	* match.h (gfc_match_omp_interop): New.
      	* openmp.cc (gfc_omp_directives): Uncomment 'interop' entry.
      	(gfc_free_omp_clauses, gfc_match_omp_allocate,
      	gfc_match_omp_flush, gfc_match_omp_clause_reduction): Update
      	call.
      	(enum omp_mask2): Add OMP_CLAUSE_{INIT,USE,DESTROY}.
      	(OMP_INTEROP_CLAUSES): Use it.
      	(gfc_match_omp_clauses): Match those clauses.
      	(gfc_match_omp_prefer_type, gfc_match_omp_init,
      	gfc_match_omp_interop): New.
      	(resolve_omp_clauses): Handle interop clauses.
      	(omp_code_to_statement): Add ST_OMP_INTEROP.
      	(gfc_resolve_omp_directive): Add EXEC_OMP_INTEROP.
      	* parse.cc (decode_omp_directive): Parse 'interop' directive.
      	(next_statement, gfc_ascii_statement): Handle ST_OMP_INTEROP.
      	* st.cc (gfc_free_statement): Likewise
      	* resolve.cc (gfc_resolve_code): Handle EXEC_OMP_INTEROP.
      	* trans.cc (trans_code): Likewise.
      	* trans-openmp.cc (gfc_trans_omp_directive): Print 'sorry'
      	for EXEC_OMP_INTEROP.
      
      gcc/testsuite/ChangeLog:
      
      	* gfortran.dg/gomp/interop-1.f90: New test.
      	* gfortran.dg/gomp/interop-2.f90: New test.
      	* gfortran.dg/gomp/interop-3.f90: New test.
      4ce9e0a5
    • Richard Biener's avatar
      Handle non-grouped stores as single-lane SLP · d34cda72
      Richard Biener authored
      The following enables single-lane loop SLP discovery for non-grouped stores
      and adjusts vectorizable_store to properly handle those.
      
      For gfortran.dg/vect/vect-8.f90 we vectorize one additional loop,
      not running into the "not falling back to strided accesses" bail-out.
      I have not investigated in detail.
      
      There is a set of i386 target assembler test FAILs,
      gcc.target/i386/pr88531-2[bc].c in particular fail because the
      target cannot identify SLP emulated gathers, see another mail from me.
      Others need adjustment, I've adjusted one with this patch only.
      In particular there are gcc.target/i386/cond_op_fma_*-1.c FAILs
      that are because we no longer fold a VEC_COND_EXPR during the
      region value-numbering we do after vectorization since we
      code-generate a { 0.0, ... } constant in the VEC_COND_EXPR now
      instead of having a separate statement which gets forwarded
      and then triggers folding.  This leads to sligtly different
      code generation.  The solution is probably to use gimple_build
      when building stmts or, in this case, directly emit .COND_FMA
      instead of .FMA and a VEC_COND_EXPR.
      
      gcc.dg/vect/slp-19a.c mixes contiguous 8-lane SLP with a single
      lane contiguous store from one lane of the 8-lane load and we
      expect to use load-lanes for this reason but the heuristic for
      forcing single-lane rediscovery as implemented doesn't trigger
      here as it treats both SLP instances separately.  FAILs on RISC-V
      
      gcc.dg/vect/slp-19c.c shows we fail to implement an interleaving
      scheme for group_size 12 (by extension using the group_size 3
      scheme to reduce to 4 lanes and then continue with a pow2 scheme
      would work);  we are also not considering load-lanes because of
      the above reason, but aarch64 cannot do ld12.  FAILs on AARCH64
      (load requires three vectors) and x86_64.
      
      gcc.dg/vect/slp-19c.c FAILs with variable-length vectors because
      of "SLP induction not supported for variable-length vectors".
      
      gcc.target/aarch64/pr110449.c will FAIL because the (contested)
      optimization in r14-2367-g224fd59b2dc8a5 was only applied to
      loop-vect but not SLP vect.  I'll leave it to target maintainers
      to either XFAIL (the optimization is bad) or remove the test.
      
      	* tree-vect-slp.cc (vect_analyze_slp): Perform single-lane
      	loop SLP discovery for non-grouped stores.  Move check on the root
      	for re-doing SLP analysis with a single lane for load/store-lanes
      	earlier and make sure we are dealing with a grouped access.
      	* tree-vect-stmts.cc (vectorizable_store): Always set
      	vec_num for SLP.
      
      	* gcc.dg/vect/O3-pr39675-2.c: Adjust expected number of SLP.
      	* gcc.dg/vect/fast-math-vect-call-1.c: Likewise.
      	* gcc.dg/vect/no-scevccp-slp-31.c: Likewise.
      	* gcc.dg/vect/slp-12b.c: Likewise.
      	* gcc.dg/vect/slp-12c.c: Likewise.
      	* gcc.dg/vect/slp-19a.c: Likewise.
      	* gcc.dg/vect/slp-19b.c: Likewise.
      	* gcc.dg/vect/slp-4-big-array.c: Likewise.
      	* gcc.dg/vect/slp-4.c: Likewise.
      	* gcc.dg/vect/slp-5.c: Likewise.
      	* gcc.dg/vect/slp-7.c: Likewise.
      	* gcc.dg/vect/slp-perm-7.c: Likewise.
      	* gcc.dg/vect/slp-37.c: Likewise.
      	* gcc.dg/vect/fast-math-vect-call-2.c: Likewise.
      	* gcc.dg/vect/slp-26.c: RISC-V can now SLP two instances.
      	* gcc.dg/vect/vect-outer-slp-3.c: Disable vectorization of
      	initialization loop.
      	* gcc.dg/vect/slp-reduc-5.c: Likewise.
      	* gcc.dg/vect/no-scevccp-outer-12.c: Un-XFAIL.  SLP can handle
      	inner loop inductions with multiple vector stmt copies.
      	* gfortran.dg/vect/vect-8.f90: Adjust expected number of
      	vectorized loops.
      	* gcc.target/i386/vectorize1.c: Adjust what we scan for.
      d34cda72
    • Georg-Johann Lay's avatar
      AVR: Remove "Atmel" from header comment. · f9c5c12d
      Georg-Johann Lay authored
      gcc/
      	* config/avr/avr.h: Remove "Atmel" from header comment.
      	* config/avr/avr.cc: Same.
      	* config/avr/avr.md: Same.
      	* config/avr/avr.opt: Same.
      	* config/avr/avr-dimode.md: Same.
      	* config/avr/avr-fixed.md: Same.
      	* config/avr/constraints.md: Same.
      	* config/avr/predicates.md: Same.
      	* config/avr/avr-log.cc: Same.
      	* config/avr/avrlibc.h: Same.
      	* config/avr/specs.h: Same.
      	* common/config/avr/avr-common.cc: Same.
      	* doc/install.texi: Same.
      	* config/avr/avr-arch.h: Adjust header comment.
      	* config/avr/avr-c.cc: Same.
      	* config/avr/avr-mcus.def: Same.
      	* config/avr/avr-modes.def: Same.
      	* config/avr/avr-passes.cc: Same.
      	* config/avr/avr-passes.def: Same.
      	* config/avr/avr-protos.h: Same.
      	* config/avr/driver-avr.cc: Same.
      	* config/avr/elf.h: Same.
      	* config/avr/gen-avr-mmcu-specs.cc: Same.
      	* config/avr/gen-avr-mmcu-texi.cc: Same.
      f9c5c12d
    • Richard Biener's avatar
      tree-optimization/116610 - wrong SLP induction bias for mask peeling · 6a1a856b
      Richard Biener authored
      The following fixes a mistake when applying the bias for peeling via
      masking to the inital value of SLP inductions.
      
      This resolves gcc.target/aarch64/sve/peel_ind_1.c (a scan-assembler
      only unfortunately) when forcing single-lane SLP for it.
      
      	PR tree-optimization/116610
      	* tree-vect-loop.cc (vectorizable_induction): Use MINUS_EXPR
      	to apply a mask peeling adjustment.
      6a1a856b
Loading