[Bug middle-end/99525] wrong location of implicitly generated assignment to polymorphic class

msebor at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Mar 10 21:26:55 GMT 2021


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99525

--- Comment #1 from Martin Sebor <msebor at gcc dot gnu.org> ---
The (otherwise untested) change below corrects the location:

diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c
index 1dcb31c0267..c77745b788d 100644
--- a/gcc/tree-inline.c
+++ b/gcc/tree-inline.c
@@ -4938,7 +4938,7 @@ expand_call_inline (basic_block bb, gimple *stmt,
copy_body_data *id,
   /* Record the function we are about to inline.  */
   id->src_fn = fn;
   id->src_cfun = DECL_STRUCT_FUNCTION (fn);
-  id->reset_location = DECL_IGNORED_P (fn);
+  id->reset_location = DECL_IGNORED_P (fn) || DECL_ARTIFICIAL (fn);
   id->call_stmt = call_stmt;

   /* When inlining into an OpenMP SIMD-on-SIMT loop, arrange for new automatic


More information about the Gcc-bugs mailing list