public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/113217] New: [14 Regression][aarch64] ICE in rtl_verify_bb_insns, at cfgrtl.cc:2796 since r14-6605-gc0911c6b357ba9
@ 2024-01-03 15:29 mjires at suse dot cz
  2024-01-03 17:21 ` [Bug target/113217] " pinskia at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: mjires at suse dot cz @ 2024-01-03 15:29 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 113217
           Summary: [14 Regression][aarch64] ICE in rtl_verify_bb_insns,
                    at cfgrtl.cc:2796 since r14-6605-gc0911c6b357ba9
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: mjires at suse dot cz
                CC: acoplan at gcc dot gnu.org
  Target Milestone: ---
            Target: aarch64

Compiling reduced testcase g++.dg/vect/pr45470-b.cc results in ICE since
r14-6605-gc0911c6b357ba9.

$ cat pr45470-b.cc
struct _Vector_base {
  int _M_end_of_storage;
};
struct vector : _Vector_base {
  vector() : _Vector_base() {}
  ~vector();
};
struct LoadGraph {
  LoadGraph();
  vector colors;
  vector data_block;
};
LoadGraph::LoadGraph() {}


$ aarch64-linux-gnu-g++ pr45470-b.cc -fnon-call-exceptions
-fvar-tracking-assignments-toggle -Ofast
pr45470-b.cc: In constructor ‘LoadGraph::LoadGraph()’:
pr45470-b.cc:13:25: error: in basic block 2:
   13 | LoadGraph::LoadGraph() {}
      |                         ^
pr45470-b.cc:13:25: error: flow control insn inside a basic block
(insn 7 6 8 2 (set (mem:V2x4QI (reg/f:DI 103 [ this ]) [0 +0 S8 A32])
        (unspec:V2x4QI [
                (const_int 0 [0]) repeated x2
            ] UNSPEC_STP)) "pr45470-b.cc":5:27 90 {*store_pair_4}
     (expr_list:REG_EH_REGION (const_int 1 [0x1])
        (nil)))
during RTL pass: ldp_fusion
pr45470-b.cc:13:25: internal compiler error: in rtl_verify_bb_insns, at
cfgrtl.cc:2802
0x1b09b2e _fatal_insn(char const*, rtx_def const*, char const*, int, char
const*)
        /home/mjires/git/GCC/master/gcc/rtl-error.cc:108
0x148d06f rtl_verify_bb_insns
        /home/mjires/git/GCC/master/gcc/cfgrtl.cc:2802
0x148d337 rtl_verify_flow_info_1
        /home/mjires/git/GCC/master/gcc/cfgrtl.cc:2889
0x148da96 rtl_verify_flow_info
        /home/mjires/git/GCC/master/gcc/cfgrtl.cc:3134
0x147202e verify_flow_info()
        /home/mjires/git/GCC/master/gcc/cfghooks.cc:283
0x1a37384 execute_function_todo
        /home/mjires/git/GCC/master/gcc/passes.cc:2100
0x1a35faa do_per_function
        /home/mjires/git/GCC/master/gcc/passes.cc:1687
0x1a37509 execute_todo
        /home/mjires/git/GCC/master/gcc/passes.cc:2142
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.


$ aarch64-linux-gnu-g++ -v
Using built-in specs.
COLLECT_GCC=aarch64-linux-gnu-g++
COLLECT_LTO_WRAPPER=/home/mjires/built/master/libexec/gcc/aarch64-linux-gnu/14.0.0/lto-wrapper
Target: aarch64-linux-gnu
Configured with: /home/mjires/git/GCC/master/configure
--prefix=/home/mjires/built/master --target=aarch64-linux-gnu
--disable-bootstrap --enable-languages=c,c++,fortran --disable-multilib
--disable-libsanitizer --enable-checking : (reconfigured)
/home/mjires/git/GCC/master/configure --prefix=/home/mjires/built/master
--target=aarch64-linux-gnu --disable-bootstrap --enable-languages=c,c++,fortran
--disable-multilib --disable-libsanitizer --enable-checking
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.0 20240103 (experimental) (GCC)

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

* [Bug target/113217] [14 Regression][aarch64] ICE in rtl_verify_bb_insns, at cfgrtl.cc:2796 since r14-6605-gc0911c6b357ba9
  2024-01-03 15:29 [Bug target/113217] New: [14 Regression][aarch64] ICE in rtl_verify_bb_insns, at cfgrtl.cc:2796 since r14-6605-gc0911c6b357ba9 mjires at suse dot cz
@ 2024-01-03 17:21 ` pinskia at gcc dot gnu.org
  2024-01-03 17:23 ` acoplan at gcc dot gnu.org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-01-03 17:21 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |14.0
                 CC|                            |pinskia at gcc dot gnu.org

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

* [Bug target/113217] [14 Regression][aarch64] ICE in rtl_verify_bb_insns, at cfgrtl.cc:2796 since r14-6605-gc0911c6b357ba9
  2024-01-03 15:29 [Bug target/113217] New: [14 Regression][aarch64] ICE in rtl_verify_bb_insns, at cfgrtl.cc:2796 since r14-6605-gc0911c6b357ba9 mjires at suse dot cz
  2024-01-03 17:21 ` [Bug target/113217] " pinskia at gcc dot gnu.org
@ 2024-01-03 17:23 ` acoplan at gcc dot gnu.org
  2024-01-03 17:29 ` pinskia at gcc dot gnu.org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: acoplan at gcc dot gnu.org @ 2024-01-03 17:23 UTC (permalink / raw)
  To: gcc-bugs

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

Alex Coplan <acoplan at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2024-01-03
             Status|UNCONFIRMED                 |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |acoplan at gcc dot gnu.org
     Ever confirmed|0                           |1

--- Comment #1 from Alex Coplan <acoplan at gcc dot gnu.org> ---
Confirmed, mine (but I'm looking at PR113070 first).

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

* [Bug target/113217] [14 Regression][aarch64] ICE in rtl_verify_bb_insns, at cfgrtl.cc:2796 since r14-6605-gc0911c6b357ba9
  2024-01-03 15:29 [Bug target/113217] New: [14 Regression][aarch64] ICE in rtl_verify_bb_insns, at cfgrtl.cc:2796 since r14-6605-gc0911c6b357ba9 mjires at suse dot cz
  2024-01-03 17:21 ` [Bug target/113217] " pinskia at gcc dot gnu.org
  2024-01-03 17:23 ` acoplan at gcc dot gnu.org
@ 2024-01-03 17:29 ` pinskia at gcc dot gnu.org
  2024-01-03 17:29 ` pinskia at gcc dot gnu.org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-01-03 17:29 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
From:
```
(insn 7 2 8 2 (set (mem:SI (reg/f:DI 103 [ this ]) [1 MEM[(struct vector
*)this_4(D)].D.4476._M_end_of_storage+0 S4 A32])
        (const_int 0 [0])) "/app/example.cpp":6:27 69 {*movsi_aarch64}
     (nil))
(debug_insn 8 7 11 2 (debug_marker:BLK) "/app/example.cpp":6:3 -1
     (nil))
(insn 11 8 42 2 (set (mem:SI (plus:DI (reg/f:DI 103 [ this ])
                (const_int 4 [0x4])) [1 MEM[(struct vector *)this_4(D) +
4B].D.4476._M_end_of_storage+0 S4 A32])
        (const_int 0 [0])) "/app/example.cpp":6:27 69 {*movsi_aarch64}
     (expr_list:REG_EH_REGION (const_int 1 [0x1])
        (nil)))
```

To:
```
(insn 7 2 8 2 (set (mem:V2x4QI (reg/f:DI 103 [ this ]) [0 +0 S8 A32])
        (unspec:V2x4QI [
                (const_int 0 [0]) repeated x2
            ] UNSPEC_STP)) "/app/example.cpp":6:27 90 {*store_pair_4}
     (expr_list:REG_EH_REGION (const_int 1 [0x1])
        (nil)))
(debug_insn 8 7 42 2 (debug_marker:BLK) "/app/example.cpp":6:3 -1
     (nil))
(note 42 8 44 3 [bb 3] NOTE_INSN_BASIC_BLOCK)
```

Most likely we should only handle stores instructions which cannot throw,
insn_nothrow_p .

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

* [Bug target/113217] [14 Regression][aarch64] ICE in rtl_verify_bb_insns, at cfgrtl.cc:2796 since r14-6605-gc0911c6b357ba9
  2024-01-03 15:29 [Bug target/113217] New: [14 Regression][aarch64] ICE in rtl_verify_bb_insns, at cfgrtl.cc:2796 since r14-6605-gc0911c6b357ba9 mjires at suse dot cz
                   ` (2 preceding siblings ...)
  2024-01-03 17:29 ` pinskia at gcc dot gnu.org
@ 2024-01-03 17:29 ` pinskia at gcc dot gnu.org
  2024-01-04 10:36 ` acoplan at gcc dot gnu.org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-01-03 17:29 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Andrew Pinski from comment #2)
> Most likely we should only handle stores instructions which cannot throw,
> insn_nothrow_p .

s/stores/stores and loads/ really.

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

* [Bug target/113217] [14 Regression][aarch64] ICE in rtl_verify_bb_insns, at cfgrtl.cc:2796 since r14-6605-gc0911c6b357ba9
  2024-01-03 15:29 [Bug target/113217] New: [14 Regression][aarch64] ICE in rtl_verify_bb_insns, at cfgrtl.cc:2796 since r14-6605-gc0911c6b357ba9 mjires at suse dot cz
                   ` (3 preceding siblings ...)
  2024-01-03 17:29 ` pinskia at gcc dot gnu.org
@ 2024-01-04 10:36 ` acoplan at gcc dot gnu.org
  2024-01-04 15:54 ` pinskia at gcc dot gnu.org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: acoplan at gcc dot gnu.org @ 2024-01-04 10:36 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Alex Coplan <acoplan at gcc dot gnu.org> ---
Looks like the fix in r14-6784-gaca1f9d7cab3dc1a374a7dc0ec6f7a8d02d2869a wasn't
sufficient to prevent trying to move throwing accesses above debug insns.  ICEs
with just -O -fnon-call-exceptions -g.  I'll see what can be done about that. 
I don't think we need to punt on such opportunities.

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

* [Bug target/113217] [14 Regression][aarch64] ICE in rtl_verify_bb_insns, at cfgrtl.cc:2796 since r14-6605-gc0911c6b357ba9
  2024-01-03 15:29 [Bug target/113217] New: [14 Regression][aarch64] ICE in rtl_verify_bb_insns, at cfgrtl.cc:2796 since r14-6605-gc0911c6b357ba9 mjires at suse dot cz
                   ` (4 preceding siblings ...)
  2024-01-04 10:36 ` acoplan at gcc dot gnu.org
@ 2024-01-04 15:54 ` pinskia at gcc dot gnu.org
  2024-01-05 12:25 ` cvs-commit at gcc dot gnu.org
  2024-01-05 12:27 ` acoplan at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-01-04 15:54 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Alex Coplan from comment #4)
> Looks like the fix in r14-6784-gaca1f9d7cab3dc1a374a7dc0ec6f7a8d02d2869a
> wasn't sufficient to prevent trying to move throwing accesses above debug
> insns.  ICEs with just -O -fnon-call-exceptions -g.  I'll see what can be
> done about that.  I don't think we need to punt on such opportunities.

Please note we also want to keep with and without -g code generation the same
too.  -fcompare-debug can helpful there too ...

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

* [Bug target/113217] [14 Regression][aarch64] ICE in rtl_verify_bb_insns, at cfgrtl.cc:2796 since r14-6605-gc0911c6b357ba9
  2024-01-03 15:29 [Bug target/113217] New: [14 Regression][aarch64] ICE in rtl_verify_bb_insns, at cfgrtl.cc:2796 since r14-6605-gc0911c6b357ba9 mjires at suse dot cz
                   ` (5 preceding siblings ...)
  2024-01-04 15:54 ` pinskia at gcc dot gnu.org
@ 2024-01-05 12:25 ` cvs-commit at gcc dot gnu.org
  2024-01-05 12:27 ` acoplan at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-01-05 12:25 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Alex Coplan <acoplan@gcc.gnu.org>:

https://gcc.gnu.org/g:4b67ec7ff5b1aa9b3b70e9b58afc594b890abeb0

commit r14-6947-g4b67ec7ff5b1aa9b3b70e9b58afc594b890abeb0
Author: Alex Coplan <alex.coplan@arm.com>
Date:   Fri Jan 5 12:25:00 2024 +0000

    aarch64: Further fix for throwing insns in ldp/stp pass [PR113217]

    As the PR shows, the fix in
    r14-6916-g057dc349021660c40699fb5c98fd9cac8e168653 was not complete.
    That fix was enough to stop us trying to move throwing accesses above
    nondebug insns, but due to this code in try_fuse_pair:

      // Placement strategy: push loads down and pull stores up, this should
      // help register pressure by reducing live ranges.
      if (load_p)
        range.first = range.last;
      else
        range.last = range.first;

    we would still try to move stores up above any debug insns that occurred
    immediately after the previous nondebug insn.  This patch fixes that by
    narrowing the move range in the case that the second access is throwing
    to exactly the range of that insn.

    Note that we still need the fix to latest_hazard_before mentioned above
    so as to ensure we select a suitable base and reject pairs if it isn't
    viable to form the pair at the end of the BB.

    gcc/ChangeLog:

            PR target/113217
            * config/aarch64/aarch64-ldp-fusion.cc
            (ldp_bb_info::try_fuse_pair): If the second access can throw,
            narrow the move range to exactly that insn.

    gcc/testsuite/ChangeLog:

            PR target/113217
            * g++.dg/pr113217.C: New test.

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

* [Bug target/113217] [14 Regression][aarch64] ICE in rtl_verify_bb_insns, at cfgrtl.cc:2796 since r14-6605-gc0911c6b357ba9
  2024-01-03 15:29 [Bug target/113217] New: [14 Regression][aarch64] ICE in rtl_verify_bb_insns, at cfgrtl.cc:2796 since r14-6605-gc0911c6b357ba9 mjires at suse dot cz
                   ` (6 preceding siblings ...)
  2024-01-05 12:25 ` cvs-commit at gcc dot gnu.org
@ 2024-01-05 12:27 ` acoplan at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: acoplan at gcc dot gnu.org @ 2024-01-05 12:27 UTC (permalink / raw)
  To: gcc-bugs

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

Alex Coplan <acoplan at gcc dot gnu.org> changed:

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

--- Comment #7 from Alex Coplan <acoplan at gcc dot gnu.org> ---
Should be fixed, thanks for the report.

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

end of thread, other threads:[~2024-01-05 12:27 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-03 15:29 [Bug target/113217] New: [14 Regression][aarch64] ICE in rtl_verify_bb_insns, at cfgrtl.cc:2796 since r14-6605-gc0911c6b357ba9 mjires at suse dot cz
2024-01-03 17:21 ` [Bug target/113217] " pinskia at gcc dot gnu.org
2024-01-03 17:23 ` acoplan at gcc dot gnu.org
2024-01-03 17:29 ` pinskia at gcc dot gnu.org
2024-01-03 17:29 ` pinskia at gcc dot gnu.org
2024-01-04 10:36 ` acoplan at gcc dot gnu.org
2024-01-04 15:54 ` pinskia at gcc dot gnu.org
2024-01-05 12:25 ` cvs-commit at gcc dot gnu.org
2024-01-05 12:27 ` acoplan 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).