public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/113568] New: ICE: definition in block 13 does not dominate use in block 15 with _BitInt() at -O1
@ 2024-01-23 19:52 zsojka at seznam dot cz
  2024-01-23 20:02 ` [Bug tree-optimization/113568] " mpolacek at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: zsojka at seznam dot cz @ 2024-01-23 19:52 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 113568
           Summary: ICE: definition in block 13 does not dominate use in
                    block 15 with _BitInt() at -O1
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: zsojka at seznam dot cz
                CC: jakub at gcc dot gnu.org
  Target Milestone: ---
              Host: x86_64-pc-linux-gnu
            Target: x86_64-pc-linux-gnu

Created attachment 57197
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57197&action=edit
reduced testcase

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O testcase.c
testcase.c: In function 'foo':
testcase.c:5:1: error: definition in block 13 does not dominate use in block 15
    5 | foo(void)
      | ^~~
for SSA_NAME: _20 in statement:
_19 = PHI <0(8), _20(15)>
PHI argument
_20
for PHI node
_19 = PHI <0(8), _20(15)>
during GIMPLE pass: bitintlower
testcase.c:5:1: internal compiler error: verify_ssa failed
0x178bed0 verify_ssa(bool, bool)
        /repo/gcc-trunk/gcc/tree-ssa.cc:1203
0x13ce6c5 execute_function_todo
        /repo/gcc-trunk/gcc/passes.cc:2095
0x13ceb2e execute_todo
        /repo/gcc-trunk/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.

$ x86_64-pc-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=/repo/gcc-trunk/binary-latest-amd64/bin/x86_64-pc-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-r14-8373-20240123195900-gdbc5f1f523b-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/14.0.1/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--disable-bootstrap --with-cloog --with-ppl --with-isl
--build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu
--target=x86_64-pc-linux-gnu --with-ld=/usr/bin/x86_64-pc-linux-gnu-ld
--with-as=/usr/bin/x86_64-pc-linux-gnu-as --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r14-8373-20240123195900-gdbc5f1f523b-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240123 (experimental) (GCC)

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

* [Bug tree-optimization/113568] ICE: definition in block 13 does not dominate use in block 15 with _BitInt() at -O1
  2024-01-23 19:52 [Bug tree-optimization/113568] New: ICE: definition in block 13 does not dominate use in block 15 with _BitInt() at -O1 zsojka at seznam dot cz
@ 2024-01-23 20:02 ` mpolacek at gcc dot gnu.org
  2024-01-24 16:44 ` jakub at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2024-01-23 20:02 UTC (permalink / raw)
  To: gcc-bugs

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

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2024-01-23
             Status|UNCONFIRMED                 |NEW
                 CC|                            |mpolacek at gcc dot gnu.org

--- Comment #1 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Started with r14-4592:

commit 0d00385eaf72ccacff17935b0d214a26773e095f
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Thu Oct 12 16:01:12 2023 +0200

    wide-int: Allow up to 16320 bits wide_int and change widest_int precision
to 32640 bits [PR102989]

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

* [Bug tree-optimization/113568] ICE: definition in block 13 does not dominate use in block 15 with _BitInt() at -O1
  2024-01-23 19:52 [Bug tree-optimization/113568] New: ICE: definition in block 13 does not dominate use in block 15 with _BitInt() at -O1 zsojka at seznam dot cz
  2024-01-23 20:02 ` [Bug tree-optimization/113568] " mpolacek at gcc dot gnu.org
@ 2024-01-24 16:44 ` jakub at gcc dot gnu.org
  2024-01-26 17:14 ` jakub at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: jakub at gcc dot gnu.org @ 2024-01-24 16:44 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
(In reply to Marek Polacek from comment #1)
> Started with r14-4592:

Only because it uses _BitInt(848).

Just change the testcase to:
signed char c;
_BitInt(464) g;

void
foo (void)
{
  _BitInt(464) a[2] = {};
  _BitInt(464) b;
  while (c)
    {
      b = g + 1;
      g = a[0];
      a[0] = b;
    }
}
and it ICEs already earlier.

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

* [Bug tree-optimization/113568] ICE: definition in block 13 does not dominate use in block 15 with _BitInt() at -O1
  2024-01-23 19:52 [Bug tree-optimization/113568] New: ICE: definition in block 13 does not dominate use in block 15 with _BitInt() at -O1 zsojka at seznam dot cz
  2024-01-23 20:02 ` [Bug tree-optimization/113568] " mpolacek at gcc dot gnu.org
  2024-01-24 16:44 ` jakub at gcc dot gnu.org
@ 2024-01-26 17:14 ` jakub at gcc dot gnu.org
  2024-01-27 12:07 ` cvs-commit at gcc dot gnu.org
  2024-01-27 12:11 ` jakub at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: jakub at gcc dot gnu.org @ 2024-01-26 17:14 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

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

Untested fix.

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

* [Bug tree-optimization/113568] ICE: definition in block 13 does not dominate use in block 15 with _BitInt() at -O1
  2024-01-23 19:52 [Bug tree-optimization/113568] New: ICE: definition in block 13 does not dominate use in block 15 with _BitInt() at -O1 zsojka at seznam dot cz
                   ` (2 preceding siblings ...)
  2024-01-26 17:14 ` jakub at gcc dot gnu.org
@ 2024-01-27 12:07 ` cvs-commit at gcc dot gnu.org
  2024-01-27 12:11 ` jakub at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-01-27 12:07 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from GCC 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:3f5ac4696351c352980f8cd1b063df89894549c2

commit r14-8467-g3f5ac4696351c352980f8cd1b063df89894549c2
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Sat Jan 27 13:06:17 2024 +0100

    lower-bitint: Fix up VIEW_CONVERT_EXPR handling in lower_mergeable_stmt
[PR113568]

    We generally allow merging mergeable stmts with some final cast (but not
    further casts or mergeable operations after the cast).  As some casts
    are handled conditionally, if (idx < cst) handle_operand (idx); else if
    idx == cst) handle_operand (cst); else ..., we must sure that e.g. the
    mergeable PLUS_EXPR/MINUS_EXPR/NEGATE_EXPR never appear in handle_operand
    called from such casts, because it ICEs on invalid SSA_NAME form (that part
    could be fixable by adding further PHIs) but also because we'd need to
    correctly propagate the overflow flags from the if to else if.
    So, instead lower_mergeable_stmt handles an outermost widening cast (or
    widening cast feeding outermost store) specially.
    The problem was similar to PR113408, that VIEW_CONVERT_EXPR tree is
    present in the gimple_assign_rhs1 while it is not for
NOP_EXPR/CONVERT_EXPR,
    so the checks whether the outermost cast should be handled didn't handle
    the VCE case and so handle_plus_minus was called from the conditional
    handle_cast.

    2024-01-27  Jakub Jelinek  <jakub@redhat.com>

            PR tree-optimization/113568
            * gimple-lower-bitint.cc (bitint_large_huge::lower_mergeable_stmt):
            For VIEW_CONVERT_EXPR use first operand of rhs1 instead of rhs1
            in the widening extension checks.

            * gcc.dg/bitint-78.c: New test.

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

* [Bug tree-optimization/113568] ICE: definition in block 13 does not dominate use in block 15 with _BitInt() at -O1
  2024-01-23 19:52 [Bug tree-optimization/113568] New: ICE: definition in block 13 does not dominate use in block 15 with _BitInt() at -O1 zsojka at seznam dot cz
                   ` (3 preceding siblings ...)
  2024-01-27 12:07 ` cvs-commit at gcc dot gnu.org
@ 2024-01-27 12:11 ` jakub at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: jakub at gcc dot gnu.org @ 2024-01-27 12:11 UTC (permalink / raw)
  To: gcc-bugs

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

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] 6+ messages in thread

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

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-23 19:52 [Bug tree-optimization/113568] New: ICE: definition in block 13 does not dominate use in block 15 with _BitInt() at -O1 zsojka at seznam dot cz
2024-01-23 20:02 ` [Bug tree-optimization/113568] " mpolacek at gcc dot gnu.org
2024-01-24 16:44 ` jakub at gcc dot gnu.org
2024-01-26 17:14 ` jakub at gcc dot gnu.org
2024-01-27 12:07 ` cvs-commit at gcc dot gnu.org
2024-01-27 12:11 ` 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).