Summary: | [12/13 Regression] d: undefined reference to pragma(inline) symbol | ||
---|---|---|---|
Product: | gcc | Reporter: | Iain Buclaw <ibuclaw> |
Component: | d | Assignee: | Iain Buclaw <ibuclaw> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | P4 | ||
Version: | 12.0 | ||
Target Milestone: | 12.2 | ||
Host: | Target: | ||
Build: | Known to work: | 11.1.0 | |
Known to fail: | 12.1.0 | Last reconfirmed: |
Description
Iain Buclaw
2022-08-08 19:43:42 UTC
Well, not really a regression, but it rears its ugly head in gdc-12 because nextPow2() now gets instantiated in the `test' module, whereas previously it didn't. The master branch has been updated by Iain Buclaw <ibuclaw@gcc.gnu.org>: https://gcc.gnu.org/g:04284176d549ff2565406406a6d53ab4ba8e507d commit r13-2002-g04284176d549ff2565406406a6d53ab4ba8e507d Author: Iain Buclaw <ibuclaw@gdcproject.org> Date: Tue Aug 9 12:48:14 2022 +0200 d: Fix undefined reference to pragma(inline) symbol (PR106563) Functions that are declared `pragma(inline)' should be treated as if they are defined in every translation unit they are referenced from, regardless of visibility protection. Ensure they always get DECL_ONE_ONLY linkage, and start emitting them into other modules that import them. PR d/106563 gcc/d/ChangeLog: * decl.cc (DeclVisitor::visit (FuncDeclaration *)): Set semanticRun before generating its symbol. (function_defined_in_root_p): New function. (function_needs_inline_definition_p): New function. (maybe_build_decl_tree): New function. (get_symbol_decl): Call maybe_build_decl_tree before returning symbol. (start_function): Use function_defined_in_root_p instead of inline test for locally defined symbols. (set_linkage_for_decl): Check for inline functions before private or protected symbols. gcc/testsuite/ChangeLog: * gdc.dg/torture/torture.exp (srcdir): New proc. * gdc.dg/torture/imports/pr106563math.d: New test. * gdc.dg/torture/imports/pr106563regex.d: New test. * gdc.dg/torture/imports/pr106563uni.d: New test. * gdc.dg/torture/pr106563.d: New test. The releases/gcc-12 branch has been updated by Iain Buclaw <ibuclaw@gcc.gnu.org>: https://gcc.gnu.org/g:79a86a608691621659b3ce3a24a72aeea4054668 commit r12-8673-g79a86a608691621659b3ce3a24a72aeea4054668 Author: Iain Buclaw <ibuclaw@gdcproject.org> Date: Tue Aug 9 12:48:14 2022 +0200 d: Fix undefined reference to pragma(inline) symbol (PR106563) Functions that are declared `pragma(inline)' should be treated as if they are defined in every translation unit they are referenced from, regardless of visibility protection. Ensure they always get DECL_ONE_ONLY linkage, and start emitting them into other modules that import them. PR d/106563 gcc/d/ChangeLog: * decl.cc (DeclVisitor::visit (FuncDeclaration *)): Set semanticRun before generating its symbol. (function_defined_in_root_p): New function. (function_needs_inline_definition_p): New function. (maybe_build_decl_tree): New function. (get_symbol_decl): Call maybe_build_decl_tree before returning symbol. (start_function): Use function_defined_in_root_p instead of inline test for locally defined symbols. (set_linkage_for_decl): Check for inline functions before private or protected symbols. gcc/testsuite/ChangeLog: * gdc.dg/torture/torture.exp (srcdir): New proc. * gdc.dg/torture/imports/pr106563math.d: New test. * gdc.dg/torture/imports/pr106563regex.d: New test. * gdc.dg/torture/imports/pr106563uni.d: New test. * gdc.dg/torture/pr106563.d: New test. (cherry picked from commit 04284176d549ff2565406406a6d53ab4ba8e507d) Fix committed. |