public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/114628] New: [14 Regression] ICE in gimple_check_failed at gimple.cc:1337 while compiling bitint-100.c
@ 2024-04-07 10:53 pheeck at gcc dot gnu.org
  2024-04-07 10:54 ` [Bug middle-end/114628] " pheeck at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: pheeck at gcc dot gnu.org @ 2024-04-07 10:53 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 114628
           Summary: [14 Regression] ICE in gimple_check_failed at
                    gimple.cc:1337 while compiling bitint-100.c
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: pheeck at gcc dot gnu.org
  Target Milestone: ---
              Host: x86_64-pc-linux-gnu
            Target: x86_64-pc-linux-gnu

While compiling the gcc.dg/bitint-100.c testsuite testcase

gcc src/gcc/testsuite/gcc.dg/bitint-100.c -fvar-tracking-assignments-toggle

the following ICE occurs

during GIMPLE pass: bitintlower0
src/gcc/testsuite/gcc.dg/bitint-100.c: In function ‘corge’:
src/gcc/testsuite/gcc.dg/bitint-100.c:44:1: internal compiler error: gimple
check: expected gimple_assign(error_mark), have gimple_debug() in
gimple_assign_lhs, at gimple.h:2663
   44 | corge (int x, _BitInt(575) y, _BitInt(325) *z)
      | ^~~~~
0x74f67a gimple_check_failed(gimple const*, char const*, int, char const*,
gimple_code, tree_code)
        /home/fkastl/gcc/src/gcc/gimple.cc:1337
0x1f50114 gassign const* GIMPLE_CHECK2<gassign const*>(gimple const*, char
const*, int, char const*)
        /home/fkastl/gcc/src/gcc/gimple.h:74
0x1f50114 gimple_assign_lhs(gimple const*)
        /home/fkastl/gcc/src/gcc/gimple.h:2663
0x1f50114 gimple_lower_bitint
        /home/fkastl/gcc/src/gcc/gimple-lower-bitint.cc:7195

Compiler configuration (nothing special there I believe):

Reading specs from /home/fkastl/gcc/build/gcc/specs
COLLECT_GCC=/home/fkastl/gcc/build/gcc/xgcc
COLLECT_LTO_WRAPPER=/home/fkastl/gcc/build/gcc/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /home/fkastl/gcc/src/configure --disable-bootstrap
--enable-checking --disable-libsanitizer --prefix=/home/fkastl/gcc/inst
--enable-languages=c
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 14.0.1 20240405 (experimental) (GCC)

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

* [Bug middle-end/114628] [14 Regression] ICE in gimple_check_failed at gimple.cc:1337 while compiling bitint-100.c
  2024-04-07 10:53 [Bug middle-end/114628] New: [14 Regression] ICE in gimple_check_failed at gimple.cc:1337 while compiling bitint-100.c pheeck at gcc dot gnu.org
@ 2024-04-07 10:54 ` pheeck at gcc dot gnu.org
  2024-04-07 20:18 ` [Bug middle-end/114628] ICE with _BitInt with computed gotos with returns_twice and -g and optimization pinskia at gcc dot gnu.org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pheeck at gcc dot gnu.org @ 2024-04-07 10:54 UTC (permalink / raw)
  To: gcc-bugs

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

Filip Kastl <pheeck at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |14.0

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

* [Bug middle-end/114628] ICE with _BitInt with computed gotos with returns_twice and -g and optimization
  2024-04-07 10:53 [Bug middle-end/114628] New: [14 Regression] ICE in gimple_check_failed at gimple.cc:1337 while compiling bitint-100.c pheeck at gcc dot gnu.org
  2024-04-07 10:54 ` [Bug middle-end/114628] " pheeck at gcc dot gnu.org
@ 2024-04-07 20:18 ` pinskia at gcc dot gnu.org
  2024-04-08 14:11 ` [Bug middle-end/114628] ICE with _BitInt returns_twice (and computed gotos) with " jakub at gcc dot gnu.org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-04-07 20:18 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[14 Regression] ICE in      |ICE with _BitInt with
                   |gimple_check_failed at      |computed gotos with
                   |gimple.cc:1337 while        |returns_twice and -g and
                   |compiling bitint-100.c      |optimization
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2024-04-07
   Target Milestone|14.0                        |---

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Confirmed, ICEs with just `-O1 -g`.
Reduced testcase:
```
int foo (int);

__attribute__((returns_twice)) int
bar (_BitInt(129) x);

void
corge (int x, _BitInt(129) y)
{
  void *q[] = { &&l1, &&l2 };
l2:
  x = foo (foo (3));
  bar (y);
#if 1
  goto *q[x & 1];
#endif
l1:
}

```

Note we get 2 difference ICEs depending on if `#if ` is 1 or 0.
It seems like it would be useful if some more torture tests for _BitInt were
included so `-g` gets a little more testing.

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

* [Bug middle-end/114628] ICE with _BitInt returns_twice (and computed gotos) with  -g and optimization
  2024-04-07 10:53 [Bug middle-end/114628] New: [14 Regression] ICE in gimple_check_failed at gimple.cc:1337 while compiling bitint-100.c pheeck at gcc dot gnu.org
  2024-04-07 10:54 ` [Bug middle-end/114628] " pheeck at gcc dot gnu.org
  2024-04-07 20:18 ` [Bug middle-end/114628] ICE with _BitInt with computed gotos with returns_twice and -g and optimization pinskia at gcc dot gnu.org
@ 2024-04-08 14:11 ` jakub at gcc dot gnu.org
  2024-04-08 14:13 ` jakub at gcc dot gnu.org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: jakub at gcc dot gnu.org @ 2024-04-08 14:11 UTC (permalink / raw)
  To: gcc-bugs

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

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
                 CC|                            |jakub at gcc dot gnu.org

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

Untested fix.

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

* [Bug middle-end/114628] ICE with _BitInt returns_twice (and computed gotos) with  -g and optimization
  2024-04-07 10:53 [Bug middle-end/114628] New: [14 Regression] ICE in gimple_check_failed at gimple.cc:1337 while compiling bitint-100.c pheeck at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2024-04-08 14:11 ` [Bug middle-end/114628] ICE with _BitInt returns_twice (and computed gotos) with " jakub at gcc dot gnu.org
@ 2024-04-08 14:13 ` jakub at gcc dot gnu.org
  2024-04-09  7:29 ` cvs-commit at gcc dot gnu.org
  2024-04-09  7:30 ` jakub at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: jakub at gcc dot gnu.org @ 2024-04-08 14:13 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
(In reply to Andrew Pinski from comment #1)
> Note we get 2 difference ICEs depending on if `#if ` is 1 or 0.
> It seems like it would be useful if some more torture tests for _BitInt were
> included so `-g` gets a little more testing.

We have lots of bitint torture tests, but because those tests often are fairly
expensive, they are usually excluded unless GCC_TEST_RUN_EXPENSIVE=1 (which I'm
quite often using for
make check-gcc -j32 -k GCC_TEST_RUN_EXPENSIVE=1
RUNTESTFLAGS="GCC_TEST_RUN_EXPENSIVE=1 dg.exp='*bitint* pr112673.c
builtin-stdc-bit-*.c pr112566-2.c pr112511.c' dg-torture.exp=*bitint*
dfp.exp=*bitint*"
testing on x86_64/i686-linux.

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

* [Bug middle-end/114628] ICE with _BitInt returns_twice (and computed gotos) with  -g and optimization
  2024-04-07 10:53 [Bug middle-end/114628] New: [14 Regression] ICE in gimple_check_failed at gimple.cc:1337 while compiling bitint-100.c pheeck at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2024-04-08 14:13 ` jakub at gcc dot gnu.org
@ 2024-04-09  7:29 ` cvs-commit at gcc dot gnu.org
  2024-04-09  7:30 ` jakub at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-04-09  7:29 UTC (permalink / raw)
  To: gcc-bugs

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

--- 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:7dd1f9d2ec422173f490d91b9173d4fa5d32d909

commit r14-9859-g7dd1f9d2ec422173f490d91b9173d4fa5d32d909
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Tue Apr 9 09:28:27 2024 +0200

    bitint: Don't move debug stmts from before returns_twice calls [PR114628]

    Debug stmts are allowed by the verifier before the returns_twice calls.
    More importantly, they don't have a lhs, so the current handling of
    arg_stmts statements to force them on the edges ICEs.

    The following patch just keeps them where they were before.

    2024-04-09  Jakub Jelinek  <jakub@redhat.com>

            PR middle-end/114628
            * gimple-lower-bitint.cc (gimple_lower_bitint): Keep debug stmts
            before returns_twice calls as is, don't push them into arg_stmts
            vector/move to edges.

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

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

* [Bug middle-end/114628] ICE with _BitInt returns_twice (and computed gotos) with  -g and optimization
  2024-04-07 10:53 [Bug middle-end/114628] New: [14 Regression] ICE in gimple_check_failed at gimple.cc:1337 while compiling bitint-100.c pheeck at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2024-04-09  7:29 ` cvs-commit at gcc dot gnu.org
@ 2024-04-09  7:30 ` jakub at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: jakub at gcc dot gnu.org @ 2024-04-09  7:30 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- 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:[~2024-04-09  7:30 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-07 10:53 [Bug middle-end/114628] New: [14 Regression] ICE in gimple_check_failed at gimple.cc:1337 while compiling bitint-100.c pheeck at gcc dot gnu.org
2024-04-07 10:54 ` [Bug middle-end/114628] " pheeck at gcc dot gnu.org
2024-04-07 20:18 ` [Bug middle-end/114628] ICE with _BitInt with computed gotos with returns_twice and -g and optimization pinskia at gcc dot gnu.org
2024-04-08 14:11 ` [Bug middle-end/114628] ICE with _BitInt returns_twice (and computed gotos) with " jakub at gcc dot gnu.org
2024-04-08 14:13 ` jakub at gcc dot gnu.org
2024-04-09  7:29 ` cvs-commit at gcc dot gnu.org
2024-04-09  7:30 ` 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).