public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/95210] New: internal compiler error: in prepare_copy_insn, at gcse.c:1988
@ 2020-05-19 14:01 zhongyunde at tom dot com
  2020-05-19 14:49 ` [Bug c/95210] " zhongyunde at tom dot com
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: zhongyunde at tom dot com @ 2020-05-19 14:01 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 95210
           Summary: internal compiler error: in prepare_copy_insn, at
                    gcse.c:1988
           Product: gcc
           Version: 9.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: zhongyunde at tom dot com
  Target Milestone: ---

rtx_insn *
prepare_copy_insn (rtx reg, rtx exp)
{
  ... 
  else
    {
      rtx_insn *insn = emit_insn (gen_rtx_SET (reg, exp));

      if (insn_invalid_p (insn, false))
        gcc_unreachable ();  // here is the ICE ...
    }

  pat = get_insns ();
  end_sequence ();  

  return pat;
}

As the function can_assign_to_reg_without_clobbers_p, we try to check an
temporary insn with regno 'FIRST_PSEUDO_REGISTER * 2'. So in some corner case,
such as a pattern with inout operand, the regno 'FIRST_PSEUDO_REGISTER * 2' is
just equal to the the regno in the REG_EQUAL (FIRST_PSEUDO_REGISTER = 117),
then the temporary insn is valid, but it come fail when alloc another regno for
it, here is this issue.

(set (reg/v:V8HF16 236 )
  (unspec: V8HF18 [ (reg: V8HF18 150)
                    (reg: V8HF18 236)] UNSPEC_MOVTVFM)) 
   (expr_list:REG_EQUAL (unspec: V8HF18 [ (reg: V8HF18 150)
                                          (reg: V8HF18 234)] UNSPEC_MOVTVFM ))

bool
can_assign_to_reg_without_clobbers_p (rtx x, machine_mode mode)
{
  .... 

  /* Otherwise, check if we can make a valid insn from it.  First initialize
     our test insn if we haven't already.  */
  if (test_insn == 0)
    {
      test_insn
        = make_insn_raw (gen_rtx_SET (gen_rtx_REG (word_mode,
                                                   FIRST_PSEUDO_REGISTER * 2),
                                      const0_rtx));
      SET_NEXT_INSN (test_insn) = SET_PREV_INSN (test_insn) = 0;
      INSN_LOCATION (test_insn) = UNKNOWN_LOCATION;
    }

  /* Now make an insn like the one we would make when GCSE'ing and see if
     valid.  */
  PUT_MODE (SET_DEST (PATTERN (test_insn)), mode);
  SET_SRC (PATTERN (test_insn)) = x;

  icode = recog (PATTERN (test_insn), test_insn, &num_clobbers);

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug c/95210] internal compiler error: in prepare_copy_insn, at gcse.c:1988
  2020-05-19 14:01 [Bug c/95210] New: internal compiler error: in prepare_copy_insn, at gcse.c:1988 zhongyunde at tom dot com
@ 2020-05-19 14:49 ` zhongyunde at tom dot com
  2020-05-19 17:15 ` [Bug rtl-optimization/95210] " rguenth at gcc dot gnu.org
  2020-05-22  6:12 ` zhongyunde at tom dot com
  2 siblings, 0 replies; 4+ messages in thread
From: zhongyunde at tom dot com @ 2020-05-19 14:49 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from zhongyunde at tom dot com <zhongyunde at tom dot com> ---
patch for this issue.

@ linux-9z2e in ~/software/gcc/gcc on git:master o [23:02:26] 
$ git diff
diff --git a/gcc/gcse.c b/gcc/gcse.c
index 8b9518e..65982ec 100644
--- a/gcc/gcse.c
+++ b/gcc/gcse.c
@@ -853,7 +853,7 @@ can_assign_to_reg_without_clobbers_p (rtx x, machine_mode
mode)
     {
       test_insn
        = make_insn_raw (gen_rtx_SET (gen_rtx_REG (word_mode,
-                                              FIRST_PSEUDO_REGISTER * 2),
+                                              max_regno + 1),
                                      const0_rtx));

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug rtl-optimization/95210] internal compiler error: in prepare_copy_insn, at gcse.c:1988
  2020-05-19 14:01 [Bug c/95210] New: internal compiler error: in prepare_copy_insn, at gcse.c:1988 zhongyunde at tom dot com
  2020-05-19 14:49 ` [Bug c/95210] " zhongyunde at tom dot com
@ 2020-05-19 17:15 ` rguenth at gcc dot gnu.org
  2020-05-22  6:12 ` zhongyunde at tom dot com
  2 siblings, 0 replies; 4+ messages in thread
From: rguenth at gcc dot gnu.org @ 2020-05-19 17:15 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
testcase?

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug rtl-optimization/95210] internal compiler error: in prepare_copy_insn, at gcse.c:1988
  2020-05-19 14:01 [Bug c/95210] New: internal compiler error: in prepare_copy_insn, at gcse.c:1988 zhongyunde at tom dot com
  2020-05-19 14:49 ` [Bug c/95210] " zhongyunde at tom dot com
  2020-05-19 17:15 ` [Bug rtl-optimization/95210] " rguenth at gcc dot gnu.org
@ 2020-05-22  6:12 ` zhongyunde at tom dot com
  2 siblings, 0 replies; 4+ messages in thread
From: zhongyunde at tom dot com @ 2020-05-22  6:12 UTC (permalink / raw)
  To: gcc-bugs

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

zhongyunde at tom dot com <zhongyunde at tom dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |DUPLICATE

--- Comment #3 from zhongyunde at tom dot com <zhongyunde at tom dot com> ---
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95267

*** This bug has been marked as a duplicate of bug 95267 ***

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-05-22  6:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-19 14:01 [Bug c/95210] New: internal compiler error: in prepare_copy_insn, at gcse.c:1988 zhongyunde at tom dot com
2020-05-19 14:49 ` [Bug c/95210] " zhongyunde at tom dot com
2020-05-19 17:15 ` [Bug rtl-optimization/95210] " rguenth at gcc dot gnu.org
2020-05-22  6:12 ` zhongyunde at tom dot com

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).