Skip to content
Snippets Groups Projects
  1. Apr 09, 2023
  2. Apr 08, 2023
    • Jakub Jelinek's avatar
      PR tree-optimization/109392 · 101380a8
      Jakub Jelinek authored
      If we have an object with SSA_NAME_OCCURS_IN_ABNORMAL_PHI, then
      maybe_push_res_to_seq may fail.  Directly build the extraction
      for that case.
      
      	PR tree-optimization/109392
      
      gcc/
      	* tree-vect-generic.cc (tree_vec_extract): Handle failure
      	of maybe_push_res_to_seq better.
      
      gcc/testsuite/
      
      	* gcc.dg/pr109392.c: New test.
      101380a8
    • John David Anglin's avatar
      xfail gcc.dg/long_branch.c on hppa. · a99f6c7f
      John David Anglin authored
      2023-04-08  John David Anglin  <danglin@gcc.gnu.org>
      
      gcc/testsuite/ChangeLog:
      
      	* gcc.dg/pr84877.c: xfail on hppa*-*-*.
      a99f6c7f
    • John David Anglin's avatar
      Fix gcc.dg/long_branch.c on hppa. · 48a48c5e
      John David Anglin authored
      2023-04-08  John David Anglin  <danglin@gcc.gnu.org>
      
      gcc/testsuite/ChangeLog:
      
      	* gcc.dg/long_branch.c: Use timeout factor 2.0 on hppa*-*-*.
      48a48c5e
    • Tetsuma Hoshino's avatar
      PR target/109402: v850 (not v850e) variant of __muldi3() moves sp in reversed direction [PR109402] · 79fb2de0
      Tetsuma Hoshino authored
      muldi3 will deallocate stack space after the call to __save_r26_r31,
      then re-allocate the space a short while later.  If an interrupt
      occurs in that window, it can clobber items on the stack.
      
      	PR target/109402
      
      libgcc/
      	* config/v850/lib1funcs.S (___muldi3): Remove unnecessary
      	stack manipulations.
      79fb2de0
    • Jakub Jelinek's avatar
      riscv: Fix genrvv-type-indexer dependencies · c18b1b0b
      Jakub Jelinek authored
      I've noticed
      make: Circular build/genrvv-type-indexer.o <- gtype-desc.h dependency dropped.
      
      The following patch fixes that.  The RTL_BASE_H variable includes a lot of
      headers which the generator doesn't include, including gtype-desc.h.
      I've preprocessed it and checked all gcc/libiberty headers against what is
      included in the other dependency variables and here is what I found:
      1) coretypes.h includes align.h, poly-int.h and poly-int-types.h which
         weren't listed (most of dependencies are thankfully done automatically,
         so it isn't that big deal except for these generators and the like)
      2) system.h includes filenames.h (already listed) but filenames.h includes
         hashtab.h; instead of adding FILENAMES_H I've just added the dependency
         to SYSTEM_H
      3) $(RTL_BASE_H) wasn't really needed at all and insn-modes.h is already
         included in $(CORETYPES_H)
      
      2023-04-08  Jakub Jelinek  <jakub@redhat.com>
      
      	* Makefile.in (CORETYPES_H): Depend on align.h, poly-int.h and
      	poly-int-types.h.
      	(SYSTEM_H): Depend on $(HASHTAB_H).
      	* config/riscv/t-riscv (build/genrvv-type-indexer.o): Remove unused
      	dependency on $(RTL_BASE_H), remove redundant dependency on
      	insn-modes.h.
      c18b1b0b
    • Paul Thomas's avatar
      Fortran: Fix some of the bugs in associate [PR87477] · eac49385
      Paul Thomas authored
      2023-04-08  Paul Thomas  <pault@gcc.gnu.org>
      
      gcc/fortran
      	PR fortran/87477
      	* iresolve.cc (gfc_resolve_adjustl, gfc_resolve_adjustr): if
      	string length is deferred use the string typespec for result.
      	* resolve.cc (resolve_assoc_var): Handle parentheses around the
      	target expression.
      	(resolve_block_construct): Remove unnecessary static decls.
      	* trans-array.cc (gfc_conv_expr_descriptor): Guard string len
      	expression in condition. Improve handling of string length and
      	span, especially for substrings of the descriptor.
      	(duplicate_allocatable): Make element type more explicit with
      	'eltype'.
      	* trans-decl.cc (gfc_get_symbol_decl): Emit a fatal error with
      	appropriate message instead of ICE if symbol type is unknown.
      	(gfc_generate_function_code): Set current locus to proc_sym
      	declared_at.
      	* trans-expr.cc (gfc_get_expr_charlen): Retain last charlen in
      	'previous' and use if end expression in substring reference is
      	null.
      	(gfc_conv_string_length): Use gfc_conv_expr_descriptor if
      	'expr_flat' is an array. Add post block to catch deallocation
      	of temporaries.
      	(gfc_conv_procedure_call): Assign the parmse string length to
      	the expression string length, if it is deferred.
      	(gfc_trans_alloc_subarray_assign): If this is a deferred string
      	length component, store the string length in the hidden comp.
      	Update the typespec length accordingly. Generate a new type
      	spec for the call to gfc_duplicate-allocatable in this case.
      	* trans-io.cc (gfc_trans_transfer): Scalarize transfer of
      	deferred character array components.
      
      gcc/testsuite/
      	PR fortran/87477
      	* gfortran.dg/associate_47.f90 : Enable substring test.
      	* gfortran.dg/associate_51.f90 : Update an error message.
      	* gfortran.dg/goacc/array-with-dt-2.f90 : Add span to
      	uninitialzed dg-warnings.
      
      	PR fortran/85686
      	PR fortran/88247
      	PR fortran/91941
      	PR fortran/92779
      	PR fortran/93339
      	PR fortran/93813
      	PR fortran/100948
      	PR fortran/102106
      	* gfortran.dg/associate_60.f90 : New test
      
      	PR fortran/98408
      	* gfortran.dg/pr98408.f90 : New test
      
      	PR fortran/105205
      	* gfortran.dg/pr105205.f90 : New test
      
      	PR fortran/106918
      	* gfortran.dg/pr106918.f90 : New test
      eac49385
    • Paul Thomas's avatar
      Fortran: Fix dg directives and remove trailing whitespaces in testsuite · 46fe32cb
      Paul Thomas authored
      2023-04-08   Paul Thomas  <pault@gcc.gnu.org>
      
      	* gfortran.dg/c-interop/allocatable-optional-pointer.f90 : Fix
      	dg directive and remove trailing whitespace.
      	* gfortran.dg/c-interop/c407a-1.f90 : ditto
      	* gfortran.dg/c-interop/c407b-1.f90 : ditto
      	* gfortran.dg/c-interop/c407b-2.f90 : ditto
      	* gfortran.dg/c-interop/c407c-1.f90 : ditto
      	* gfortran.dg/c-interop/c535a-1.f90 : ditto
      	* gfortran.dg/c-interop/c535a-2.f90 : ditto
      	* gfortran.dg/c-interop/c535b-1.f90 : ditto
      	* gfortran.dg/c-interop/c535b-2.f90 : ditto
      	* gfortran.dg/c-interop/c535b-3.f90 : ditto
      	* gfortran.dg/c-interop/c535c-1.f90 : ditto
      	* gfortran.dg/c-interop/c535c-2.f90 : ditto
      	* gfortran.dg/c-interop/deferred-character-1.f90 : ditto
      	* gfortran.dg/c-interop/removed-restrictions-1.f90 : ditto
      	* gfortran.dg/c-interop/removed-restrictions-2.f90 : ditto
      	* gfortran.dg/c-interop/removed-restrictions-4.f90 : ditto
      	* gfortran.dg/c-interop/tkr.f90 : ditto
      	* gfortran.dg/class_result_10.f90 : ditto
      	* gfortran.dg/dtio_35.f90 : ditto
      	* gfortran.dg/gomp/affinity-clause-1.f90 : ditto
      	* gfortran.dg/pr103258.f90 : ditto
      	* gfortran.dg/pr59107.f90 : ditto
      	* gfortran.dg/pr93835.f08 : ditto
      46fe32cb
    • GCC Administrator's avatar
      Daily bump. · d8ec34a1
      GCC Administrator authored
      d8ec34a1
  3. Apr 07, 2023
  4. Apr 06, 2023
    • Stam Markianos-Wright's avatar
      arm: remove unused variables from test · 1d509f19
      Stam Markianos-Wright authored
      This is just a minor issue I found with a previous test
      of mine that caused it to fail in C++ mode due to these
      unused const variables being uninitialised. I forgot to
      remove these after removing some test cases that did use
      them. I removed the test cases, because I came to the
      conclusion that the const-ness of the immediate was
      irrelevant to the test itself.
      Removing the variables now makes the test PASS for C++.
      
      gcc/testsuite/ChangeLog:
      
      	* gcc.target/arm/mve/intrinsics/mve_intrinsic_type_overloads-fp.c: Remove unused variables.
      	* gcc.target/arm/mve/intrinsics/mve_intrinsic_type_overloads-int.c: Remove unused variables.
      1d509f19
    • Richard Earnshaw's avatar
      arm: mve: fix auto-inc generation [PR107674] · ddc9b5ee
      Richard Earnshaw authored
      My change r13-416-g485a0ae0982abe caused the compiler to stop
      generating auto-inc operations on mve loads and stores.  The fix
      is to check whether there is a replacement register available
      when in strict mode and the register is still a pseudo.
      
      gcc:
      
      	PR target/107674
      	* config/arm/arm.cc (arm_effective_regno): New function.
      	(mve_vector_mem_operand): Use it.
      ddc9b5ee
    • Andrew MacLeod's avatar
      Check if dependency is valid before using in may_recompute_p. · 7f056d5f
      Andrew MacLeod authored
      When the IL is rewritten after a statement has been processed and
      dependencies cached, its possible that an ssa-name in the dependency
      cache is no longer in the IL.  Check this before trying to recompute.
      
      	PR tree-optimization/109417
      	gcc/
      	* gimple-range-gori.cc (gori_compute::may_recompute_p): Check if
      	dependency is in SSA_NAME_FREE_LIST.
      
      	gcc/testsuite/
      	* gcc.dg/pr109417.c: New.
      7f056d5f
    • Owen Avery's avatar
      gccrs: Fix issue with parsing unsafe block expression statements · d2a499a9
      Owen Avery authored
      
      gcc/rust/ChangeLog:
      
      	* parse/rust-parse-impl.h
      	(Parser::parse_stmt): Handle unsafe expression statements.
      
      gcc/testsuite/ChangeLog:
      
      	* rust/compile/issue-1422.rs: New test.
      
      Signed-off-by: default avatarOwen Avery <powerboat9.gamer@gmail.com>
      d2a499a9
    • Owen Avery's avatar
      gccrs: Address unsafe with/without block handling ambiguity · 990ae497
      Owen Avery authored
      
      gcc/rust/ChangeLog:
      
      	* parse/rust-parse-impl.h
      	(Parser::parse_expr_stmt): Remove hypothetical unsafe + expr_stmt_without_block handling.
      
      Signed-off-by: default avatarOwen Avery <powerboat9.gamer@gmail.com>
      990ae497
    • M V V S Manoj Kumar's avatar
      gccrs: Added AST Node AST::InlineAsm · f2d6ab83
      M V V S Manoj Kumar authored
      
      Addresses #1567
      Created a AST node InlineAsm similar to the one found in rustc.
      As there is no Symbol struct/class in gccrs I have made every instance
      of Symbol a string.
      
      gcc/rust/ChangeLog:
      
      	* ast/rust-ast-full-decls.h (class InlineAsm):Added class declaration.
      	* ast/rust-expr.h (class InlineAsm):Added class definition.
      
      Signed-off-by: default avatarM V V S Manoj Kumar <mvvsmanojkumar@gmail.com>
      f2d6ab83
    • Arthur Cohen's avatar
      gccrs: diagnostic: Refactor Error class · 2785d591
      Arthur Cohen authored
      The class now allows for more variants including a `Hint` one which
      then gets emitted by calling `rust_inform`. This allows us to display
      hints/tips/notes in backtracking contexts such as the parser.
      
      gcc/rust/ChangeLog:
      
      	* rust-diagnostics.h (struct Error): Add new Kind enum and various new
      	static constructors to allow for hints as well.
      	* rust-diagnostics.cc (Error::Error): Use new `kind` field properly.
      	* checks/errors/privacy/rust-visibility-resolver.cc
      	(VisibilityResolver::resolve_module_path): Use new Error API.
      	* expand/rust-macro-builtins.cc (MacroBuiltin::include_handler): Likewise.
      	* expand/rust-macro-expand.cc (parse_many): Likewise.
      	(transcribe_type): Likewise.
      	* parse/rust-parse-impl.h (Parser::parse_crate): Likewise.
      	* rust-session-manager.cc (Session::handle_crate_name): Likewise.
      	* ast/rust-ast.cc (Module::load_items): Likewise.
      2785d591
    • Arthur Cohen's avatar
      gccrs: ast: Refactor TraitItem to keep Location info · fa7675df
      Arthur Cohen authored
      gcc/rust/ChangeLog:
      
      	* ast/rust-ast.h: Keep location in TraitItem base class
      	* ast/rust-item.h (class TraitItemFunc): Use base class location instead.
      	(class TraitItemMethod): Likewise.
      	(class TraitItemConst): Likewise.
      	(class TraitItemType): Likewise.
      	* ast/rust-macro.h: Likewise.
      fa7675df
    • Philip Herron's avatar
      gccrs: add test case to show our query-type system is working · 3b342e11
      Philip Herron authored
      
      Fixes #1361
      
      Signed-off-by: default avatarPhilip Herron <herron.philip@googlemail.com>
      
      gcc/testsuite/ChangeLog:
      
      	* rust/compile/issue-1361.rs: New test.
      3b342e11
    • SainiAditya1's avatar
      gccrs: rename rust-hir-full-tests.cc · 1a58da7c
      SainiAditya1 authored
      
      gcc/rust/Changelog:
      
      	* hir/tree/rust-hir-full-test.cc: Moved to...
      	* hir/tree/rust-hir.cc: ...here.
      	* Make-lang.in: Rename rust-hir-full-test.
      
      Signed-off-by: default avatarSainiAditya1 <Adityasaini10012001@outlook.com>
      1a58da7c
    • Thomas Schwinge's avatar
      gccrs: Fix up DejaGnu directives in 'rust/compile/issue-1830_{bytes,str}.rs' test cases [#1838] · 0ec543c7
      Thomas Schwinge authored
      'dg-excess-errors' "indicates that the test is expected to fail due to compiler
      messages that are not handled by 'dg-error', [etc.]".  It's argument doesn't
      specify the message to match but just just a comment.  Here, however, we'd like
      to match specific compiler messages, so we should use 'dg-error', etc.  Use the
      magic line number zero as the compiler error diagnostic doesn't tell which line
      the error occurred on (separate issue to resolve).  This gives us:
      
          -XFAIL: rust/compile/issue-1830_str.rs (test for excess errors)
          +PASS: rust/compile/issue-1830_bytes.rs  at line 8 (test for errors, line )
          +PASS: rust/compile/issue-1830_bytes.rs (test for excess errors)
          -XFAIL: rust/compile/issue-1830_bytes.rs (test for excess errors)
          +PASS: rust/compile/issue-1830_str.rs  at line 8 (test for errors, line )
          +PASS: rust/compile/issue-1830_str.rs (test for excess errors)
      
      Fix-up for recent GCC/Rust master branch #1838
      commit cf9ed4001eec6a22686d19a13f7de8ac94f9cb2a
      "testsuite: Add empty string macro test".
      
      	gcc/testsuite/
      	* rust/compile/issue-1830_bytes.rs: Fix up DejaGnu directives.
      	* rust/compile/issue-1830_str.rs: Likewise.
      0ec543c7
    • Owen Avery's avatar
      gccrs: Add AST::AltPattern class · 8628486f
      Owen Avery authored
      
      gcc/rust/ChangeLog:
      
      	* ast/rust-ast-dump.cc
      	(Dump::visit): Add AltPattern visitor.
      	* ast/rust-ast-dump.h:
      	(Dump::visit): Add AltPattern visitor.
      	* ast/rust-ast-full-decls.h
      	(class AltPattern): Add declaration.
      	* ast/rust-ast-visitor.h:
      	(ASTVisitor::visit): Add AltPattern visitor.
      	* ast/rust-ast.cc
      	(AltPattern::as_string): Add definition.
      	(AltPattern::accept_vis): Add definition.
      	* ast/rust-pattern.h
      	(class AltPattern): Add declaration.
      	* checks/errors/rust-feature-gate.h:
      	(FeatureGate::visit) Add AltPattern visitor
      	* expand/rust-attribute-visitor.cc
      	(AttrVisitor::visit): Add AltPattern visitor.
      	* expand/rust-attribute-visitor.h:
      	(AttrVisitor::visit): Add AltPattern visitor.
      	* hir/rust-ast-lower-base.cc
      	(ASTLoweringBase::visit): Add AltPattern visitor.
      	* hir/rust-ast-lower-base.h:
      	(ASTLoweringBase::visit): Add AltPattern visitor.
      	* resolve/rust-ast-resolve-base.cc
      	(ResolverBase::visit): Add AltPattern visitor.
      	* resolve/rust-ast-resolve-base.h:
      	(ResolverBase::visit): Add AltPattern visitor.
      	* resolve/rust-early-name-resolver.cc
      	(EarlyNameResolver::visit): Add AltPattern visitor.
      	* resolve/rust-early-name-resolver.h:
      	(EarlyNameResolver::visit): Add AltPattern visitor.
      	* util/rust-attributes.cc
      	(AttributeChecker::visit): Add AltPattern visitor.
      	* util/rust-attributes.h:
      	(AttributeChecker::visit): Add AltPattern visitor.
      
      Signed-off-by: default avatarOwen Avery <powerboat9.gamer@gmail.com>
      8628486f
    • Owen Avery's avatar
      gccrs: Fix formatting · 6774d569
      Owen Avery authored
      
      gcc/rust/ChangeLog:
      
      	* ast/rust-pattern.h: Fix formatting.
      
      Signed-off-by: default avatarOwen Avery <powerboat9.gamer@gmail.com>
      6774d569
    • Arthur Cohen's avatar
      gccrs: builtins: Return empty list of tokens instead of nullptr · 8b0ed238
      Arthur Cohen authored
      gcc/rust/ChangeLog:
      
      	* expand/rust-macro-builtins.cc (MacroBuiltin::include_handler): Do not
      	return nullptr token in expansion of `include!()`
      
      gcc/testsuite/ChangeLog:
      
      	* rust/compile/empty.in: New test.
      	* rust/compile/include_empty.rs: New test.
      8b0ed238
    • Owen Avery's avatar
      gccrs: Add trailing newline · ecdce2bf
      Owen Avery authored
      
      gcc/rust/ChangeLog:
      
      	* checks/errors/rust-feature-gate.h: Add trailing newline before EOF.
      
      Signed-off-by: default avatarOwen Avery <powerboat9.gamer@gmail.com>
      ecdce2bf
    • Philip Herron's avatar
      gccrs: Fix regression in testcase · a11b44b6
      Philip Herron authored
      
      Fixes #776
      
      Signed-off-by: default avatarPhilip Herron <herron.philip@googlemail.com>
      
      gcc/testsuite/ChangeLog:
      
      	* rust/compile/torture/traits10.rs: Fix test-case
      a11b44b6
    • Philip Herron's avatar
      gccrs: Support for Sized builtin marker trait · 4b25fc15
      Philip Herron authored
      
      When implementing general bounds checking as part of unify calls, we did
      not check associated types on bounds which lead to alot of missed error
      checking. This now recursively checks the bounds and the associated types
      with a decent error message. This also required us to implement the Sized
      marker trait to keep existing test-cases happy.
      
      Fixes #1725
      
      Signed-off-by: default avatarPhilip Herron <herron.philip@googlemail.com>
      
      gcc/rust/ChangeLog:
      
      	* typecheck/rust-hir-trait-reference.cc (TraitReference::clear_associated_types): make const
      	(TraitReference::clear_associated_type_projections): new interface
      	* typecheck/rust-hir-trait-reference.h:
      	* typecheck/rust-hir-trait-resolve.cc (TraitResolver::resolve_trait): refactor
      	(TraitItemReference::associated_type_reset): reset projections
      	* typecheck/rust-hir-type-bounds.h:
      	* typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): fix bounds
      	* typecheck/rust-tyty-bounds.cc (TypeBoundsProbe::TypeBoundsProbe): refactor into cc file
      	(TypeBoundsProbe::Probe): refactor
      	(TypeBoundsProbe::is_bound_satisfied_for_type): likewise
      	(TypeBoundsProbe::assemble_sized_builtin): add builtin for Sized
      	(TypeCheckBase::get_predicate_from_bound): refactor
      	(TypeBoundPredicate::lookup_associated_type): refactor
      	* typecheck/rust-tyty-subst.cc (SubstitutionRef::lookup_associated_impl)
      	(SubstitutionRef::prepare_higher_ranked_bounds): new interface to clear hanging bounds
      	(SubstitutionRef::monomorphize): refactor
      	* typecheck/rust-tyty-subst.h:
      	* typecheck/rust-tyty.cc (BaseType::get_locus): helper
      	(BaseType::satisfies_bound): ensure bounds are satisfied and assoicated types
      	(ParamType::ParamType): new field in constructor
      	(ParamType::clone): update clone
      	(ParamType::set_implicit_self_trait): new interface
      	(ParamType::is_implicit_self_trait): likewise
      	* typecheck/rust-tyty.h: cleanup
      	* util/rust-hir-map.cc (Mappings::Mappings): builtin marker
      	(Mappings::~Mappings): delete marker
      	(Mappings::lookup_builtin_marker): lookup
      	* util/rust-hir-map.h: update header
      
      gcc/testsuite/ChangeLog:
      
      	* rust/compile/issue-1725-1.rs: New test.
      	* rust/compile/issue-1725-2.rs: New test.
      4b25fc15
    • Philip Herron's avatar
      gccrs: Add new virtual function HIR::ImplItem::get_impl_item_name · e90d06c5
      Philip Herron authored
      
      Signed-off-by: default avatarPhilip Herron <herron.philip@googlemail.com>
      
      gcc/rust/ChangeLog:
      
      	* hir/tree/rust-hir-item.h: implement virtual function
      	* hir/tree/rust-hir.h: add virtual function
      e90d06c5
    • Philip Herron's avatar
      gccrs: Extract query_type from TypeCheckBase to be a simple extern · c627781b
      Philip Herron authored
      
      Signed-off-by: default avatarPhilip Herron <herron.philip@googlemail.com>
      
      gcc/rust/ChangeLog:
      
      	* Make-lang.in: add new dependancy
      	* typecheck/rust-hir-type-check-base.cc (TypeCheckBase::query_type): refactor
      	* typecheck/rust-hir-type-check-base.h: refactor
      	* typecheck/rust-hir-type-check.h (RUST_HIR_TYPE_CHECK): refactor
      	* typecheck/rust-type-util.cc: New file.
      	* typecheck/rust-type-util.h: New file.
      c627781b
    • Owen Avery's avatar
      gccrs: Implemented UTF-8 checking for include_str!() · fd406fc7
      Owen Avery authored
      
      gcc/rust/ChangeLog:
      
      	* expand/rust-macro-builtins.cc
      	(MacroBuiltin::include_str_handler): Add check for valid UTF-8.
      
      gcc/testsuite/ChangeLog:
      
      	* rust/compile/builtin_macro_include_str.rs:
      	Include test of invalid UTF-8.
      	* rust/compile/invalid_utf8: File with invalid UTF-8.
      
      Signed-off-by: default avatarOwen Avery <powerboat9.gamer@gmail.com>
      fd406fc7
    • Owen Avery's avatar
      gccrs: Add support for parsing empty tuple patterns. · 20529dff
      Owen Avery authored
      
      gcc/rust/ChangeLog:
      
      	* parse/rust-parse-impl.h
      	(Parser::parse_grouped_or_tuple_pattern): Add support for empty tuple patterns.
      
      gcc/testsuite/ChangeLog:
      
      	* rust/compile/parse_empty_tuple_pattern.rs: New test.
      
      Signed-off-by: default avatarOwen Avery <powerboat9.gamer@gmail.com>
      20529dff
    • Pierre-Emmanuel Patry's avatar
      gccrs: testsuite: Add empty string macro test · 7b00a80c
      Pierre-Emmanuel Patry authored
      
      Add two new tests with empty string for include_str and include_bytes
      macros.
      
      gcc/testsuite/ChangeLog:
      
      	* rust/compile/issue-1830_bytes.rs: New test.
      	* rust/compile/issue-1830_str.rs: New test.
      
      Signed-off-by: default avatarPierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
      7b00a80c
    • Pierre-Emmanuel Patry's avatar
      gccrs: lex: Prevent directories in RAIIFile · b56d093e
      Pierre-Emmanuel Patry authored
      
      RAIIFile constructor was accepting directory filename. This lead to
      unattended directory opening in some part of the code (load_file_bytes)
      wich resulted in ice. Since RAIIFile are used for the lexer, removing
      the ability to open directories with RAIIFile fixes those issues and
      prevent future mistakes.
      
      gcc/rust/ChangeLog:
      
      	* lex/rust-lex.h: Add file type check.
      
      Signed-off-by: default avatarPierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
      b56d093e
    • Owen Avery's avatar
      gccrs: Simplify WildcardPattern let statement handling · e81f5be6
      Owen Avery authored
      
      gcc/rust/ChangeLog:
      
      	* backend/rust-compile-pattern.cc
      	(CompilePatternLet::visit): Simplify WildcardPattern compilation for let statements.
      	* backend/rust-compile-var-decl.h:
      	(CompileVarDecl::visit): Remove variable declaration for WildcardPattern.
      	* resolve/rust-ast-resolve-pattern.h:
      	(PatternDeclaration::visit): Remove name resolution for WildcardPattern.
      
      Signed-off-by: default avatarOwen Avery <powerboat9.gamer@gmail.com>
      e81f5be6
    • Owen Avery's avatar
      gccrs: Add test · 8a9886a8
      Owen Avery authored
      
      gcc/testsuite/ChangeLog:
      
      	* rust/compile/variadic.rs: New test.
      
      Signed-off-by: default avatarOwen Avery <powerboat9.gamer@gmail.com>
      8a9886a8
    • Owen Avery's avatar
      gccrs: Add variadic argument type checking · a9d72ef2
      Owen Avery authored
      
      gcc/rust/ChangeLog:
      
      	* typecheck/rust-tyty-call.cc
      	(TypeCheckCallExpr::visit): Add variadic argument type checking.
      	(TypeCheckCallExpr::visit): Fix comment spelling ("varadic").
      
      gcc/testsuite/ChangeLog:
      
      	* rust/execute/torture/overflow1.rs: Fix test.
      
      Signed-off-by: default avatarOwen Avery <powerboat9.gamer@gmail.com>
      a9d72ef2
    • mxlol233's avatar
      gccrs: Add feature gate for "rust-intrinsic". · fd5eb9f2
      mxlol233 authored
      
      This commit implemented a feature gate to check `intrinsics`.
      
      gcc/rust/ChangeLog:
      
      	* checks/errors/rust-feature-gate.cc: Add implementation for
      	`void FeatureGate::visit (AST::ExternBlock &block)`. Add `valid_feature`
      	construction process in `FeatureGate::check`.
      	* checks/errors/rust-feature-gate.h: Add declaration for
      	`void FeatureGate::visit (AST::ExternBlock &block)`. Add private
      	variable `valid_feature`.
      	* checks/errors/rust-feature.h: Change `issue` to `m_issue`.
      
      gcc/testsuite/ChangeLog:
      
      	* rust/compile/const-issue1440.rs: Add crate feature: `intrinsics`.
      	* rust/compile/feature_intrinsics.rs: New file.
      	* rust/compile/issue-1031.rs: Add crate feature: `intrinsics`.
      	* rust/compile/issue-1130.rs: Add crate feature: `intrinsics`.
      	* rust/compile/issue-1131.rs: Add crate feature: `intrinsics`.
      	* rust/compile/issue-1237.rs: Add crate feature: `intrinsics`.
      	* rust/compile/issue-1289.rs: Add crate feature: `intrinsics`.
      	* rust/compile/rust-const-blog-issue.rs: Add crate feature: `intrinsics`.
      	* rust/compile/torture/intrinsics-3.rs: Add crate feature: `intrinsics`.
      	* rust/compile/torture/intrinsics-4.rs: Add crate feature: `intrinsics`.
      	* rust/compile/torture/intrinsics-5.rs: Add crate feature: `intrinsics`.
      	* rust/compile/torture/intrinsics-6.rs: Add crate feature: `intrinsics`.
      	* rust/compile/torture/intrinsics-7.rs: Add crate feature: `intrinsics`.
      	* rust/compile/torture/issue-1024.rs: Add crate feature: `intrinsics`.
      	* rust/compile/torture/issue-1075.rs: Add crate feature: `intrinsics`.
      	* rust/compile/torture/issue-1432.rs: Add crate feature: `intrinsics`.
      	* rust/compile/unsafe10.rs: Add crate feature: `intrinsics`.
      	* rust/execute/torture/atomic_load.rs: Add crate feature: `intrinsics`.
      	* rust/execute/torture/atomic_store.rs: Add crate feature: `intrinsics`.
      	* rust/execute/torture/copy_nonoverlapping1.rs: Add crate feature:
      	`intrinsics`.
      	* rust/execute/torture/issue-1120.rs: Add crate feature: `intrinsics`.
      	* rust/execute/torture/issue-1133.rs: Add crate feature: `intrinsics`.
      	* rust/execute/torture/issue-1232.rs: Add crate feature: `intrinsics`.
      	* rust/execute/torture/slice-magic.rs: Add crate feature: `intrinsics`.
      	* rust/execute/torture/slice-magic2.rs: Add crate feature: `intrinsics`.
      	* rust/execute/torture/str-layout1.rs: Add crate feature: `intrinsics`.
      	* rust/execute/torture/transmute1.rs: Add crate feature: `intrinsics`.
      	* rust/execute/torture/wrapping_op1.rs: Add crate feature: `intrinsics`.
      	* rust/execute/torture/wrapping_op2.rs: Add crate feature: `intrinsics`.
      
      Signed-off-by: default avatarXiao Ma <mxlol233@outlook.com>
      fd5eb9f2
    • Thomas Schwinge's avatar
      gccrs: Update copyright years. · b4229fb0
      Thomas Schwinge authored
      gcc/rust/ChangeLog:
      
      	* ast/rust-ast-fragment.cc: Update copyright years.
      	* ast/rust-ast-fragment.h: Likewise.
      	* ast/rust-macro.cc: Likewise.
      	* checks/errors/rust-feature-gate.cc: Likewise.
      	* checks/errors/rust-feature-gate.h: Likewise.
      	* checks/errors/rust-feature.cc: Likewise.
      	* checks/errors/rust-feature.h: Likewise.
      	* hir/rust-ast-lower-expr.cc: Likewise.
      	* hir/rust-ast-lower-type.cc: Likewise.
      	* resolve/rust-early-name-resolver.cc: Likewise.
      	* resolve/rust-early-name-resolver.h: Likewise.
      	* rust-gcc.h: Likewise.
      	* typecheck/rust-hir-path-probe.cc: Likewise.
      	* typecheck/rust-hir-trait-reference.cc: Likewise.
      	* typecheck/rust-tyty-bounds.h: Likewise.
      	* typecheck/rust-tyty-subst.cc: Likewise.
      	* typecheck/rust-tyty-subst.h: Likewise.
      	* typecheck/rust-tyty-util.cc: Likewise.
      	* typecheck/rust-tyty-util.h: Likewise.
      	* typecheck/rust-unify.cc: Likewise.
      	* typecheck/rust-unify.h: Likewise.
      	* util/rust-inline-visitor.h: Likewise.
      b4229fb0
Loading