public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "jakub at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/105554] [10/11/12/13 Regression] ICE: in emit_block_move_hints, at expr.cc:1829 since r9-5509-g5928bc2ec06dd4e7
Date: Thu, 16 Mar 2023 18:47:07 +0000	[thread overview]
Message-ID: <bug-105554-4-SOZjvR3UUC@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-105554-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #14 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
So, I have tried
--- gcc/cgraphclones.cc.jj      2023-02-24 11:05:19.704595633 +0100
+++ gcc/cgraphclones.cc 2023-03-16 19:12:30.452503051 +0100
@@ -1094,6 +1094,15 @@ cgraph_node::create_version_clone_with_b
       || in_lto_p)
     new_version_node->unique_name = true;

+  if (target_attributes)
+    {
+      push_cfun (DECL_STRUCT_FUNCTION (new_decl));
+      for (tree arg = DECL_ARGUMENTS (new_decl); arg; arg = DECL_CHAIN (arg))
+       if (VECTOR_TYPE_P (TREE_TYPE (arg)))
+         SET_DECL_MODE (arg, TYPE_MODE (TREE_TYPE (arg)));
+      pop_cfun ();
+    }
+
   /* Update the call_expr on the edges to call the new version node. */
   update_call_expr (new_version_node);

but that really didn't help, the problem seems to be actually different.

From what I can see, tree_function_versioning does:
6240      DECL_RESULT (new_decl) = DECL_RESULT (old_decl);
6241      DECL_ARGUMENTS (new_decl) = DECL_ARGUMENTS (old_decl);
6242      initialize_cfun (new_decl, old_decl,
6243                       new_entry ? new_entry->count :
old_entry_block->count);
and initialize_cfun will call allocate_function, which does:
4845              /* Now that we have activated any function-specific
attributes
4846                 that might affect layout, particularly vector modes,
relayout
4847                 each of the parameters and the result.  */
4848              relayout_decl (result);
4849              for (tree parm = DECL_ARGUMENTS (fndecl); parm;
4850                   parm = DECL_CHAIN (parm))
4851                relayout_decl (parm);
So, we temporarily set DECL_ARGUMENTS and DECL_RESULT of new_decl to
arguments/result of old_decl and allocate_function called relayout_decl on
those, later on we create new arguments (which supposedly have correct
DECL_MODE).  But we've changed the old DECL_RESULT/DECL_ARGUMENTS.

  parent reply	other threads:[~2023-03-16 18:47 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-10 20:03 [Bug c/105554] New: ICE: in emit_block_move_hints, at expr.cc:1829 zhenyang.xu at uwaterloo dot ca
2022-05-11  7:33 ` [Bug target/105554] " marxin at gcc dot gnu.org
2022-05-11  7:42 ` rguenth at gcc dot gnu.org
2022-05-11  7:47 ` [Bug target/105554] [9/10/11/12/13 Regression] ICE: in emit_block_move_hints, at expr.cc:1829 since r9-5509-g5928bc2ec06dd4e7 marxin at gcc dot gnu.org
2022-05-11  7:49 ` jakub at gcc dot gnu.org
2022-05-27  9:48 ` [Bug target/105554] [10/11/12/13 " rguenth at gcc dot gnu.org
2022-06-28 10:49 ` jakub at gcc dot gnu.org
2022-07-26 11:28 ` rguenth at gcc dot gnu.org
2023-01-11 12:27 ` marxin at gcc dot gnu.org
2023-01-11 13:01 ` rguenth at gcc dot gnu.org
2023-01-11 13:03 ` rguenth at gcc dot gnu.org
2023-01-16 12:53 ` marxin at gcc dot gnu.org
2023-01-16 13:01 ` rguenther at suse dot de
2023-02-09 11:51 ` marxin at gcc dot gnu.org
2023-02-09 12:52 ` rguenth at gcc dot gnu.org
2023-03-16 14:04 ` marxin at gcc dot gnu.org
2023-03-16 18:07 ` jakub at gcc dot gnu.org
2023-03-16 18:47 ` jakub at gcc dot gnu.org [this message]
2023-03-16 18:55 ` jakub at gcc dot gnu.org
2023-03-17  8:59 ` rguenth at gcc dot gnu.org
2023-03-17  9:24 ` jakub at gcc dot gnu.org
2023-03-17  9:28 ` jakub at gcc dot gnu.org
2023-03-17  9:31 ` rguenth at gcc dot gnu.org
2023-03-17 10:02 ` jakub at gcc dot gnu.org
2023-03-17 18:00 ` cvs-commit at gcc dot gnu.org
2023-03-17 18:06 ` [Bug target/105554] [10/11/12 " jakub at gcc dot gnu.org
2023-03-19  5:31 ` cvs-commit at gcc dot gnu.org
2023-03-20 10:29 ` [Bug target/105554] [10/11 " jakub at gcc dot gnu.org
2023-05-02 20:16 ` cvs-commit at gcc dot gnu.org
2023-05-03  9:25 ` [Bug target/105554] [10 " jakub at gcc dot gnu.org
2023-05-03 15:22 ` cvs-commit at gcc dot gnu.org
2023-05-04  7:16 ` jakub at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-105554-4-SOZjvR3UUC@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).