Skip to content
Snippets Groups Projects
  1. Feb 22, 2025
    • Thomas Schwinge's avatar
      BPF, nvptx: Standardize on 'sorry, unimplemented: dynamic stack allocation not supported' · 2abc942f
      Thomas Schwinge authored
      ... instead of BPF: 'error: BPF does not support dynamic stack allocation', and
      nvptx: 'sorry, unimplemented: target cannot support alloca'.
      
      	gcc/
      	* config/bpf/bpf.md (define_expand "allocate_stack"): Emit
      	'sorry, unimplemented: dynamic stack allocation not supported'.
      	* config/nvptx/nvptx.md (define_expand "allocate_stack")
      	[!TARGET_SOFT_STACK && !(TARGET_PTX_7_3 && TARGET_SM52)]: Likewise.
      	gcc/testsuite/
      	* gcc.target/bpf/diag-alloca-1.c: Adjust 'dg-message'.
      	* gcc.target/bpf/diag-alloca-2.c: Likewise.
      	* gcc.target/nvptx/alloca-1-sm_30.c: Likewise.
      	* gcc.target/nvptx/vla-1-sm_30.c: Likewise.
      	* lib/target-supports.exp (proc check_effective_target_alloca):
      	Adjust comment.
      2abc942f
    • shynur's avatar
      libgomp: Add '__attribute__((unused))' to variables used only in 'assert(...)' · e759ff08
      shynur authored
      Without this attribute, the building process will fail if GCC is configured
      with 'CFLAGS=-DNDEBUG'.
      
      libgomp/ChangeLog:
      
      	* oacc-mem.c (acc_unmap_data, goacc_exit_datum_1, find_group_last,
      	goacc_enter_data_internal): Add '__attribute__((unused))'.
      	* target.c (gomp_unmap_vars_internal): Likewise.
      e759ff08
    • Jonathan Wakely's avatar
      libstdc++: Remove misleading comment in __atomic_base<Int> · 44702296
      Jonathan Wakely authored
      No conversion is needed because the type of _M_i is __int_type anyway.
      
      libstdc++-v3/ChangeLog:
      
      	* include/bits/atomic_base.h (__atomic_base<_ITp>): Remove
      	misleading comment.
      44702296
    • Jonathan Wakely's avatar
      libstdc++: Remove redundant cast in floating_from_chars.cc · a742b27b
      Jonathan Wakely authored
      In r15-7647-g32457bc25fea80 I added a cast and also changed the type of
      the variable, making the cast redundant. This removes the cast.
      
      libstdc++-v3/ChangeLog:
      
      	* src/c++17/floating_from_chars.cc (__floating_from_chars_hex):
      	Remove redundant cast.
      a742b27b
    • Sandra Loosemore's avatar
      OpenMP: Silence uninitialized variable warning in C++ front end. · c978965b
      Sandra Loosemore authored
      There's no actual problem with the code here, just a false-positive
      warning emitted by some older GCC versions.
      
      gcc/cp/ChangeLog
      	* parser.cc (cp_finish_omp_declare_variant): Initialize
      	append_args_last.
      c978965b
    • Gaius Mulley's avatar
      PR modula2/118978 ICE when attempting to pass an incompatible parameter · a2f60c1f
      Gaius Mulley authored
      
      This bugfix is for a an ICE which occurs if an incompatible parameter
      is passed to a procedure.  In particular if a REAL constant actual
      parameter is passed to INTEGER formal parameter then M2Range is invoked
      to check the type and then M2Range is called to check the value range.
      
      The value range check causes an ICE.  The bug fix introduces range
      dependencies on type checks.  If the type check fails an
      error message is generated and any future range check cancelled.
      These range and type checks are tightly coupled when generating
      parameter quad intermediate code.
      
      gcc/m2/ChangeLog:
      
      	PR modula2/118978
      	* gm2-compiler/M2Check.mod (checkConstMeta): Add check for
      	typed constants.
      	* gm2-compiler/M2Quads.mod (BoolFrame): New field RangeDep.
      	(CheckProcedureParameters): Call PutRangeDep to associate the
      	range dependency with the parameter on the quad stack.
      	Pass ParamCheckId to CheckParameter.
      	(CheckProcTypeAndProcedure): Add ParamCheckId parameter.
      	Pass ParamCheckId to BuildRange.
      	(CheckParameter): New parameter ParamCheckId.
      	Pass ParamCheckId to CheckProcTypeAndProcedure.
      	(CheckParameterOrdinals): Add extra range dep parameter to the
      	call of InitParameterRangeCheck.
      	(ConvertBooleanToVariable): Initialize RangeDep field.
      	(PushBacktok): Ditto.
      	(OperandRangeDep): New procedure.
      	(PutRangeDep): Ditto.
      	* gm2-compiler/M2Range.def (InitTypesParameterCheck): Add new
      	parameter depRangeId.
      	(InitParameterRangeCheck): Add new parameter parentRangeId.
      	(FoldRangeCheck): Add new parameter range.
      	* gm2-compiler/M2Range.mod (InitTypesParameterCheck): Add new
      	parameter depRangeId.
      	(InitParameterRangeCheck): Add new parameter parentRangeId.
      	(FoldRangeCheck): Add new parameter range and rewrite.
      	(FoldRangeCheckLower): New procedure.
      	(Range): New field cancelled.
      	New field dependantid.
      	(PutRangeParam): Initialize dependantid.
      	(PutRangeParamAssign): Ditto.
      	(CheckCancelled): New procedure.
      	(Cancel): Ditto.
      	(IsCancelled): New procedure function.
      	(FoldTypeParam): Add depRangeId parameter.
      	(WriteRangeCheck): Add dependent debugging.
      
      gcc/testsuite/ChangeLog:
      
      	PR modula2/118978
      	* gm2/pim/fail/badparamtype.mod: New test.
      
      Signed-off-by: default avatarGaius Mulley <gaiusmod2@gmail.com>
      a2f60c1f
    • GCC Administrator's avatar
      Daily bump. · 4de2d2f8
      GCC Administrator authored
      4de2d2f8
  2. Feb 21, 2025
    • H.J. Lu's avatar
      Append a newline in debug_edge · 700f049b
      H.J. Lu authored
      
      Append a newline in debug_edge so that we get
      
      (gdb) call debug_edge (e)
      edge (bb_9, bb_1)
      (gdb)
      
      instead of
      
      (gdb) call debug_edge (e)
      edge (bb_9, bb_1)(gdb)
      
      	* sese.cc (debug_edge): Append a newline.
      
      Signed-off-by: default avatarH.J. Lu <hjl.tools@gmail.com>
      700f049b
    • Richard Biener's avatar
      tree-optimization/118954 - avoid UB on ref created by predcom · ee30e258
      Richard Biener authored
      When predicitive commoning moves an invariant ref it makes sure to
      not build a MEM_REF with a base that is negatively offsetted from
      an object.  But in trying to preserve some transforms it does not
      consider association of a constant offset with the address computation
      in DR_BASE_ADDRESS leading to exactly this problem again.  This is
      arguably a problem in data-ref analysis producing such an out-of-bound
      DR_BASE_ADDRESS, but this looks quite involved to fix, so the
      following avoids the association in one more case.  This fixes the
      testcase while preserving the desired transform in
      gcc.dg/tree-ssa/predcom-1.c.
      
      	PR tree-optimization/118954
      	* tree-predcom.cc (ref_at_iteration): Make sure to not
      	associate the constant offset with DR_BASE_ADDRESS when
      	that is an offsetted pointer.
      
      	* gcc.dg/torture/pr118954.c: New testcase.
      ee30e258
    • Richard Biener's avatar
      Improve g++.dg/torture/pr118521.C · d2720051
      Richard Biener authored
      Alexander pointed out the way to do a dg-bogus in an included header.
      
      	PR tree-optimization/118521
      	* g++.dg/torture/pr118521.C: Use dg-bogus properly.
      d2720051
    • Harald Anlauf's avatar
      Fortran: initialize non-saved pointers with -fcheck=pointer [PR48958] · 7d383a73
      Harald Anlauf authored
      	PR fortran/48958
      
      gcc/fortran/ChangeLog:
      
      	* trans-array.cc (gfc_trans_deferred_array): Initialize the data
      	component of non-saved pointers when -fcheck=pointer is set.
      
      gcc/testsuite/ChangeLog:
      
      	* gfortran.dg/pointer_init_13.f90: New test.
      7d383a73
    • Andre Vehreschild's avatar
      Fortran: Fix build on solaris [PR107635] · 08bdc2ac
      Andre Vehreschild authored
      libgfortran/ChangeLog:
      
      	PR fortran/107635
      	* caf/single.c: Replace alloca with __builtin_alloca.
      08bdc2ac
    • Tobias Burnus's avatar
      Fortran: Improve gfc_array_kind for assumed rank; gfc_tree_array_size on 'tree' · 8293b9e4
      Tobias Burnus authored
      Improve the internal and debug representation of assumed-rank arrays by
      honoring the pointer and allocatable property.
      
      Permit obtaining the array size from only a tree (via the array descriptor)
      besides obtaining it from the gfc_expr's array spec. This will be used
      by a follow up OpenMP patch for mapping derived types with allocatable
      components.
      
      gcc/fortran/ChangeLog:
      
      	* trans-array.cc (gfc_full_array_size): Obtain the rank from
      	the array descriptor for assumed rank.
      	(gfc_tree_array_size): Likewise; permit expr = NULL to operate
      	only the tree.
      	(gfc_conv_descriptor_stride_get): Update for added assumed-rank
      	array types.
      	* trans-openmp.cc (gfc_omp_finish_clause): Likewise.
      	* trans-types.cc (gfc_build_array_type, gfc_get_derived_type,
      	gfc_get_array_descr_info): Likewise.
      	* trans.h (enum gfc_array_kind): Add
      	GFC_ARRAY_ASSUMED_RANK_{ALLOCATABLE,POINTER{,_CONT}}.
      8293b9e4
    • GCC Administrator's avatar
      Daily bump. · fe4811fd
      GCC Administrator authored
      fe4811fd
  3. Feb 20, 2025
    • David Malcolm's avatar
      diagnostics: add comments about global_dc · 4e9ee996
      David Malcolm authored
      
      No functional change intended.
      
      gcc/ChangeLog:
      	* diagnostic-core.h: Add comments making clear that these
      	functions implicitly use global_dc.
      
      Signed-off-by: default avatarDavid Malcolm <dmalcolm@redhat.com>
      4e9ee996
    • David Malcolm's avatar
      sarif-replay: add testcase for empty input file · c5f541e4
      David Malcolm authored
      
      gcc/testsuite/ChangeLog:
      	* sarif-replay.dg/malformed-json/empty.sarif: New test.
      
      Signed-off-by: default avatarDavid Malcolm <dmalcolm@redhat.com>
      c5f541e4
    • David Malcolm's avatar
      sarif-replay: improve error for unescaped braces in messages (§3.11.5) · 5a30a3ab
      David Malcolm authored
      Spotted via https://github.com/llvm/llvm-project/issues/128024
      
      
      
      gcc/ChangeLog:
      	* libsarifreplay.cc
      	(sarif_replayer::make_plain_text_within_result_message): Capture
      	which json::string was used.  When reporting on unescaped "{" or
      	"}" in SARIF message strings, use that string rather than the
      	message object, and refer the user to §3.11.5 ("Messages with
      	placeholders") rather than §3.11.11 ("arguments").  Ideally we'd
      	place the error at the precise character, but that can't be done
      	without reworking json-parsing.cc's lexer::lex_string, which is
      	too invasive for stage 4.
      	(sarif_replayer::get_plain_text_from_mfms): Capture which
      	json::string was used.
      	(sarif_replayer::lookup_plain_text_within_result_message):
      	Likewise.
      
      gcc/testsuite/ChangeLog:
      	* sarif-replay.dg/2.1.0-invalid/3.11.11-malformed-placeholder.sarif:
      	Rename to...
      	* sarif-replay.dg/2.1.0-invalid/3.11.5-unescaped-braces.sarif:
      	...this.  Update expected subsection in error message, and
      	expected underline in quoted JSON.
      
      Signed-off-by: default avatarDavid Malcolm <dmalcolm@redhat.com>
      5a30a3ab
    • Gerald Pfeifer's avatar
      doc: Drop note for Binutils pre 2.24 · 25fa8d6d
      Gerald Pfeifer authored
      Binutils 2.24 was released in 2013, so this is more than 11 years old.
      
      gcc:
      	PR target/69374
      	* doc/install.texi (Specific, aarch64*-*-*): Drop note for
      	Binutils pre 2.24.
      25fa8d6d
    • Richard Sandiford's avatar
      aarch64: Remove old aarch64_expand_sve_vec_cmp_float code · d7ff3142
      Richard Sandiford authored
      While looking at PR118956, I noticed that we had some dead code
      left over after the removal of the vcond patterns.  The can_invert_p
      path is no longer used.
      
      gcc/
      	* config/aarch64/aarch64-protos.h (aarch64_expand_sve_vec_cmp_float):
      	Remove can_invert_p argument and change return type to void.
      	* config/aarch64/aarch64.cc (aarch64_expand_sve_vec_cmp_float):
      	Likewise.
      	* config/aarch64/aarch64-sve.md (vec_cmp<mode><vpred>): Update call
      	accordingly.
      d7ff3142
    • Richard Sandiford's avatar
      testsuite: Fix sve/pcs/args_1.c failures [PR116604] · 2f03b10d
      Richard Sandiford authored
      This test has been failing since r15-1619-g3b9b8d6cfdf593, which made
      IRA prefer a call-clobbered register over a call-preserved register
      for mem1 (the second load).  In this particular case, that just
      forces the variable p3 to be allocated to a call-preserved register
      instead, leading to an extra predicate move from p3 to that register.
      
      However, it was really pot luck that this worked before.  Each argument
      is used exactly once, so there isn't an obvious colouring order.
      And mem0 and mem1 are passed by indirect reference, so they are not
      REG_EQUIV to a stack slot in the way that some memory arguments are.
      
      IIRC, the test was the result of some experimentation, and so I think
      the best fix is to rework it to try to make it less sensitive to RA
      decisions.  This patch does that by enabling scheduling for the
      function and using both memory arguments in the same instruction.
      This gets rid of the distracting prologue and epilogue code and
      restricts the test to the PCS parts.
      
      gcc/testsuite/
      	PR testsuite/116604
      	* gcc.target/aarch64/sve/pcs/args_1.c (callee_pred): Enable scheduling
      	and use both memory arguments in the same instruction.  Expect no
      	prologue and epilogue code.
      2f03b10d
    • Richard Sandiford's avatar
      testsuite: Fix sve/var_stride_*.c failures · 9e0b94db
      Richard Sandiford authored
      gcc.target/aarch64/sve/var_stride_2.c started failing after
      r15-268-g9dbff9c05520, but the change was an improvement:
      
      @@ -36,13 +36,11 @@
       	b.any	.L9
       	ret
       .L17:
      -	ubfiz	x5, x3, 10, 16
      -	ubfiz	x4, x2, 10, 16
      -	add	x5, x1, x5
      -	add	x4, x0, x4
      -	cmp	x0, x5
      -	ccmp	x1, x4, 2, ls
       	uxtw	x4, w2
      +	add	x6, x1, x3, lsl 10
      +	cmp	x0, x6
      +	add	x5, x0, x4, lsl 10
      +	ccmp	x1, x5, 2, ls
       	ccmp	w2, 0, 4, hi
       	beq	.L3
       	cntb	x7
      
      This patch therefore changes the test to expect the new output
      for var_stride_2.c.
      
      The changes for var_stride_4.c were a wash, with both versions
      having 18(!) arithmetic instructions before the alias check branch.
      Both versions sign-extend the n and m arguments as part of this
      sequence; the question is whether they do it first or later.
      
      This patch therefore changes the test to accept either the old
      or the new code for var_stride_4.c.
      
      gcc/testsuite/
      	* gcc.target/aarch64/sve/var_stride_2.c: Expect ADD+LSL.
      	* gcc.target/aarch64/sve/var_stride_4.c: Accept LSL or SBFIZ.
      9e0b94db
    • Richard Biener's avatar
      tree-optimization/118521 - bogus diagnostic from unreachable code · a2755339
      Richard Biener authored
      When SCCP does final value replacement we end up with unfolded IL like
      
      __result_274 = _150 + 1;
      ...
      __new_finish_106 = __result_274 + 3;  <-- from SCCP
      _115 = _150 + 4;
      if (__new_finish_106 != _115)
      
      this does only get rectified by the next full folding which happens
      in forwprop4 which is after the strlen pass emitting the unwanted
      diagnostic.  The following mitigates this case in a similar way as
      r15-7472 did for PR118817 - by ensuring we have the IL folded.
      This is done by simply folding all immediate uses of the former
      PHI def that SCCP replaces.  All other more general approaches have
      too much fallout at this point.
      
      	PR tree-optimization/118521
      	* tree-scalar-evolution.cc (final_value_replacement_loop):
      	Fold uses of the replaced PHI def.
      
      	* g++.dg/torture/pr118521.C: New testcase.
      a2755339
    • Filip Kastl's avatar
      invoke.texi: Fix typo in the file-cache-lines param · a42374b6
      Filip Kastl authored
      
      file-cache-lines param was documented as file-cache-files.  This fixes
      the typo.
      
      gcc/ChangeLog:
      
      	* doc/invoke.texi: Fix typo file-cache-files ->
      	file-cache-lines.
      
      Signed-off-by: default avatarFilip Kastl <fkastl@suse.cz>
      a42374b6
    • Jonathan Wakely's avatar
      libstdc++: Workaround Clang bug with __array_rank built-in [PR118559] · c0e865f7
      Jonathan Wakely authored
      We started using the __array_rank built-in with r15-1252-g6f0dfa6f1acdf7
      but that built-in is buggy in versions of Clang up to and including 19.
      
      libstdc++-v3/ChangeLog:
      
      	PR libstdc++/118559
      	* include/std/type_traits (rank, rank_v): Do not use
      	__array_rank for Clang 19 and older.
      c0e865f7
    • Jonathan Wakely's avatar
      libstdc++: Add parentheses around _GLIBCXX_HAS_BUILTIN definition · 57f65c5c
      Jonathan Wakely authored
      This allows _GLIBCXX_HAS_BUILTIN (or _GLIBCXX_USE_BUILTIN_TRAIT) to be
      used as part of a larger logical expression.
      
      libstdc++-v3/ChangeLog:
      
      	* include/bits/c++config (_GLIBCXX_HAS_BUILTIN): Add parentheses.
      57f65c5c
    • Jonathan Wakely's avatar
      libstdc++: Use new type-generic built-ins in <bit> [PR118855] · e8ad697a
      Jonathan Wakely authored
      This makes several functions in <bit> faster to compile, with fewer
      expressions to parse and fewer instantiations of __numeric_traits
      required.
      
      libstdc++-v3/ChangeLog:
      
      	PR libstdc++/118855
      	* include/std/bit (__count_lzero, __count_rzero, __popcount):
      	Use type-generic built-ins when available.
      e8ad697a
    • Jonathan Wakely's avatar
      libstdc++: Fix invalid signed arguments to <bit> functions · 32457bc2
      Jonathan Wakely authored
      These should have been unsigned, but the static assertions are only in
      the public std::bit_ceil and std::bit_width functions, not the internal
      __bit_ceil and __bit_width ones.
      
      libstdc++-v3/ChangeLog:
      
      	* include/experimental/bits/simd.h (__find_next_valid_abi): Cast
      	__bit_ceil argument to unsigned.
      	* src/c++17/floating_from_chars.cc (__floating_from_chars_hex):
      	Cast __bit_ceil argument to unsigned.
      	* src/c++17/memory_resource.cc (big_block): Cast __bit_width
      	argument to unsigned.
      32457bc2
    • Jonathan Wakely's avatar
      libstdc++: Remove workaround for reserved init_priority warnings · 29eb6f8f
      Jonathan Wakely authored
      Since r15-7511-g4e7f74225116e7 we can disable the warnings for using a
      reserved priority using a diagnostic pragma. That means we no longer
      need to put globals using that attribute into separate files that get
      included.
      
      This replaces the two uses of such separate files by moving the variable
      definition into the source file and adding the diagnostic pragma.
      
      libstdc++-v3/ChangeLog:
      
      	* src/c++17/memory_resource.cc (default_res): Define here
      	instead of including default_resource.h.
      	* src/c++98/globals_io.cc (__ioinit): Define here instead of
      	including ios_base_init.h.
      	* src/c++17/default_resource.h: Removed.
      	* src/c++98/ios_base_init.h: Removed.
      29eb6f8f
    • Jonathan Wakely's avatar
      libstdc++: Use init_priority attribute for tzdb globals [PR118811] · 99f57446
      Jonathan Wakely authored
      When linking statically to libstdc++.a (or to libstdc++_nonshared.a in
      the RHEL devtoolset compiler) there's a static initialization order
      problem where user code might be constructed before the
      std::chrono::tzdb_list globals, and so might try to use them after
      they've already been destroyed.
      
      Use the init_priority attribute on those globals so that they are
      initialized early. Since r15-7511-g4e7f74225116e7 we can disable the
      warnings for using a reserved priority using a diagnostic pragma.
      
      libstdc++-v3/ChangeLog:
      
      	PR libstdc++/118811
      	* src/c++20/tzdb.cc (tzdb_list::_Node): Use init_priority
      	attribute on static data members.
      	* testsuite/std/time/tzdb_list/pr118811.cc: New test.
      99f57446
    • Andre Vehreschild's avatar
      Fortran: Remove deprecated coarray routines [PR107635] · d3244675
      Andre Vehreschild authored
      gcc/fortran/ChangeLog:
      
      	PR fortran/107635
      
      	* gfortran.texi: Remove deprecated functions from documentation.
      	* trans-decl.cc (gfc_build_builtin_function_decls): Remove
      	decprecated function decls.
      	* trans-intrinsic.cc (gfc_conv_intrinsic_exponent): Remove
      	deprecated/no longer needed routines.
      	* trans.h: Remove unused decls.
      
      libgfortran/ChangeLog:
      
      	* caf/libcaf.h (_gfortran_caf_get): Removed because deprecated.
      	(_gfortran_caf_send): Same.
      	(_gfortran_caf_sendget): Same.
      	(_gfortran_caf_send_by_ref): Same.
      	* caf/single.c (assign_char4_from_char1): Same.
      	(assign_char1_from_char4): Same.
      	(convert_type): Same.
      	(defined): Same.
      	(_gfortran_caf_get): Same.
      	(_gfortran_caf_send): Same.
      	(_gfortran_caf_sendget): Same.
      	(copy_data): Same.
      	(get_for_ref): Same.
      	(_gfortran_caf_get_by_ref): Same.
      	(send_by_ref): Same.
      	(_gfortran_caf_send_by_ref): Same.
      	(_gfortran_caf_sendget_by_ref): Same.
      d3244675
    • Andre Vehreschild's avatar
      Fortran: Add transfer_between_remotes [PR107635] · 8bf0ee8d
      Andre Vehreschild authored
      Add the last missing coarray data manipulation routine using remote
      accessors.
      
      gcc/fortran/ChangeLog:
      
      	PR fortran/107635
      
      	* coarray.cc (rewrite_caf_send): Rewrite to
      	transfer_between_remotes when both sides of the assignment have
      	a coarray.
      	(coindexed_code_callback): Prevent duplicate rewrite.
      	* gfortran.texi: Add documentation for transfer_between_remotes.
      	* intrinsic.cc (add_subroutines): Add intrinsic symbol for
      	caf_sendget to allow easy rewrite to transfer_between_remotes.
      	* trans-decl.cc (gfc_build_builtin_function_decls): Add
      	prototype for transfer_between_remotes.
      	* trans-intrinsic.cc (conv_caf_vector_subscript_elem): Mark as
      	deprecated.
      	(conv_caf_vector_subscript): Same.
      	(compute_component_offset): Same.
      	(conv_expr_ref_to_caf_ref): Same.
      	(conv_stat_and_team): Extract stat and team from expr.
      	(gfc_conv_intrinsic_caf_get): Use conv_stat_and_team.
      	(conv_caf_send_to_remote): Same.
      	(has_ref_after_cafref): Mark as deprecated.
      	(conv_caf_sendget): Translate to transfer_between_remotes.
      	* trans.h: Add prototype for transfer_between_remotes.
      
      libgfortran/ChangeLog:
      
      	* caf/libcaf.h: Add prototype for transfer_between_remotes.
      	* caf/single.c: Implement transfer_between_remotes.
      
      gcc/testsuite/ChangeLog:
      
      	* gfortran.dg/coarray_lib_comm_1.f90: Fix up scan_trees.
      8bf0ee8d
    • Andre Vehreschild's avatar
      Fortran: Add send_to_remote [PR107635] · 69eb0268
      Andre Vehreschild authored
      Refactor to use send_to_remote instead of the slow send_by_ref.
      
      gcc/fortran/ChangeLog:
      
      	PR fortran/107635
      
      	* coarray.cc (move_coarray_ref): Move the coarray reference out
      	of the given one.  Especially when there is a regular array ref.
      	(fixup_comp_refs): Move components refs to a derived type where
      	the codim has been removed, aka a new type.
      	(split_expr_at_caf_ref): Correctly split the reference chain.
      	(remove_caf_ref): Simplify.
      	(create_get_callback): Fix some deficiencies.
      	(create_allocated_callback): Adapt to new signature of split.
      	(create_send_callback): New function.
      	(rewrite_caf_send): Rewrite a call to caf_send to
      	caf_send_to_remote.
      	(coindexed_code_callback): Treat caf_send and caf_sendget
      	correctly.
      	* gfortran.h (enum gfc_isym_id): Add SENDGET-isym.
      	* gfortran.texi: Add documentation for send_to_remote.
      	* resolve.cc (gfc_resolve_code): No longer generate send_by_ref
      	when allocatable coarray (component) is on the lhs.
      	* trans-decl.cc (gfc_build_builtin_function_decls): Add
      	caf_send_to_remote decl.
      	* trans-intrinsic.cc (conv_caf_func_index): Ensure the static
      	variables created are not in a block-scope.
      	(conv_caf_send_to_remote): Translate caf_send_to_remote calls.
      	(conv_caf_send): Renamed to conv_caf_sendget.
      	(conv_caf_sendget): Renamed from conv_caf_send.
      	(gfc_conv_intrinsic_subroutine): Branch correctly for
      	conv_caf_send and sendget.
      	* trans.h: Correct decl.
      
      libgfortran/ChangeLog:
      
      	* caf/libcaf.h: Add/Correct prototypes for caf_get_from_remote,
      	caf_send_to_remote.
      	* caf/single.c (struct accessor_hash_t): Rename accessor_t to
      	getter_t.
      	(_gfortran_caf_register_accessor): Use new name of getter_t.
      	(_gfortran_caf_send_to_remote): New function for sending data to
      	coarray on a remote image.
      
      gcc/testsuite/ChangeLog:
      
      	* gfortran.dg/coarray/send_char_array_1.f90: Extend test to
      	catch more cases.
      	* gfortran.dg/coarray_42.f90: Invert tests use, because no
      	longer a send is needed when local memory in a coarray is
      	allocated.
      69eb0268
    • Andre Vehreschild's avatar
      Fortran: Add caf_is_present_on_remote. [PR107635] · 15847252
      Andre Vehreschild authored
      Replace caf_is_present by caf_is_present_on_remote which is using a
      dedicated callback for each object to test on the remote image.
      
      gcc/fortran/ChangeLog:
      
      	PR fortran/107635
      
      	* coarray.cc (create_allocated_callback): Add creating remote
      	side procedure for checking allocation status of coarray.
      	(rewrite_caf_allocated): Rewrite ALLOCATED on coarray to use caf
      	routine.
      	(coindexed_expr_callback): Exempt caf_is_present_on_remote from
      	being rewritten again.
      	* gfortran.h (enum gfc_isym_id): Add caf_is_present_on_remote
      	id.
      	* gfortran.texi: Add documentation for caf_is_present_on_remote.
      	* intrinsic.cc (add_functions): Add caf_is_present_on_remote
      	symbol.
      	* trans-decl.cc (gfc_build_builtin_function_decls): Define
      	interface of caf_is_present_on_remote.
      	* trans-intrinsic.cc (gfc_conv_intrinsic_caf_is_present_remote):
      	Translate caf_is_present_on_remote.
      	(trans_caf_is_present): Remove.
      	(caf_this_image_ref): Remove.
      	(gfc_conv_allocated): Take out coarray treatment, because that
      	is rewritten to caf_is_present_on_remote now.
      	(gfc_conv_intrinsic_function): Handle caf_is_present_on_remote
      	calls.
      	* trans.h: Add symbol for caf_is_present_on_remote and remove
      	old one.
      
      libgfortran/ChangeLog:
      
      	* caf/libcaf.h (_gfortran_caf_is_present_on_remote): Add new
      	function.
      	(_gfortran_caf_is_present): Remove deprecated one.
      	* caf/single.c (struct accessor_hash_t): Add function ptr access
      	for remote side call.
      	(_gfortran_caf_is_present_on_remote): Added.
      	(_gfortran_caf_is_present): Removed.
      
      gcc/testsuite/ChangeLog:
      
      	* gfortran.dg/coarray/coarray_allocated.f90: Adapt to new method
      	of checking on remote image.
      	* gfortran.dg/coarray_lib_alloc_4.f90: Same.
      15847252
    • Andre Vehreschild's avatar
      Fortran: Allow to use non-pure/non-elemental functions in coarray indexes [PR107635] · abbfeb2e
      Andre Vehreschild authored
      Extract calls to non-pure or non-elemental functions from index
      expressions on a coarray.
      
      gcc/fortran/ChangeLog:
      
      	PR fortran/107635
      
      	* coarray.cc (get_arrayspec_from_expr): Treat array result of
      	function calls correctly.
      	(remove_coarray_from_derived_type): Prevent memory loss.
      	(add_caf_get_from_remote): Correct locus.
      	(find_comp): New function to find or create a new component in a
      	derived type.
      	(check_add_new_comp_handle_array): Handle allocatable arrays or
      	non-pure/non-elemental functions in indexes of coarrays.
      	(check_add_new_component): Use above function.
      	(create_get_parameter_type): Rename to
      	create_caf_add_data_parameter_type.
      	(create_caf_add_data_parameter_type): Renaming of variable and
      	make the additional data a coarray.
      	(remove_caf_ref): Factor out to reuse in other caf-functions.
      	(create_get_callback): Use function factored out, set locus
      	correctly and ensure a kind is set for parameters.
      	(add_caf_get_intrinsic): Rename to add_caf_get_from_remote and
      	rename some variables.
      	(coindexed_expr_callback): Skip over function created by the
      	rewriter.
      	(coindexed_code_callback): Filter some intrinsics not to
      	process.
      	(gfc_coarray_rewrite): Rewrite also contained functions.
      	* trans-intrinsic.cc (gfc_conv_intrinsic_caf_get): Reflect
      	changed order on caf_get_from_remote ().
      
      libgfortran/ChangeLog:
      
      	* caf/libcaf.h (_gfortran_caf_register_accessor): Reflect
      	changed parameter order.
      	* caf/single.c (struct accessor_hash_t): Same.
      	(_gfortran_caf_register_accessor): Call accessor using a token
      	for accessing arrays with a descriptor on the source side.
      
      gcc/testsuite/ChangeLog:
      
      	* gfortran.dg/coarray_lib_comm_1.f90: Adapt scan expression.
      	* gfortran.dg/coarray/get_with_fn_parameter.f90: New test.
      	* gfortran.dg/coarray/get_with_scalar_fn.f90: New test.
      abbfeb2e
    • Andre Vehreschild's avatar
      Fortran: Prepare for more caf-rework. [PR107635] · b114312b
      Andre Vehreschild authored
      Factor out generation of code to get remote function index and to
      create the additional data structure.  Rename caf_get_by_ct to
      caf_get_from_remote.
      
      gcc/fortran/ChangeLog:
      
      	PR fortran/107635
      
      	* gfortran.texi: Rename caf_get_by_ct to caf_get_from_remote.
      	* trans-decl.cc (gfc_build_builtin_function_decls): Rename
      	intrinsic.
      	* trans-intrinsic.cc (conv_caf_func_index): Factor out
      	functionality to be reused by other caf-functions.
      	(conv_caf_add_call_data): Same.
      	(gfc_conv_intrinsic_caf_get): Use functions factored out.
      	* trans.h: Rename intrinsic symbol.
      
      libgfortran/ChangeLog:
      
      	* caf/libcaf.h (_gfortran_caf_get_by_ref): Remove from ABI.
      	This function is replaced by caf_get_from_remote ().
      	(_gfortran_caf_get_remote_function_index): Use better name.
      	* caf/single.c (_gfortran_caf_finalize): Free internal data.
      	(_gfortran_caf_get_by_ref): Remove from public interface, but
      	keep it, because it is still used by sendget ().
      
      gcc/testsuite/ChangeLog:
      
      	* gfortran.dg/coarray_lib_comm_1.f90: Adapt to renamed ABI
      	function.
      	* gfortran.dg/coarray_stat_function.f90: Same.
      	* gfortran.dg/coindexed_1.f90: Same.
      b114312b
    • Andre Vehreschild's avatar
      Fortran: Move caf_get-rewrite to coarray.cc [PR107635] · 90ba8291
      Andre Vehreschild authored
      Add a rewriter to keep all expression tree that is not optimization
      together.  At the moment this is just a move from resolve.cc, but will
      be extended to handle more cases where rewriting the expression tree may
      be easier.  The first use case is to extract accessors for coarray
      remote image data access.
      
      gcc/fortran/ChangeLog:
      
      	PR fortran/107635
      	* Make-lang.in: Add coarray.cc.
      	* coarray.cc: New file.
      	* gfortran.h (gfc_coarray_rewrite): New procedure.
      	* parse.cc (rewrite_expr_tree): Add entrypoint for rewriting
      	expression trees.
      	* resolve.cc (gfc_resolve_ref): Remove caf_lhs handling.
      	(get_arrayspec_from_expr): Moved to rewrite.cc.
      	(remove_coarray_from_derived_type): Same.
      	(convert_coarray_class_to_derived_type): Same.
      	(split_expr_at_caf_ref): Same.
      	(check_add_new_component): Same.
      	(create_get_parameter_type): Same.
      	(create_get_callback): Same.
      	(add_caf_get_intrinsic): Same.
      	(resolve_variable): Remove caf_lhs handling.
      
      libgfortran/ChangeLog:
      
      	* caf/single.c (_gfortran_caf_finalize): Free memory preventing
      	leaks.
      	(_gfortran_caf_get_by_ct): Fix constness.
      	* caf/libcaf.h (_gfortran_caf_register_accessor): Fix constness.
      90ba8291
    • Richard Biener's avatar
      tree-optimization/86270 - improve SSA coalescing for loop exit test · 94d01a88
      Richard Biener authored
      The PR indicates a very specific issue with regard to SSA coalescing
      failures because there's a pre IV increment loop exit test.  While
      IVOPTs created the desired IL we later simplify the exit test into
      the undesirable form again.  The following fixes this up during RTL
      expansion where we try to improve coalescing of IVs.  That seems
      easier that trying to avoid the simplification with some weird
      heuristics (it could also have been written this way).
      
      	PR tree-optimization/86270
      	* tree-outof-ssa.cc (insert_backedge_copies): Pattern
      	match a single conflict in a loop condition and adjust
      	that avoiding the conflict if possible.
      
      	* gcc.target/i386/pr86270.c: Adjust to check for no reg-reg
      	copies as well.
      94d01a88
    • H.J. Lu's avatar
      x86: Add a test for PR target/118936 · 83bc61c9
      H.J. Lu authored
      
      Add a test for PR target/118936 which was fixed by reverting:
      
      565d4e75 i386: Simplify PARALLEL RTX scan in ix86_find_all_reg_use
      11902be7 x86: Properly find the maximum stack slot alignment
      
      	PR target/118936
      	* gcc.target/i386/pr118936.c: New test.
      
      Signed-off-by: default avatarH.J. Lu <hjl.tools@gmail.com>
      83bc61c9
    • H.J. Lu's avatar
      Revert "x86: Properly find the maximum stack slot alignment" · 6921c93d
      H.J. Lu authored
      This reverts commit 11902be7.
      6921c93d
    • H.J. Lu's avatar
      Revert "i386: Simplify PARALLEL RTX scan in ix86_find_all_reg_use" · 0312d11b
      H.J. Lu authored
      This reverts commit 565d4e75.
      0312d11b
Loading