public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/114099] New: [14 regression] ICE when building darktable-4.6.1
@ 2024-02-25 15:39 sjames at gcc dot gnu.org
  2024-02-25 15:40 ` [Bug middle-end/114099] " sjames at gcc dot gnu.org
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: sjames at gcc dot gnu.org @ 2024-02-25 15:39 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 114099
           Summary: [14 regression] ICE when building darktable-4.6.1
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: sjames at gcc dot gnu.org
  Target Milestone: ---

Created attachment 57525
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57525&action=edit
PentaxDecompressor.cpp.ii

This was found after applying the patch from PR114068. I can hit it without too
though.

Initially reported downstream in Gentoo by tdr.

```
$ gcc -c PentaxDecompressor.cpp.ii -O3 -march=sapphirerapids -std=c++20
during GIMPLE pass: vect
/var/tmp/portage/media-gfx/darktable-4.6.1/work/darktable-4.6.1/src/external/rawspeed/src/librawspeed/decompressors/PentaxDecompressor.cpp:
In static member function ‘static
rawspeed::HuffmanCode<rawspeed::BaselineCodeTag>
rawspeed::PentaxDecompressor::SetupPrefixCodeDecoder_Modern(rawspeed::ByteStream)’:
/var/tmp/portage/media-gfx/darktable-4.6.1/work/darktable-4.6.1/src/external/rawspeed/src/librawspeed/decompressors/PentaxDecompressor.cpp:81:1:
internal compiler error: Segmentation fault
0x55743ad30b10 crash_signal
        /usr/src/debug/sys-devel/gcc-14.0.9999/gcc-14.0.9999/gcc/toplev.cc:319
0x55743bb50b1f find_uses_to_rename_use
       
/usr/src/debug/sys-devel/gcc-14.0.9999/gcc-14.0.9999/gcc/tree-ssa-loop-manip.cc:414
0x55743bb50b1f find_uses_to_rename_bb(basic_block_def*, bitmap_head**,
bitmap_head*, int) [clone .constprop.0]
       
/usr/src/debug/sys-devel/gcc-14.0.9999/gcc-14.0.9999/gcc/tree-ssa-loop-manip.cc:489
0x55743b993aed find_uses_to_rename
       
/usr/src/debug/sys-devel/gcc-14.0.9999/gcc-14.0.9999/gcc/tree-ssa-loop-manip.cc:521
0x55743b993aed rewrite_into_loop_closed_ssa_1
       
/usr/src/debug/sys-devel/gcc-14.0.9999/gcc-14.0.9999/gcc/tree-ssa-loop-manip.cc:588
0x55743b993aed rewrite_into_loop_closed_ssa(bitmap_head*, unsigned int)
       
/usr/src/debug/sys-devel/gcc-14.0.9999/gcc-14.0.9999/gcc/tree-ssa-loop-manip.cc:628
0x55743bd1e8d9 execute
       
/usr/src/debug/sys-devel/gcc-14.0.9999/gcc-14.0.9999/gcc/tree-vectorizer.cc:1360
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://bugs.gentoo.org/> for instructions.
```

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

* [Bug middle-end/114099] [14 regression] ICE when building darktable-4.6.1
  2024-02-25 15:39 [Bug middle-end/114099] New: [14 regression] ICE when building darktable-4.6.1 sjames at gcc dot gnu.org
@ 2024-02-25 15:40 ` sjames at gcc dot gnu.org
  2024-02-25 16:18 ` [Bug middle-end/114099] [14 regression] ICE in find_uses_to_rename_use " sjames at gcc dot gnu.org
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: sjames at gcc dot gnu.org @ 2024-02-25 15:40 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Sam James <sjames at gcc dot gnu.org> ---
Created attachment 57526
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57526&action=edit
reduced.ii

Attached reduced version from tdr too. I can reproduce with `gcc -c
PentaxDecompressor.cpp.ii -O3 -mavx -std=c++20`.

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

* [Bug middle-end/114099] [14 regression] ICE in find_uses_to_rename_use when building darktable-4.6.1
  2024-02-25 15:39 [Bug middle-end/114099] New: [14 regression] ICE when building darktable-4.6.1 sjames at gcc dot gnu.org
  2024-02-25 15:40 ` [Bug middle-end/114099] " sjames at gcc dot gnu.org
@ 2024-02-25 16:18 ` sjames at gcc dot gnu.org
  2024-02-25 22:49 ` pinskia at gcc dot gnu.org
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: sjames at gcc dot gnu.org @ 2024-02-25 16:18 UTC (permalink / raw)
  To: gcc-bugs

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

Sam James <sjames at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #57526|0                           |1
        is obsolete|                            |

--- Comment #2 from Sam James <sjames at gcc dot gnu.org> ---
Created attachment 57527
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57527&action=edit
reduced.ii

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

* [Bug middle-end/114099] [14 regression] ICE in find_uses_to_rename_use when building darktable-4.6.1
  2024-02-25 15:39 [Bug middle-end/114099] New: [14 regression] ICE when building darktable-4.6.1 sjames at gcc dot gnu.org
  2024-02-25 15:40 ` [Bug middle-end/114099] " sjames at gcc dot gnu.org
  2024-02-25 16:18 ` [Bug middle-end/114099] [14 regression] ICE in find_uses_to_rename_use " sjames at gcc dot gnu.org
@ 2024-02-25 22:49 ` pinskia at gcc dot gnu.org
  2024-02-25 23:34 ` pinskia at gcc dot gnu.org
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-02-25 22:49 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Note the reduced testcase is undefined code.
c::j is not initialized when c::k() is called.

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

* [Bug middle-end/114099] [14 regression] ICE in find_uses_to_rename_use when building darktable-4.6.1
  2024-02-25 15:39 [Bug middle-end/114099] New: [14 regression] ICE when building darktable-4.6.1 sjames at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2024-02-25 22:49 ` pinskia at gcc dot gnu.org
@ 2024-02-25 23:34 ` pinskia at gcc dot gnu.org
  2024-02-25 23:36 ` pinskia at gcc dot gnu.org
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-02-25 23:34 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Created attachment 57532
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57532&action=edit
Reduced further but still has undefined code in it

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

* [Bug middle-end/114099] [14 regression] ICE in find_uses_to_rename_use when building darktable-4.6.1
  2024-02-25 15:39 [Bug middle-end/114099] New: [14 regression] ICE when building darktable-4.6.1 sjames at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2024-02-25 23:34 ` pinskia at gcc dot gnu.org
@ 2024-02-25 23:36 ` pinskia at gcc dot gnu.org
  2024-02-25 23:36 ` [Bug tree-optimization/114099] " pinskia at gcc dot gnu.org
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-02-25 23:36 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #57527|0                           |1
        is obsolete|                            |
  Attachment #57532|0                           |1
        is obsolete|                            |

--- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Created attachment 57533
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57533&action=edit
Reduced all the way without undefined code in it

This ICEs on aarch64 with just -O3.

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

* [Bug tree-optimization/114099] [14 regression] ICE in find_uses_to_rename_use when building darktable-4.6.1
  2024-02-25 15:39 [Bug middle-end/114099] New: [14 regression] ICE when building darktable-4.6.1 sjames at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2024-02-25 23:36 ` pinskia at gcc dot gnu.org
@ 2024-02-25 23:36 ` pinskia at gcc dot gnu.org
  2024-02-25 23:45 ` pinskia at gcc dot gnu.org
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-02-25 23:36 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2024-02-25
           Keywords|                            |needs-bisection
             Status|UNCONFIRMED                 |NEW
          Component|middle-end                  |tree-optimization
     Ever confirmed|0                           |1
   Target Milestone|---                         |14.0

--- Comment #6 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Confirmed.

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

* [Bug tree-optimization/114099] [14 regression] ICE in find_uses_to_rename_use when building darktable-4.6.1
  2024-02-25 15:39 [Bug middle-end/114099] New: [14 regression] ICE when building darktable-4.6.1 sjames at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2024-02-25 23:36 ` [Bug tree-optimization/114099] " pinskia at gcc dot gnu.org
@ 2024-02-25 23:45 ` pinskia at gcc dot gnu.org
  2024-02-26  6:55 ` tnfchris at gcc dot gnu.org
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-02-25 23:45 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tnfchris at gcc dot gnu.org

--- Comment #7 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Note the difference between noreturn vs __builtin_unreachable BB is the
noreturn bb has:
  # _21 = PHI <_2(4)>
  m = _21;

But the one with unreachable does not.
It feels like that difference is causing the issue here. Replacing unreachable
with another noreturn function removes the ICE even.

I am 99% sure this is related to the early out vect changes too.

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

* [Bug tree-optimization/114099] [14 regression] ICE in find_uses_to_rename_use when building darktable-4.6.1
  2024-02-25 15:39 [Bug middle-end/114099] New: [14 regression] ICE when building darktable-4.6.1 sjames at gcc dot gnu.org
                   ` (6 preceding siblings ...)
  2024-02-25 23:45 ` pinskia at gcc dot gnu.org
@ 2024-02-26  6:55 ` tnfchris at gcc dot gnu.org
  2024-02-26 10:38 ` rguenth at gcc dot gnu.org
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: tnfchris at gcc dot gnu.org @ 2024-02-26  6:55 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from Tamar Christina <tnfchris at gcc dot gnu.org> ---
Created attachment 57537
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57537&action=edit
uses.patch

new code seems sensitive to visitation order as get_virtual_phi returns NULL
for blocks which don't define or use a virtual PHI.

testing patch.

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

* [Bug tree-optimization/114099] [14 regression] ICE in find_uses_to_rename_use when building darktable-4.6.1
  2024-02-25 15:39 [Bug middle-end/114099] New: [14 regression] ICE when building darktable-4.6.1 sjames at gcc dot gnu.org
                   ` (7 preceding siblings ...)
  2024-02-26  6:55 ` tnfchris at gcc dot gnu.org
@ 2024-02-26 10:38 ` rguenth at gcc dot gnu.org
  2024-02-26 14:21 ` cvs-commit at gcc dot gnu.org
  2024-02-26 14:22 ` rguenth at gcc dot gnu.org
  10 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu.org @ 2024-02-26 10:38 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #9 from Richard Biener <rguenth at gcc dot gnu.org> ---
Let me handle this as well.

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

* [Bug tree-optimization/114099] [14 regression] ICE in find_uses_to_rename_use when building darktable-4.6.1
  2024-02-25 15:39 [Bug middle-end/114099] New: [14 regression] ICE when building darktable-4.6.1 sjames at gcc dot gnu.org
                   ` (8 preceding siblings ...)
  2024-02-26 10:38 ` rguenth at gcc dot gnu.org
@ 2024-02-26 14:21 ` cvs-commit at gcc dot gnu.org
  2024-02-26 14:22 ` rguenth at gcc dot gnu.org
  10 siblings, 0 replies; 12+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-02-26 14:21 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #10 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Richard Biener <rguenth@gcc.gnu.org>:

https://gcc.gnu.org/g:fb68e2cac1283f731a3a979cb714621afb1ddfcc

commit r14-9182-gfb68e2cac1283f731a3a979cb714621afb1ddfcc
Author: Richard Biener <rguenther@suse.de>
Date:   Mon Feb 26 12:27:42 2024 +0100

    tree-optimization/114099 - virtual LC PHIs and early exit vect

    In some cases exits can lack LC PHI nodes for the virtual operand.
    We have to create them when the epilog loop requires them which also
    allows us to remove some only halfway correct fixups.  This is the
    variant triggering for alternate exits.

            PR tree-optimization/114099
            * tree-vect-loop-manip.cc (slpeel_tree_duplicate_loop_to_edge_cfg):
            Create and fill in a needed virtual LC PHI for the alternate
            exits.  Remove code dealing with that missing.

            * gcc.dg/vect/vect-early-break_120-pr114099.c: New testcase.

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

* [Bug tree-optimization/114099] [14 regression] ICE in find_uses_to_rename_use when building darktable-4.6.1
  2024-02-25 15:39 [Bug middle-end/114099] New: [14 regression] ICE when building darktable-4.6.1 sjames at gcc dot gnu.org
                   ` (9 preceding siblings ...)
  2024-02-26 14:21 ` cvs-commit at gcc dot gnu.org
@ 2024-02-26 14:22 ` rguenth at gcc dot gnu.org
  10 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu.org @ 2024-02-26 14:22 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #11 from Richard Biener <rguenth at gcc dot gnu.org> ---
Fixed.

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

end of thread, other threads:[~2024-02-26 14:22 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-25 15:39 [Bug middle-end/114099] New: [14 regression] ICE when building darktable-4.6.1 sjames at gcc dot gnu.org
2024-02-25 15:40 ` [Bug middle-end/114099] " sjames at gcc dot gnu.org
2024-02-25 16:18 ` [Bug middle-end/114099] [14 regression] ICE in find_uses_to_rename_use " sjames at gcc dot gnu.org
2024-02-25 22:49 ` pinskia at gcc dot gnu.org
2024-02-25 23:34 ` pinskia at gcc dot gnu.org
2024-02-25 23:36 ` pinskia at gcc dot gnu.org
2024-02-25 23:36 ` [Bug tree-optimization/114099] " pinskia at gcc dot gnu.org
2024-02-25 23:45 ` pinskia at gcc dot gnu.org
2024-02-26  6:55 ` tnfchris at gcc dot gnu.org
2024-02-26 10:38 ` rguenth at gcc dot gnu.org
2024-02-26 14:21 ` cvs-commit at gcc dot gnu.org
2024-02-26 14:22 ` rguenth 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).