public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/97954] New: [11 Regression] ICE in maybe_record_trace_start, at dwarf2cfi.c:2360
@ 2020-11-23 16:31 gscfq@t-online.de
  2020-11-23 18:31 ` [Bug c/97954] " marxin at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: gscfq@t-online.de @ 2020-11-23 16:31 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 97954
           Summary: [11 Regression] ICE in maybe_record_trace_start, at
                    dwarf2cfi.c:2360
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gscfq@t-online.de
  Target Milestone: ---

Changed between 20201108 and 20201115 :


$ cat z1.c
int
foo (void)
{
  int x;
 lab:
  asm goto ("": "=a" (x) : : : lab);
  return x;
}


$ gcc-11-20201122 -c z1.c -O2
during RTL pass: dwarf2
z1.c: In function 'foo':
z1.c:8:1: internal compiler error: in maybe_record_trace_start, at
dwarf2cfi.c:2360
    8 | }
      | ^
0x7c9c43 maybe_record_trace_start
        ../../gcc/dwarf2cfi.c:2360
0x7ca18a create_trace_edges
        ../../gcc/dwarf2cfi.c:2501
0x7cc163 scan_trace
        ../../gcc/dwarf2cfi.c:2732
0x7cca31 create_cfi_notes
        ../../gcc/dwarf2cfi.c:2758
0x7cca31 execute_dwarf2_frame
        ../../gcc/dwarf2cfi.c:3122
0x7cca31 execute
        ../../gcc/dwarf2cfi.c:3610

---

z1.c: In function 'foo':
z1.c:8:1: error: too many outgoing branch edges from bb 4
    8 | }
      | ^
during RTL pass: loop2_invariant
z1.c:8:1: internal compiler error: verify_flow_info failed
0x814164 verify_flow_info()
        ../../gcc/cfghooks.c:269
0xb3c87b checking_verify_flow_info
        ../../gcc/cfghooks.h:212
0xb3c87b move_loop_invariants()
        ../../gcc/loop-invariant.c:2304
0xb384f0 execute
        ../../gcc/loop-init.c:530

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

* [Bug c/97954] [11 Regression] ICE in maybe_record_trace_start, at dwarf2cfi.c:2360
  2020-11-23 16:31 [Bug c/97954] New: [11 Regression] ICE in maybe_record_trace_start, at dwarf2cfi.c:2360 gscfq@t-online.de
@ 2020-11-23 18:31 ` marxin at gcc dot gnu.org
  2020-11-24  8:15 ` [Bug rtl-optimization/97954] " rguenth at gcc dot gnu.org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: marxin at gcc dot gnu.org @ 2020-11-23 18:31 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |11.0
      Known to fail|                            |11.0
   Last reconfirmed|                            |2020-11-23
     Ever confirmed|0                           |1
      Known to work|                            |10.2.0
                 CC|                            |marxin at gcc dot gnu.org,
                   |                            |vmakarov at gcc dot gnu.org
             Status|UNCONFIRMED                 |NEW

--- Comment #1 from Martin Liška <marxin at gcc dot gnu.org> ---
Started with r11-5002-ge3b3b59683c1e7d3.

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

* [Bug rtl-optimization/97954] [11 Regression] ICE in maybe_record_trace_start, at dwarf2cfi.c:2360
  2020-11-23 16:31 [Bug c/97954] New: [11 Regression] ICE in maybe_record_trace_start, at dwarf2cfi.c:2360 gscfq@t-online.de
  2020-11-23 18:31 ` [Bug c/97954] " marxin at gcc dot gnu.org
@ 2020-11-24  8:15 ` rguenth at gcc dot gnu.org
  2020-11-25 19:33 ` vmakarov at gcc dot gnu.org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu.org @ 2020-11-24  8:15 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P1
          Component|c                           |rtl-optimization

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

* [Bug rtl-optimization/97954] [11 Regression] ICE in maybe_record_trace_start, at dwarf2cfi.c:2360
  2020-11-23 16:31 [Bug c/97954] New: [11 Regression] ICE in maybe_record_trace_start, at dwarf2cfi.c:2360 gscfq@t-online.de
  2020-11-23 18:31 ` [Bug c/97954] " marxin at gcc dot gnu.org
  2020-11-24  8:15 ` [Bug rtl-optimization/97954] " rguenth at gcc dot gnu.org
@ 2020-11-25 19:33 ` vmakarov at gcc dot gnu.org
  2020-11-30  9:47 ` jakub at gcc dot gnu.org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: vmakarov at gcc dot gnu.org @ 2020-11-25 19:33 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Vladimir Makarov <vmakarov at gcc dot gnu.org> ---
(In reply to Martin Liška from comment #1)
> Started with r11-5002-ge3b3b59683c1e7d3.

Before the patch, gcc just reported an error.  Now it is a crash.

The problem is not the patch itself but in the loop invariant motion.

For some reason, loop invariant motion optimization moves asm goto insn out of
the loop as the invariant insn.  asm goto is a branch.  When we move branch as
a regular insn, we have what we have.  Here is loop2_invariant dump:

...
(jump_insn 8 6 11 4 (parallel [
            (set (reg:SI 83 [ x ])
                (asm_operands:SI ("") ("=a") 0 []
                     []
                     [
                        (label_ref:DI 21)
                    ] z1.c:6))
            (clobber (reg:CC 17 flags))
        ]) "z1.c":6:3 -1
     (expr_list:REG_UNUSED (reg:CC 17 flags)
        (nil))
 -> 21)

...

*****ending processing of loop 1 ******
Set in insn 8 is invariant (0), cost 4, depends on
Decided to move invariant 0 -- gain 4
Invariant 0 moved without introducing a new temporary register
changing bb of uid 8
  from 4 to 2
starting the processing of deferred insns
ending the processing of deferred insns


I think a maintainer of loop optimizations should look at this.

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

* [Bug rtl-optimization/97954] [11 Regression] ICE in maybe_record_trace_start, at dwarf2cfi.c:2360
  2020-11-23 16:31 [Bug c/97954] New: [11 Regression] ICE in maybe_record_trace_start, at dwarf2cfi.c:2360 gscfq@t-online.de
                   ` (2 preceding siblings ...)
  2020-11-25 19:33 ` vmakarov at gcc dot gnu.org
@ 2020-11-30  9:47 ` jakub at gcc dot gnu.org
  2020-12-01 15:24 ` cvs-commit at gcc dot gnu.org
  2020-12-01 15:26 ` jakub at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: jakub at gcc dot gnu.org @ 2020-11-30  9:47 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|unassigned at gcc dot gnu.org      |jakub at gcc dot gnu.org
             Status|NEW                         |ASSIGNED

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Created attachment 49649
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=49649&action=edit
gcc11-pr97954.patch

Untested fix.  Normal jumps including conditional jumps are ignored by the
routine, because they have as SET_DEST (pc) and (pc) has VOIDmode.
Similarly, asm goto with multiple outputs is ok, as it will fail the single_set
check.

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

* [Bug rtl-optimization/97954] [11 Regression] ICE in maybe_record_trace_start, at dwarf2cfi.c:2360
  2020-11-23 16:31 [Bug c/97954] New: [11 Regression] ICE in maybe_record_trace_start, at dwarf2cfi.c:2360 gscfq@t-online.de
                   ` (3 preceding siblings ...)
  2020-11-30  9:47 ` jakub at gcc dot gnu.org
@ 2020-12-01 15:24 ` cvs-commit at gcc dot gnu.org
  2020-12-01 15:26 ` jakub at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-12-01 15:24 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jakub Jelinek <jakub@gcc.gnu.org>:

https://gcc.gnu.org/g:404d0ca7820bbf258e2edfac423403ee31b48a7b

commit r11-5613-g404d0ca7820bbf258e2edfac423403ee31b48a7b
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Tue Dec 1 16:23:59 2020 +0100

    loop-invariant: JUMP_INSNs aren't loop invariant [PR97954]

    The following testcase ICEs because loop invariant motion moves asm goto
    with a single output as invariant.
    Normally, jumps aren't really moved, because if they are single set,
    they have their SET_DEST (pc) and pc_rtx has VOIDmode on which one of the
    functions find_invariant_insn calls bails out.  The code already punts on
    insns that can throw or trap.  And for asm goto without outputs, it isn't
    single set, or asm goto with two or more outputs it isn't single set
either.

    2020-12-01  Jakub Jelinek  <jakub@redhat.com>

            PR rtl-optimization/97954
            * loop-invariant.c (find_invariant_insn): Punt on JUMP_P insns.

            * gcc.dg/pr97954.c: New test.

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

* [Bug rtl-optimization/97954] [11 Regression] ICE in maybe_record_trace_start, at dwarf2cfi.c:2360
  2020-11-23 16:31 [Bug c/97954] New: [11 Regression] ICE in maybe_record_trace_start, at dwarf2cfi.c:2360 gscfq@t-online.de
                   ` (4 preceding siblings ...)
  2020-12-01 15:24 ` cvs-commit at gcc dot gnu.org
@ 2020-12-01 15:26 ` jakub at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: jakub at gcc dot gnu.org @ 2020-12-01 15:26 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED

--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Fixed.

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

end of thread, other threads:[~2020-12-01 15:26 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-23 16:31 [Bug c/97954] New: [11 Regression] ICE in maybe_record_trace_start, at dwarf2cfi.c:2360 gscfq@t-online.de
2020-11-23 18:31 ` [Bug c/97954] " marxin at gcc dot gnu.org
2020-11-24  8:15 ` [Bug rtl-optimization/97954] " rguenth at gcc dot gnu.org
2020-11-25 19:33 ` vmakarov at gcc dot gnu.org
2020-11-30  9:47 ` jakub at gcc dot gnu.org
2020-12-01 15:24 ` cvs-commit at gcc dot gnu.org
2020-12-01 15:26 ` jakub at gcc dot gnu.org

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