]> git.ipfire.org Git - thirdparty/gcc.git/commit
gccrs: Fix duplicated function generation on higher ranked trait bounds
authorPhilip Herron <philip.herron@embecosm.com>
Tue, 27 Sep 2022 11:19:43 +0000 (12:19 +0100)
committerArthur Cohen <arthur.cohen@embecosm.com>
Tue, 31 Jan 2023 13:16:52 +0000 (14:16 +0100)
commit11a37f8950405c15409f57e9684157a267f5948f
tree3727b0b100a823ac9be2444e1069ae299ca043d0
parent9c60f0e1e5cd5a60d5a057193611aa0c38894cc7
gccrs: Fix duplicated function generation on higher ranked trait bounds

Deuplicate function elimination can fail when we compile helpers during
higher ranked trait bound monomorphization. This because the
TyTy::BaseType info can be lost/reset during the compilation process. This
adds a second mechanism to match based on the manged names which is a bit
more reliable. This patch is required since the query based refactor of
the type system so this issue was likely hidden to to using duplicated type
info for higher ranked trait bounds.

gcc/rust/ChangeLog:

* backend/rust-compile-context.h: Add new optional `asm_name` string
argument to `lookup_function_decl`.
* backend/rust-compile-item.cc (CompileItem::visit): Compute assembly
name and pass it to `lookup_function_decl` when calling it.
gcc/rust/backend/rust-compile-context.h
gcc/rust/backend/rust-compile-item.cc