aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust
diff options
context:
space:
mode:
authorPhilip Herron <herron.philip@googlemail.com>2023-04-20 12:33:55 +0100
committerArthur Cohen <arthur.cohen@embecosm.com>2024-01-16 18:34:13 +0100
commit91a86375d9869c8652734ce28dd30c2cdb21656e (patch)
tree19657a6b8b14f656a4995851a7490f1df8722486 /gcc/rust
parent50c549ef3db6276a6a89bead477bea5f74f07adc (diff)
downloadgcc-91a86375d9869c8652734ce28dd30c2cdb21656e.zip
gcc-91a86375d9869c8652734ce28dd30c2cdb21656e.tar.gz
gcc-91a86375d9869c8652734ce28dd30c2cdb21656e.tar.bz2
gccrs: fix ICE with recursive function calls
Fixes #2136 gcc/rust/ChangeLog: * backend/rust-compile-item.cc (CompileItem::visit): remove bad checks gcc/testsuite/ChangeLog: * rust/compile/issue-2136-1.rs: New test. * rust/compile/issue-2136-2.rs: New test. Signed-off-by: Philip Herron <herron.philip@googlemail.com>
Diffstat (limited to 'gcc/rust')
-rw-r--r--gcc/rust/backend/rust-compile-item.cc14
1 files changed, 2 insertions, 12 deletions
diff --git a/gcc/rust/backend/rust-compile-item.cc b/gcc/rust/backend/rust-compile-item.cc
index 4b37b15..d953e4b 100644
--- a/gcc/rust/backend/rust-compile-item.cc
+++ b/gcc/rust/backend/rust-compile-item.cc
@@ -147,18 +147,8 @@ CompileItem::visit (HIR::Function &function)
if (ctx->lookup_function_decl (fntype->get_ty_ref (), &lookup,
fntype->get_id (), fntype, asm_name))
{
- // has this been added to the list then it must be finished
- if (ctx->function_completed (lookup))
- {
- tree dummy = NULL_TREE;
- if (!ctx->lookup_function_decl (fntype->get_ty_ref (), &dummy))
- {
- ctx->insert_function_decl (fntype, lookup);
- }
-
- reference = address_expression (lookup, ref_locus);
- return;
- }
+ reference = address_expression (lookup, ref_locus);
+ return;
}
if (fntype->has_subsititions_defined ())