Skip to content
Snippets Groups Projects
  1. Jan 06, 2025
    • Piotr Trojanek's avatar
      ada: Fix crash on Depends contract with homonym functions · 798873d2
      Piotr Trojanek authored
      When resolving names in flow contracts, we refine the ordinary analysis by
      knowing that an overloaded name must refer to an abstract state and not a
      function. However, when all overloadings refer to function, we shouldn't
      crash, but instead let the error to be diagnosed later.
      
      gcc/ada/ChangeLog:
      
      	* sem_prag.adb (Resolve_State): Continue ordinary processing.
      798873d2
    • Javier Miranda's avatar
      ada: Crash in prefix notation with access to class-wide object · 0216cca1
      Javier Miranda authored
      The compiler crashes analyzing a prefix notation call when its
      prefix is an access to a class-wide object, an actual parameter
      is missing, and the sources are compiled with language extensions
      (-gnatX) and full errors (-gnatf).
      
      gcc/ada/ChangeLog:
      
      	* sem_ch4.adb (Try_Object_Operation): if no candidate interpretation
      	matches the context, redo the same analysis with Report_Error True
      	to report the error.
      0216cca1
    • Eric Botcazou's avatar
      ada: Plug small loophole in previous change · 145314b3
      Eric Botcazou authored
      The initial change only deals with the controlled record case for assignment
      statements, but the controlled array case needs the same treatment.
      
      gcc/ada/ChangeLog:
      
      	* exp_ch5.adb (Expand_Assign_Array): Bail out for controlled
      	components if the RHS is a function call and the assignment has
      	the No_Ctrl_Actions flag set.
      145314b3
    • Viljar Indus's avatar
      ada: Fix printing boolean attributes in the SARIF report · d47596b4
      Viljar Indus authored
      Boolean attributes should have the value true or false
      without any quotes.
      
      gcc/ada/ChangeLog:
      
      	* diagnostics-json_utils.adb: Add new method
      	Write_Boolean_Attribute.
      	* diagnostics-json_utils.ads: Likewise.
      	* diagnostics-sarif_emitter.adb (Print_Invocations): print
      	the executionSuccesful property value without extra quotes.
      d47596b4
    • Viljar Indus's avatar
      ada: Remove level attribute from Rules in the SARIF report · b4c9ba20
      Viljar Indus authored
      A Rule object in the SARIF report does not have a level
      attribute. Result objects are the elements in the SARIF
      reprot that have a level attribute that ultimately determines
      the level of each diagnostic object.
      
      Rules can have a defaultConfiguration attribute which has a level
      attribute that can be overridden in multiple ways. This can make
      the overall report more complex than it needs to be. It is simpler
      to remove the attribute from rules where it does not really matter
      and add it back in under the defaultConfiguration when there is an
      explicit need for it.
      
      gcc/ada/ChangeLog:
      
      	* diagnostics-sarif_emitter.adb (Print_Rule): Remove printing
      	of the level attribute since it does not match the SARIF schema.
      b4c9ba20
    • Piotr Trojanek's avatar
      ada: Avoid null-exclusion checks for Node_Field_Table · 92d50b9d
      Piotr Trojanek authored
      By generating the type of Node_Field_Table with a "not null" qualifier
      we check the null exclusion of its elements only once, at the object
      declaration.
      
      Tiny performance improvement for the debug builds (because in production
      builds checks are disabled anyway); semantics is unaffected.
      
      gcc/ada/ChangeLog:
      
      	* gen_il-gen.adb (Put_Tables): Add "not null" to the generated code.
      	* rtsfind.adb (Cstring_Ptr): Same for table with predefined RE_Id
      	error messages.
      	* impunit.adb (Aunit_Record): Same for array of alternative unit names.
      92d50b9d
    • Piotr Trojanek's avatar
      ada: Ada version used to compile runtime is constant · a172d6cf
      Piotr Trojanek authored
      Code cleanup.
      
      gcc/ada/ChangeLog:
      
      	* opt.ads (Ada_Version_Runtime): Now a constant, since it cannot
      	and should never be modified.
      a172d6cf
    • Bob Duff's avatar
      ada: null procedure cannot be used as compilation unit · 2a38c233
      Bob Duff authored
      This patch gives a syntax error if a null procedure is used as
      a compilation unit. The error was already given during semantic
      analysis; now it is given in the parser, which is more convenient
      for other tools like gprbuild, because the -gnats switch now
      gives the error.
      
      Note that the old message "null procedure cannot be declared at library
      level" was wrong; "library level" is not the same thing as "is a library
      unit".
      
      gcc/ada/ChangeLog:
      
      	* par-ch10.adb (P_Compilation_Unit): Give an error for "is null".
      	* sem_ch10.adb (Analyze_Subunit): Remove check for "is null"
      	as a subunit.
      	* sem_ch6.adb (Analyze_Subprogram_Declaration):
      	Remove check for "is null" as a library unit.
      2a38c233
    • Javier Miranda's avatar
      ada: Cleanup preanalysis of static expressions · fd52383f
      Javier Miranda authored
      Complete previous patch; required to avoid regressions in GNATProve.
      
      gcc/ada/ChangeLog:
      
      	* sem_ch6.adb (Analyze_Expression_Function): Set the parent of
      	the new node to be the parent of the original to get the proper
      	context, which is needed for complete error reporting and for
      	semantic analysis. Patch suggested by Eric Botcazou.
      fd52383f
    • Alexandre Oliva's avatar
      ada: C++ exception hierarchies: adjust for gnat-llvm · b8a94b0b
      Alexandre Oliva authored
      
      gnat-llvm doesn't support C++ imports, so arrange for the GNAT.CPP*
      units to be omitted from gnat-llvm builds.
      
      Drop G++ exception interoperability support from raise-gcc.c, so as to
      not require the GNAT.CPP* units that define some of the required
      symbols.
      
      Co-Authored-By: default avatarOlivier Hainque <hainque@adacore.com>
      
      gcc/ada/ChangeLog:
      
      	* Makefile.rtl (LLVM_BUILD): Define based on LLVM_CONFIG.
      	(GNATRTL_NONTASKING_OBJS): Make g-cpp, g-cppstd, and g-cstyin
      	conditional on -gcc or -arm EH, and on no LLVM_BUILD.
      	* raise-gcc.c (GXX_EH_INTEROP): Define as 0 on gnat-llvm or
      	CERT, and 1 otherwise.
      	(__gnat_get_cxx_dependent_exception) Omit on !GXX_EH_INTEROP.
      	(__gnat_maybe_get_cxx_dependent_exception): Likewise.
      	(__gnat_get_cxx_exception_type_info): Likewise.
      	(__gnat_obtain_caught_object): Likewise.
      	(is_handled_by): Omit eid parameter and G++ interop on
      	!GXX_EH_INTEROP.  Adjust callers.
      b8a94b0b
    • Eric Botcazou's avatar
      ada: Elide copy for calls as default values of nonlimited by-reference components · 0fe74112
      Eric Botcazou authored
      This prevents a temporary from being created on the primary stack to hold
      the result of the function calls before it is copied to the object being
      elaborated in the nonlimited by-reference case.
      
      That's already not done in the nonlimited non-by-reference case and there is
      no reason to do it in the former case either.  The main issue are the calls
      to Remove_Side_Effects in Expand_Ctrl_Function_Call (controlled case only)
      and in Expand_N_Assignment_Statement, which serve various purposes including
      very technical ones beside removing side effects.
      
      The change is therefore very conservative and only removes the copy in the
      case of a naked function call for the time being.
      
      gcc/ada/ChangeLog:
      
      	* einfo.ads (Returns_By_Ref): Fix description.
      	* exp_ch3.adb (Build_Record_Init_Proc.Build_Assignment): Do not
      	adjust the component manually (if need be), set No_Finalize_Actions
      	instead of No_Ctrl_Actions for this purpose.  Do not adjust when
      	the expression is a naked function call.
      	* exp_ch5.adb (Make_Tag_Ctrl_Assignment): Document the quirks of
      	the function.  Assert that the LHS of the assignment does not have
      	side effects and replace calls to Duplicate_Subexpr_No_Checks with
      	calls to New_Copy_Tree.  Rename local variable Asn to New_N.
      	(Expand_N_Assignment_Statement): In the tagged or controlled record
      	case, do remove side effects from both operands on entry.  Remove
      	them in the controlled record case, except if the RHS is a function
      	call and the assignment has the No_Ctrl_Actions flag set.
      	* exp_ch6.adb (Expand_Ctrl_Function_Call): Bail out when the parent
      	node is an assignment statement with the No_Ctrl_Actions flag set.
      	* sem_util.adb (Statically_Different): Return True for a function
      	call that does not return its result by reference.
      	* sinfo.ads (No_Ctrl_Actions): Adjust description and add a note for
      	the code generator.
      	(No_Finalize_Actions): Likewise.
      0fe74112
    • Bob Duff's avatar
      ada: Follow-on to Use inheritance in Gen_IL · 42c115ee
      Bob Duff authored
      Fix too-long line.
      
      gcc/ada/ChangeLog:
      
      	* gen_il-gen.adb: Fix too-long line.
      42c115ee
    • Tonu Naks's avatar
      ada: Silence unused parameter warning on linux · 4b0a5e93
      Tonu Naks authored
      In __gnat_locate_exec_on_path (char *exec_name, int current_dir_on_windows)
      the recently added second parameter is for windows only. On non-windows
      platforms its usage is removed by the preprocessor and the compiler
      reports unused parameter.
      
      gcc/ada/ChangeLog:
      
      	* adaint.c: void parameter on non-windows platforms
      4b0a5e93
    • Bob Duff's avatar
      ada: Use inheritance in Gen_IL · 93eb5676
      Bob Duff authored
      In Gen_IL, detect cases where fields could be inherited from
      an abstract type instead of being defined in each of two or more
      descendants of that type. Raise Illegal when that is the case,
      except in specific cases called out as exceptions to this rule.
      
      For every such case, either update the types declared in
      Gen_Nodes and Gen_Entities to use inheritance, or add the case
      to the list of exceptions where we do not want to use inheritance.
      
      gcc/ada/ChangeLog:
      
      	* gen_il-internals.ads: Split Fields field into two fields
      	Imm_Fields and Fields.
      	* gen_il-gen.adb: Modify the field-inheritance
      	algorithm to inherit at each level of the type hierarchy,
      	rather than just inheriting into concrete types.
      	For example, if C is a concrete type derived from B,
      	which is in turn derived from A, we now set the Fields
      	of B to include those of A. (We had always set the Fields
      	of C to include those of A and B, and we still do that.)
      	(Compute_Fields_For_One_Type): Detect cases where a given
      	field is declared for all descendants of a given abstract
      	type, in which case we should consider declaring it in
      	the abstract type, and inheriting it in those descendants.
      	(Exception_To_Inheritance_Rule): These are the cases where
      	we could inherit, but we don't want to.
      	* gen_il-gen-gen_nodes.adb: Move fields up the type hierarchy,
      	so they are inherited instead of being defined separately.
      	* gen_il-gen-gen_entities.adb: Likewise.
      93eb5676
    • Viljar Indus's avatar
      ada: Fix incorrect incomplete type error · 950df609
      Viljar Indus authored
      In Ada 2005 even if the formal is using a tagged limited type
      then the type should not be considered incomplete.
      
      gcc/ada/ChangeLog:
      
      	* sem_ch6.adb (Analyze_Subprogram_Body_Helper):
      	Exchange_Limited_Views also in Ada 2005.
      950df609
    • Eric Botcazou's avatar
      ada: Fix finalization issue introduced by previous change · 82e9c7c9
      Eric Botcazou authored
      When detecting calls to subprograms specified for aspects of a type, the
      entity denoted by the aspects must go through Ultimate_Alias, since that
      of the name of the calls did the same.
      
      gcc/ada/ChangeLog:
      
      	* exp_ch6.adb (Expand_Call_Helper): Call Ultimate_Alias for the
      	detection of calls to subprograms specified for Constant_Indexing.
      	* exp_util.adb (Is_Indexed_Container): Likewise.
      	(Is_Iterated_Container): Likewise for Default_Iterator.
      82e9c7c9
    • Ronan Desplanques's avatar
      ada: Fix markup in user's guide · 11d0b5aa
      Ronan Desplanques authored
      gcc/ada/ChangeLog:
      
      	* doc/gnat_ugn/building_executable_programs_with_gnat.rst: Fix markup.
      	* gnat_ugn.texi: Regenerate.
      11d0b5aa
    • Piotr Trojanek's avatar
      ada: Remove workaround for RM_Size being unable to represent unknown size · 411008f2
      Piotr Trojanek authored
      When validating instances of Ada.Unchecked_Conversion, we explicitly detected
      null arrays, because a size of 0 was used to indicate both an unknown size and
      an actual size of 0. This limitation has been lifted, so we can remove
      detection of null arrays.
      
      Code cleanup; behavior is unaffected.
      
      gcc/ada/ChangeLog:
      
      	* sem_ch13.adb (Validate_Unchecked_Conversions): Remove detection of
      	null arrays; remove tests for sizes being present, which are redundant
      	after calling Known_Static_RM_Size.
      411008f2
    • Jakub Jelinek's avatar
      tree-ssa-dce: Punt on allocations with too large constant sizes [PR118224] · 804e9d55
      Jakub Jelinek authored
      As suggested by Richi in the PR, the following patch will fail to DCE
      allocation calls if they have constant size which is too large (over
      PTRDIFF_MAX), or for the case of calloc, if either of the arguments
      is too large (in that case in theory the call could succeed if the other
      argument is variable zero but who cares) or if both are constant and
      their product overflows or is above PTRDIFF_MAX.
      
      This will make some pedantic conformance tests happy, though if one
      hides the size one will still need to use -fno-malloc-dce or obfuscate even
      the malloc etc. uses.  If the size is constant and too large, it isn't worth
      trying to optimize it.
      
      2025-01-06  Jakub Jelinek  <jakub@redhat.com>
      
      	PR tree-optimization/118224
      	* tree-ssa-dce.cc (is_removable_allocation_p): Don't return true
      	for allocations with constant size argument larger than PTRDIFF_MAX
      	or for calloc with one of the arguments constant larger than
      	PTRDIFF_MAX or their product known constant above PTRDIFF_MAX.
      	Fix comment typos, furhter -> further and then -> than.
      	* lto-section-in.cc (lto_free_function_in_decl_state_for_node):
      	Fix comment typo, furhter -> further.
      
      	* gcc.dg/pr118224.c: New test.
      	* c-c++-common/ubsan/vla-1.c (bar): Use noipa attribute instead
      	of noinline, noclone.
      804e9d55
    • Eric Botcazou's avatar
      Ada: fix documentation of pragma Unimplemented_Unit · 90b6d3bc
      Eric Botcazou authored
      gcc/ada
      	PR ada/117936
      	* doc/gnat_rm/implementation_defined_pragmas.rst
      	(Unimplemented_Unit): Adjust the description of the error message.
      	* gnat_rm.texi: Regenerate.
      90b6d3bc
    • Kito Cheng's avatar
      RISC-V: Move fortran testcase to gfortran.target · a35b89a2
      Kito Cheng authored
      gcc/testsuite/ChangeLog:
      
      	* gcc.target/riscv/rvv/fortran/pr111395.f90: Move this file to...
      	* gfortran.target/riscv/rvv/pr111395.f90: ...here.
      	* gcc.target/riscv/rvv/fortran/pr111566.f90: Move this file to...
      	* gfortran.target/riscv/rvv/pr111566.f90: ...here.
      	* gcc.target/riscv/rvv/rvv-fortran.exp: Move this file to...
      	* gfortran.target/riscv/rvv/rvv.exp: ...here.
      a35b89a2
    • GCC Administrator's avatar
      Daily bump. · 451ff5b5
      GCC Administrator authored
      451ff5b5
  2. Jan 05, 2025
    • Iain Buclaw's avatar
      d: Merge upstream dmd, druntime 66b93fc24a, phobos 0c28620c3 · f5351b38
      Iain Buclaw authored
      Synchronizing with the upstream release of v2.109.1.
      
      D front-end changes:
      
      	- Import dmd v2.109.1.
      	- Copying from `const(void)[]' to `void[]' is now disallowed
      	  with `-fpreview=fiximmutableconv'.
      	- Import expressions are now treated as hex strings.
      	- Using boolean values other than 0 or 1 in `@safe' code is now
      	  deprecated.
      
      D runtime changes:
      
      	- Import dmd v2.109.1.
      
      Phobos changes:
      
      	- Import dmd v2.109.1.
      
      gcc/d/ChangeLog:
      
      	* dmd/MERGE: Merge upstream dmd 66b93fc24a.
      	* dmd/VERSION: Bump version to v2.109.1.
      	* d-builtins.cc (build_frontend_type): Update for new front-end
      	interface.
      	(matches_builtin_type): Likewise.
      	* d-codegen.cc (identity_compare_p): Likewise.
      	(call_side_effect_free_p): Likewise.
      	* d-convert.cc (convert_expr): Likewise.
      	(check_valist_conversion): Likewise.
      	* d-lang.cc (d_types_compatible_p): Likewise.
      	* d-target.cc (Target::isVectorTypeSupported): Likewise.
      	(Target::isReturnOnStack): Likewise.
      	(Target::preferPassByRef): Likewise.
      	* decl.cc (class DeclVisitor): Likewise.
      	* expr.cc (class ExprVisitor): Likewise.
      	* typeinfo.cc (class TypeInfoVisitor): Likewise.
      	* types.cc (class TypeVisitor): Likewise.
      
      libphobos/ChangeLog:
      
      	* libdruntime/MERGE: Merge upstream druntime 66b93fc24a.
      	* src/MERGE: Merge upstream phobos 0c28620c3.
      	* src/Makefile.am (PHOBOS_DSOURCES): Add
      	std/internal/test/sumtype_example_overloads.d.
      	* src/Makefile.in: Regenerate.
      f5351b38
    • Iain Buclaw's avatar
      d: Merge upstream dmd, druntime 07bc5b9b3c, phobos de1dea109 · a676a516
      Iain Buclaw authored
      Synchronizing with the upstream release of v2.109.0.
      
      D front-end changes:
      
              - Import dmd v2.109.0.
      
      D runtime changes:
      
              - Import druntime v2.109.0.
      
      Phobos changes:
      
              - Import phobos v2.109.0.
      
      gcc/d/ChangeLog:
      
      	* decl.cc (DeclVisitor::finish_vtable): Update for new front-end
      	interface.
      	* dmd/MERGE: Merge upstream dmd 07bc5b9b3c.
      	* dmd/VERSION: Bump version to v2.109.0.
      
      libphobos/ChangeLog:
      
      	* libdruntime/MERGE: Merge upstream druntime 07bc5b9b3c.
      	* src/MERGE: Merge upstream phobos de1dea109.
      a676a516
    • Iain Buclaw's avatar
      libphobos: Merge upstream druntime c11e1d1708, phobos 303b9c9f7 · 3dfad340
      Iain Buclaw authored
      Synchronizing the library with the upstream release of v2.108.1.
      
      D runtime changes:
      
              - Import druntime v2.108.1.
      	- Removed all `collectNoStack' functions and API from the
      	  garbage collector.
      	- The static method `core.thread.Thread.sleep' is now marked as
      	  `@trusted'.
      
      Phobos changes:
      
              - Import phobos v2.108.1.
      	- Add `std.process.Config.preExecDelegate'.
      
      libphobos/ChangeLog:
      
      	* libdruntime/MERGE: Merge upstream druntime c11e1d1708.
      	* libdruntime/Makefile.am (DRUNTIME_DSOURCES_FREEBSD): Add
      	core/sys/freebsd/mqueue.d.
      	(DRUNTIME_DSOURCES_LINUX): Add core/sys/linux/sys/mount.d.
      	* libdruntime/Makefile.in: Regenerate.
      	* src/MERGE: Merge upstream phobos 303b9c9f7.
      	* testsuite/libphobos.exceptions/invalid_memory_operation.d: Adjust
      	test.
      3dfad340
    • Iain Buclaw's avatar
      d: Merge upstream dmd c11e1d1708, druntime e60bfd11bd, phobos 8729740e3 · 332cf038
      Iain Buclaw authored
      Synchronizing the compiler with the upstream release of v2.108.1.
      
      D front-end changes:
      
              - Import dmd v2.108.1.
      	- Add experimental support for language editions, enabled by
      	  adding the UDA `@__edition_latest_do_not_use' before module
      	  declarations.
      	- [Next Edition] Aliasing a member of a type instance is now an
      	  error.
      	- Added `__ctfeWrite' to write messages from CTFE.
      	- `-fdump-c++-spec' generates signatures for `extern(Windows)'
      	  and `extern(System)' functions.
      	- `foreach_reverse' on a delegate is now an error.
      	- ImportC has improved Unicode support.
      
      D runtime changes:
      
              - Mark unsafe unittest @trusted.
      
      Phobos changes:
      
              - Mark unsafe functions @trusted.
      
      gcc/d/ChangeLog:
      
      	* Make-lang.in (D_FRONTEND_OBJS): Add d/attribsem.o,
      	d/common-charactertables.o, d/common-identifiertables.o.
      	* d-attribs.cc (apply_user_attributes): Update for new front-end
      	interface.
      	* d-builtins.cc (d_init_versions): Predefine CppRuntime_GNU.
      	* d-incpath.cc (add_globalpaths): Update for new front-end interface.
      	(add_filepaths): Likewise.
      	(add_import_paths): Likewise.
      	* d-lang.cc (d_post_options): Likewise.
      	* dmd/MERGE: Merge upstream dmd c11e1d1708.
      	* dmd/VERSION: Bump version to v2.108.1.
      
      libphobos/ChangeLog:
      
      	* libdruntime/MERGE: Merge upstream druntime e60bfd11bd.
      	* src/MERGE: Merge upstream phobos 8729740e3.
      
      gcc/testsuite/ChangeLog:
      
      	* gdc.dg/torture/pr96435.d: Add dg-warning.
      332cf038
    • Estevan Castilho (Tevo)'s avatar
      Ada: Fix build for dummy s-taprop · 31f1bec6
      Estevan Castilho (Tevo) authored
      gcc/ada
      	* libgnarl/s-taprop__dummy.adb: Remove use clause for
      	System.Parameters.
      	(Unlock): Remove Global_Lock formal parameter.
      	(Write_Lock): Likewise.
      31f1bec6
    • Iain Buclaw's avatar
      testsuite, d: Fix failing pr110406.d test · 345ad67f
      Iain Buclaw authored
      At some point during GCC 15 development, the compiler-generated code for
      D ModuleInfo support now gets transformed into the following on x86:
      
          _12 = (uint) &__stop_minfo;
          _13 = (uint) &__start_minfo;
          _14 = (uint) &gdc.dso_slot;
          _15 = {1, _14, _13, _12};
          gdc.dso_initialized = 0;
          MEM <unsigned char[8]> [(void *)&D.1974 + 16B] = {};
          MEM <vector(4) uint> [(void *)&D.1974] = _15;
          _d_dso_registry (&D.1974);
      
      This causes the scan-tree-dump-not test to fail. As ModuleInfo is not
      what's being checked for in PR110406, remove its generation altogether.
      
      gcc/testsuite/ChangeLog:
      
      	* gdc.dg/torture/pr110406.d: Add -fno-moduleinfo to dg-options.
      345ad67f
    • GCC Administrator's avatar
      Daily bump. · a0aa30fc
      GCC Administrator authored
      a0aa30fc
  3. Jan 04, 2025
    • Hans-Peter Nilsson's avatar
      testsuite: Replace MMIX-specific adjustments with TARGET_CALLEE_COPIES-adjustments · ea228f22
      Hans-Peter Nilsson authored
      With the dump now emitting "privatized symbols" in the default
      "%s.%lu" format also for MMIX, there's still a difference for MMIX.
      This time it's because numbers have changed (copies introduced before
      this point) because it has TARGET_CALLEE_COPIES yielding true.
      Redundant copies may have been elided at this point, but the change
      in name remains.
      
      Since that's true for other targets too, an obvious change is to
      generalize the tested patterns to include TARGET_CALLEE_COPIES-true
      targets, as a brief inspection of the history of these tests shows
      that the point of these tests lie not in whether copies have been done
      but in the part of the pattern that match a constant.
      
      Also fixed up a "." where there should have been a "\\.".
      
      	* gcc.dg/tree-ssa/vector-4.c: Replace MMIX adjustments with
      	TARGET_CALLEE_COPIES-agnostic adjustments.
      	* gcc.dg/tree-ssa/forwprop-36.c: Ditto.  Correct pattern to match a
      	literal ".".
      ea228f22
    • Hans-Peter Nilsson's avatar
      MMIX: Replace format for private symbol output by output-time adjustment · 8395cf72
      Hans-Peter Nilsson authored
      All this started with belated MMIX regression patrol in observance of
      the holidays, looking at gcc.dg/Wstringop-overflow-27.c as a
      regression for target mmix.  That's because of a single message not
      matched, where there is "note: destination object 'vla::22'" instead
      of the expected "note: destination object 'vla'" due to
      r11-5523-geafe8ee7af13c3 in which the message format and the match
      changed.
      
      That ::22 is because some identifiers that are SSA_NAME-versions and
      other clones are "privatized" by ASM_FORMAT_PRIVATE_NAME and its
      companion macro by default, ASM_PN_FORMAT; see the patch.  I found
      that these "private names" were "unprivatized" for the purpose of
      warnings and error messages *in code that only handles the default
      format*, "%s.%lu".
      
      I went ahead and wrote and tested a patch-set to hookize that
      unprivatizing code, but found that it would only affect errors and
      warnings; dumps still had the "target format".  While having bad
      thoughts about being hit by yet another structural testism because of
      the choice of outputting yet another target-specific format instead of
      a canonical "versioned" format, I realized it *already was handling a
      canonical format*: only the default "%s.%lu" is properly handled.
      
      To wit, targets are better off with the default "%s.%lu" and adjusting
      it (if needed, including not allowing "." or "$"), *at time of
      assembly code output*.  IOW, outputs, both references and definitions,
      pass a single label-output target code point: ASM_OUTPUT_LABELREF,
      which is that time of output.  Some older testsuite adjustments need
      to be unadjusted, but is another rabbit-hole, so I've kept that change
      separate.  Other tests checking dumps, now started to pass for the
      first time, some 20+.
      
      	* config/mmix/mmix.cc (mmix_asm_output_labelref): Replace '.'
      	with '::'.
      	* config/mmix/mmix.h (ASM_PN_FORMAT): Define to actual default.
      8395cf72
    • GCC Administrator's avatar
      Daily bump. · afb656b0
      GCC Administrator authored
      afb656b0
  4. Jan 03, 2025
    • Sandra Loosemore's avatar
      OpenMP: Robustify C front end handling of attribute-syntax pragmas · c97692d5
      Sandra Loosemore authored
      Presently, the code to handle OpenMP attribute-syntax pragmas in the C
      front end assumes nothing else is messing with redirecting
      parser->tokens, and makes no provision for restoring it from anything
      other than parser->tokens_buf when the buffer allocated for the pragma
      is exhausted.  Adding support for metadirectives will change that,
      since it also needs to buffer tokens for the metadirective
      alternatives, and an attribute-syntax directive can appear inside a
      metadirective.
      
      This patch adds a more general save/restore mechanism attached to the
      parser via a pointer to a new struct omp_attribute_pragma_state.
      
      gcc/c/ChangeLog
      
      	* c-parser.cc (struct c_parser): Change in_omp_attribute_pragma
      	field to be of type struct omp_attribute_pragma_state.
      	(struct omp_attribute_pragma_state): New.
      	(c_parser_skip_until_found): Use the new way to restore state
      	on EOF.
      	(c_parser_skip_to_pragma_eol): Likewise.
      	(c_parser_handle_statement_omp_attributes): Create an
      	omp_attribute_pragma_state to hold the restore state.  Do not
      	store state in tok.flags.
      	(omp_maybe_parse_omp_decl): Likewise.
      c97692d5
    • Richard Sandiford's avatar
      rtlanal: Treat writes to sp as also writing to memory [PR117938] · 355475e3
      Richard Sandiford authored
      This PR was about a case in which late-combine moved a stack
      deallocation across an earlier stack access.  This was possible
      because the deallocation was missing the RTL-SSA equivalent of
      a vop, which in turn was because rtl_properties didn't treat
      the deallocation as writing to memory.  I think the bug was
      ultimately there.
      
      gcc/
      	PR rtl-optimization/117938
      	* rtlanal.cc (rtx_properties::try_to_add_dest): Treat writes
      	to the stack pointer as also writing to memory.
      
      gcc/testsuite/
      	PR rtl-optimization/117938
      	* gcc.dg/torture/pr117938.c: New test.
      355475e3
    • Thomas Koenig's avatar
      Mention generating C prototypes in the C interop documentation. · 92ad6d4e
      Thomas Koenig authored
      gcc/fortran/ChangeLog:
      
      	* gfortran.texi: New subsection "Generating C prototypes from
      	Fortran".
      92ad6d4e
    • Jakub Jelinek's avatar
      libgomp: Regenerate configure after copyright year bump · b11d85f2
      Jakub Jelinek authored
      2025-01-03  Jakub Jelinek  <jakub@redhat.com>
      
      	* configure: Regenerate.
      b11d85f2
    • Jakub Jelinek's avatar
      varasm: Fix up array_size_for_constructor RAW_DATA_CST handling once again [PR118275] · 6f444e45
      Jakub Jelinek authored
      As the following testcases show (the latter only if I revert the
      temporary reversion of the C++ large array speedup), the FEs aren't
      really consistent in the type of array CONSTRUCTOR_ELTS indexes,
      it can be bitsizetype, but can be sizetype as well.
      Given that everything else is able to cope with it just fine,
      I'm using build_int_cst which also doesn't care what type it is,
      instead of bitsize_int, which I've used in PR117190 fix (previously
      it was size_int).
      
      2025-01-03  Jakub Jelinek  <jakub@redhat.com>
      
      	PR c++/118275
      	* varasm.cc (array_size_for_constructor): Use build_int_cst
      	with TREE_TYPE (index) as first argument, instead of bitsize_int.
      
      	* g++.dg/cpp/embed-18.C: New test.
      	* g++.dg/ext/flexary41.C: New test.
      6f444e45
    • Jakub Jelinek's avatar
      forwprop: Use tree_fits_shwi_p in check_ctz_array · 514577c6
      Jakub Jelinek authored
      When touching the function yesterday, I was surprised to see just
      TREE_CODE (something) != INTEGER_CST checks followed by tree_to_shwi.
      That would ICE if the INTEGER_CST doesn't fit.
      
      I have actually not been able to reproduce an ICE for the elt case
      as the caller gives up if the precision of the array type is larger than 32
      bits (but I think it is still cleaner to use it), the idx case can actually
      ICE e.g. on
      static const unsigned long long magic = 0x03f08c5392f756cdULL;
      static const char table[] = {
           0, [0x8000000000000000ULL] = 1, 12,  2, 13, 22, 17,  3, 14, 33, 23, 36, 18, 58, 28,  4,
          62, 15, 34, 26, 24, 48, 50, 37, 19, 55, 59, 52, 29, 44, 39,  5,
          63, 11, 21, 16, 32, 35, 57, 27, 61, 25, 47, 49, 54, 51, 43, 38,
          10, 20, 31, 56, 60, 46, 53, 42, 9, 30, 45, 41,  8, 40,  7,  6,
      };
      
      int ctz (unsigned long x)
      {
        unsigned long lsb = x & -x;
        return table[(lsb * magic) >> 58];
      }
      ~/src/gcc/obj20/gcc/cc1 -quiet /tmp/1.c -O2 -mbmi
      /tmp/1.c:2:19: warning: size of ‘table’ 9223372036854775871 bytes exceeds maximum object size 9223372036854775807 [-Wlarger-than=]
          2 | static const char table[] = {
            |                   ^~~~~
      during GIMPLE pass: forwprop
      /tmp/1.c: In function ‘ctz’:
      /tmp/1.c:13:1: internal compiler error: in tree_to_shwi, at tree.cc:6518
         13 | }
            | ^
      0x2efa51f internal_error(char const*, ...)
              ../../gcc/diagnostic-global-context.cc:517
      0xf3c617 fancy_abort(char const*, int, char const*)
              ../../gcc/diagnostic.cc:1722
      0x949a36 tree_to_shwi(tree_node const*)
              ../../gcc/tree.cc:6518
      0x949a36 tree_to_shwi(tree_node const*)
              ../../gcc/tree.cc:6516
      0x18472d5 check_ctz_array
              ../../gcc/tree-ssa-forwprop.cc:2286
      but given the 9223372036854775871 bytes long array
      I'm not sure it is appropriate for the testsuite.
      
      2025-01-03  Jakub Jelinek  <jakub@redhat.com>
      
      	* tree-ssa-forwprop.cc (check_ctz_array): Use tree_fits_shwi_p instead
      	of just TREE_CODE tests for INTEGER_CST.
      514577c6
    • Sam James's avatar
      testsuite: torture: add LLVM testcase for DSE vs. -ftrivial-auto-var-init= · 26ca00ee
      Sam James authored
      This testcase came up in a recent LLVM bug report [0] for DSE vs
      -ftrivial-auto-var-init=. Add it to our testsuite given that area
      could do with better coverage.
      
      [0] https://github.com/llvm/llvm-project/issues/119646
      
      
      
      gcc/testsuite/ChangeLog:
      
      	* gcc.dg/torture/dse-trivial-auto-var-init.c: New test.
      
      Co-authored-by: default avatarAndrew Pinski <pinskia@gmail.com>
      26ca00ee
    • Harald Anlauf's avatar
      Fortran: Cray pointer comparison wrongly optimized away [PR106692] · c7754a2f
      Harald Anlauf authored
      	PR fortran/106692
      
      gcc/fortran/ChangeLog:
      
      	* trans-expr.cc (gfc_conv_expr_op): Inhibit excessive optimization
      	of Cray pointers by treating them as volatile in comparisons.
      
      gcc/testsuite/ChangeLog:
      
      	* gfortran.dg/cray_pointers_13.f90: New test.
      c7754a2f
Loading