public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/103268] New: [12 regression] ICE om glib-2.10.1: internal compiler error: in optimize_atomic_bit_test_and, at tree-ssa-ccp.c:3626
@ 2021-11-15 23:47 slyfox at gcc dot gnu.org
  2021-11-15 23:50 ` [Bug tree-optimization/103268] " pinskia at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: slyfox at gcc dot gnu.org @ 2021-11-15 23:47 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 103268
           Summary: [12 regression] ICE om glib-2.10.1: internal compiler
                    error: in optimize_atomic_bit_test_and, at
                    tree-ssa-ccp.c:3626
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: slyfox at gcc dot gnu.org
  Target Milestone: ---

ICE is initially observed on glib-2.70.1. Here is extracted example:

    // $ cat a.c.c
    void g_assertion_message_cmpnum(long);

    static int si;

    void test_types(long n) {
       unsigned u2 = ({ __atomic_fetch_xor(&si, 0, 5); });
      long l = u2;
      g_assertion_message_cmpnum(l);
    }

$ gcc-12.0.0 a.c.c -c -O2
a.c.c: In function 'test_types':
a.c.c:5:22: warning: unused parameter 'n' [-Wunused-parameter]
    5 | void test_types(long n) {
      |                 ~~~~~^
during GIMPLE pass: fab
a.c.c:5:6: internal compiler error: in optimize_atomic_bit_test_and, at
tree-ssa-ccp.c:3626
    5 | void test_types(long n) {
      |      ^~~~~~~~~~
0x1df4a67 internal_error(char const*, ...)
        ???:0
0x8d493d fancy_abort(char const*, int, char const*)
        ???:0
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

$ gcc-12.0.0 -v
Using built-in specs.
COLLECT_GCC=/nix/store/kb1by7nzcqlv8j2hl7q0kks8fw8dpym0-gcc-12.0.0/bin/gcc
COLLECT_LTO_WRAPPER=/nix/store/kb1by7nzcqlv8j2hl7q0kks8fw8dpym0-gcc-12.0.0/libexec/gcc/x86_64-unknown-linux-gnu/12.0.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with:
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 12.0.0 20211114 (experimental) (GCC)

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

* [Bug tree-optimization/103268] [12 regression] ICE om glib-2.10.1: internal compiler error: in optimize_atomic_bit_test_and, at tree-ssa-ccp.c:3626
  2021-11-15 23:47 [Bug tree-optimization/103268] New: [12 regression] ICE om glib-2.10.1: internal compiler error: in optimize_atomic_bit_test_and, at tree-ssa-ccp.c:3626 slyfox at gcc dot gnu.org
@ 2021-11-15 23:50 ` pinskia at gcc dot gnu.org
  2021-11-16  0:04 ` hjl.tools at gmail dot com
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-11-15 23:50 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice-on-valid-code
   Target Milestone|---                         |12.0
           See Also|                            |https://gcc.gnu.org/bugzill
                   |                            |a/show_bug.cgi?id=103184

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
I think this was just fixed today, see PR 103184.

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

* [Bug tree-optimization/103268] [12 regression] ICE om glib-2.10.1: internal compiler error: in optimize_atomic_bit_test_and, at tree-ssa-ccp.c:3626
  2021-11-15 23:47 [Bug tree-optimization/103268] New: [12 regression] ICE om glib-2.10.1: internal compiler error: in optimize_atomic_bit_test_and, at tree-ssa-ccp.c:3626 slyfox at gcc dot gnu.org
  2021-11-15 23:50 ` [Bug tree-optimization/103268] " pinskia at gcc dot gnu.org
@ 2021-11-16  0:04 ` hjl.tools at gmail dot com
  2021-11-16  0:12 ` hjl.tools at gmail dot com
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: hjl.tools at gmail dot com @ 2021-11-16  0:04 UTC (permalink / raw)
  To: gcc-bugs

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

H.J. Lu <hjl.tools at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |crazylht at gmail dot com,
                   |                            |hjl.tools at gmail dot com

--- Comment #2 from H.J. Lu <hjl.tools at gmail dot com> ---
A simplified test:


[hjl@gnu-cfl-2 pr103268]$ cat x.c
static int si;
long
test_types (long n)
{
  unsigned int u2 = __atomic_fetch_xor (&si, 0, 5);
  return u2;
}
[hjl@gnu-cfl-2 pr103268]$ make
/export/build/gnu/tools-build/gcc-gitlab-debug/build-x86_64-linux/gcc/xgcc
-B/export/build/gnu/tools-build/gcc-gitlab-debug/build-x86_64-linux/gcc/ -O2 -S
x.c
during GIMPLE pass: fab
x.c: In function ‘test_types’:
x.c:3:1: internal compiler error: in optimize_atomic_bit_test_and, at
tree-ssa-ccp.c:3645
    3 | test_types (long n)
      | ^~~~~~~~~~
0x1515c9d optimize_atomic_bit_test_and
        /export/gnu/import/git/gitlab/x86-gcc/gcc/tree-ssa-ccp.c:3645
0x151790a execute
        /export/gnu/import/git/gitlab/x86-gcc/gcc/tree-ssa-ccp.c:4115
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
make: *** [Makefile:43: x.s] Error 1
[hjl@gnu-cfl-2 pr103268]$

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

* [Bug tree-optimization/103268] [12 regression] ICE om glib-2.10.1: internal compiler error: in optimize_atomic_bit_test_and, at tree-ssa-ccp.c:3626
  2021-11-15 23:47 [Bug tree-optimization/103268] New: [12 regression] ICE om glib-2.10.1: internal compiler error: in optimize_atomic_bit_test_and, at tree-ssa-ccp.c:3626 slyfox at gcc dot gnu.org
  2021-11-15 23:50 ` [Bug tree-optimization/103268] " pinskia at gcc dot gnu.org
  2021-11-16  0:04 ` hjl.tools at gmail dot com
@ 2021-11-16  0:12 ` hjl.tools at gmail dot com
  2021-11-16  0:24 ` hjl.tools at gmail dot com
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: hjl.tools at gmail dot com @ 2021-11-16  0:12 UTC (permalink / raw)
  To: gcc-bugs

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

H.J. Lu <hjl.tools at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2021-11-16
     Ever confirmed|0                           |1

--- Comment #3 from H.J. Lu <hjl.tools at gmail dot com> ---
It is related to PR 103194.

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

* [Bug tree-optimization/103268] [12 regression] ICE om glib-2.10.1: internal compiler error: in optimize_atomic_bit_test_and, at tree-ssa-ccp.c:3626
  2021-11-15 23:47 [Bug tree-optimization/103268] New: [12 regression] ICE om glib-2.10.1: internal compiler error: in optimize_atomic_bit_test_and, at tree-ssa-ccp.c:3626 slyfox at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2021-11-16  0:12 ` hjl.tools at gmail dot com
@ 2021-11-16  0:24 ` hjl.tools at gmail dot com
  2021-11-16  1:32 ` crazylht at gmail dot com
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: hjl.tools at gmail dot com @ 2021-11-16  0:24 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from H.J. Lu <hjl.tools at gmail dot com> ---
Created attachment 51802
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=51802&action=edit
A patch

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

* [Bug tree-optimization/103268] [12 regression] ICE om glib-2.10.1: internal compiler error: in optimize_atomic_bit_test_and, at tree-ssa-ccp.c:3626
  2021-11-15 23:47 [Bug tree-optimization/103268] New: [12 regression] ICE om glib-2.10.1: internal compiler error: in optimize_atomic_bit_test_and, at tree-ssa-ccp.c:3626 slyfox at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2021-11-16  0:24 ` hjl.tools at gmail dot com
@ 2021-11-16  1:32 ` crazylht at gmail dot com
  2021-11-16  3:24 ` cvs-commit at gcc dot gnu.org
  2021-11-16  3:24 ` hjl.tools at gmail dot com
  6 siblings, 0 replies; 8+ messages in thread
From: crazylht at gmail dot com @ 2021-11-16  1:32 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Hongtao.liu <crazylht at gmail dot com> ---
I've verified my patch in pr103194, it can also fix this ICE.

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

* [Bug tree-optimization/103268] [12 regression] ICE om glib-2.10.1: internal compiler error: in optimize_atomic_bit_test_and, at tree-ssa-ccp.c:3626
  2021-11-15 23:47 [Bug tree-optimization/103268] New: [12 regression] ICE om glib-2.10.1: internal compiler error: in optimize_atomic_bit_test_and, at tree-ssa-ccp.c:3626 slyfox at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2021-11-16  1:32 ` crazylht at gmail dot com
@ 2021-11-16  3:24 ` cvs-commit at gcc dot gnu.org
  2021-11-16  3:24 ` hjl.tools at gmail dot com
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-11-16  3:24 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by H.J. Lu <hjl@gcc.gnu.org>:

https://gcc.gnu.org/g:074ee8d9a91d7573c1e8774a22e4e08f923adb18

commit r12-5290-g074ee8d9a91d7573c1e8774a22e4e08f923adb18
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Mon Nov 15 17:37:10 2021 -0800

    Add a missing return when transforming atomic bit test and operations

    When failing to transform equivalent, but slighly different cases of
    atomic bit test and operations to their canonical forms, return
    immediately.

    gcc/

            PR middle-end/103268
            * tree-ssa-ccp.c (optimize_atomic_bit_test_and): Add a missing
            return.

    gcc/testsuite/

            PR middle-end/103268
            * gcc.dg/pr103268-1.c: New test.
            * gcc.dg/pr103268-2.c: Likewise.

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

* [Bug tree-optimization/103268] [12 regression] ICE om glib-2.10.1: internal compiler error: in optimize_atomic_bit_test_and, at tree-ssa-ccp.c:3626
  2021-11-15 23:47 [Bug tree-optimization/103268] New: [12 regression] ICE om glib-2.10.1: internal compiler error: in optimize_atomic_bit_test_and, at tree-ssa-ccp.c:3626 slyfox at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2021-11-16  3:24 ` cvs-commit at gcc dot gnu.org
@ 2021-11-16  3:24 ` hjl.tools at gmail dot com
  6 siblings, 0 replies; 8+ messages in thread
From: hjl.tools at gmail dot com @ 2021-11-16  3:24 UTC (permalink / raw)
  To: gcc-bugs

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

H.J. Lu <hjl.tools at gmail dot com> changed:

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

--- Comment #7 from H.J. Lu <hjl.tools at gmail dot com> ---
Fixed.

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

end of thread, other threads:[~2021-11-16  3:24 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-15 23:47 [Bug tree-optimization/103268] New: [12 regression] ICE om glib-2.10.1: internal compiler error: in optimize_atomic_bit_test_and, at tree-ssa-ccp.c:3626 slyfox at gcc dot gnu.org
2021-11-15 23:50 ` [Bug tree-optimization/103268] " pinskia at gcc dot gnu.org
2021-11-16  0:04 ` hjl.tools at gmail dot com
2021-11-16  0:12 ` hjl.tools at gmail dot com
2021-11-16  0:24 ` hjl.tools at gmail dot com
2021-11-16  1:32 ` crazylht at gmail dot com
2021-11-16  3:24 ` cvs-commit at gcc dot gnu.org
2021-11-16  3:24 ` hjl.tools at gmail dot com

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