public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/105163] New: ICE: SSA corruption
@ 2022-04-05 16:16 gscfq@t-online.de
  2022-04-05 16:17 ` [Bug c/105163] " gscfq@t-online.de
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: gscfq@t-online.de @ 2022-04-05 16:16 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 105163
           Summary: ICE: SSA corruption
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gscfq@t-online.de
  Target Milestone: ---

Affects versions down to at least r5, at -O1+ :
(follow-up of pr79411.c)


$ cat z1.c
typedef struct __jmp_buf_tag { char buf[1024]; } jmp_buf[1];
extern int setjmp (jmp_buf);
extern int bar (unsigned int *);
extern jmp_buf *baz (void);
struct C { int c1; };
void foo (struct C *x, int *z, int e)
{
  unsigned int d = 0;
  long f;
  setjmp (*baz());
  f = 1 + ~d;
  d = 8;
  if ((!0) && !e && bar(z)) *z = 1 + f;
}


$ gcc-12-20220403 -c z1.c -O2

Unable to coalesce ssa_names 5 and 17 which are marked as MUST COALESCE.
d_5(ab) and  d_17(ab)
during RTL pass: expand
z1.c: In function 'foo':
z1.c:6:6: internal compiler error: SSA corruption
    6 | void foo (struct C *x, int *z, int e)
      |      ^~~
0xd18bc8 fail_abnormal_edge_coalesce
        ../../gcc/tree-ssa-coalesce.cc:1003
0xd18bc8 coalesce_partitions
        ../../gcc/tree-ssa-coalesce.cc:1425
0xd18bc8 coalesce_ssa_name(_var_map*)
        ../../gcc/tree-ssa-coalesce.cc:1755
0xcc26a0 remove_ssa_form
        ../../gcc/tree-outof-ssa.cc:1065
0xcc26a0 rewrite_out_of_ssa(ssaexpand*)
        ../../gcc/tree-outof-ssa.cc:1323
0x7cfa73 execute
        ../../gcc/cfgexpand.cc:6585

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

* [Bug c/105163] ICE: SSA corruption
  2022-04-05 16:16 [Bug c/105163] New: ICE: SSA corruption gscfq@t-online.de
@ 2022-04-05 16:17 ` gscfq@t-online.de
  2022-04-05 16:59 ` [Bug tree-optimization/105163] " jakub at gcc dot gnu.org
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: gscfq@t-online.de @ 2022-04-05 16:17 UTC (permalink / raw)
  To: gcc-bugs

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

G. Steinmetz <gscfq@t-online.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Target|                            |x86_64-pc-linux-gnu
           Keywords|                            |ice-on-valid-code

--- Comment #1 from G. Steinmetz <gscfq@t-online.de> ---


A corrupted variant starts to give an ICE between 20201018 and 20201108 :


$ cat z2.c
typedef struct __jmp_buf_tag { char buf[1024]; } jmp_buf[1];
extern int setjmp (jmp_buf);
extern jmp_buf *baz (void);
struct A { int b; };
void foo (struct A, int *z, int c)
{
  unsigned d = 0;
  long e;
  setjmp (*baz());
  e = 1 + ~d;
  d = 8;
  if ((!0) && !c && bar(z)) *z = 1 + e;
}

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

* [Bug tree-optimization/105163] ICE: SSA corruption
  2022-04-05 16:16 [Bug c/105163] New: ICE: SSA corruption gscfq@t-online.de
  2022-04-05 16:17 ` [Bug c/105163] " gscfq@t-online.de
@ 2022-04-05 16:59 ` jakub at gcc dot gnu.org
  2022-04-05 17:00 ` [Bug tree-optimization/105163] [9/10/11/12 Regression] ICE: SSA corruption since r0-122928 jakub at gcc dot gnu.org
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-04-05 16:59 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
#c0 started to ICE with r0-122928-gf6b64c35014ca111711e753be85bb99280a1e115
#c1 as well if you don't omit the argument name.

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

* [Bug tree-optimization/105163] [9/10/11/12 Regression] ICE: SSA corruption since r0-122928
  2022-04-05 16:16 [Bug c/105163] New: ICE: SSA corruption gscfq@t-online.de
  2022-04-05 16:17 ` [Bug c/105163] " gscfq@t-online.de
  2022-04-05 16:59 ` [Bug tree-optimization/105163] " jakub at gcc dot gnu.org
@ 2022-04-05 17:00 ` jakub at gcc dot gnu.org
  2022-04-06  7:15 ` rguenth at gcc dot gnu.org
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-04-05 17:00 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2022-04-05
     Ever confirmed|0                           |1
   Target Milestone|---                         |9.5
                 CC|                            |jakub at gcc dot gnu.org
            Summary|ICE: SSA corruption         |[9/10/11/12 Regression]
                   |                            |ICE: SSA corruption since
                   |                            |r0-122928
           Priority|P3                          |P2
             Status|UNCONFIRMED                 |NEW

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

* [Bug tree-optimization/105163] [9/10/11/12 Regression] ICE: SSA corruption since r0-122928
  2022-04-05 16:16 [Bug c/105163] New: ICE: SSA corruption gscfq@t-online.de
                   ` (2 preceding siblings ...)
  2022-04-05 17:00 ` [Bug tree-optimization/105163] [9/10/11/12 Regression] ICE: SSA corruption since r0-122928 jakub at gcc dot gnu.org
@ 2022-04-06  7:15 ` rguenth at gcc dot gnu.org
  2022-04-06  8:33 ` cvs-commit at gcc dot gnu.org
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-04-06  7:15 UTC (permalink / raw)
  To: gcc-bugs

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

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 #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
It's reassoc:

  <bb 5> [local count: 1072883005]:
  _1 = -d_4(ab);
  d_17(ab) = 8;
...

@@ -47,7 +61,7 @@
     goto <bb 9>; [50.00%]

   <bb 8> [local count: 176954885]:
-  _2 = _1 + 1;
+  _2 = 1 - d_4(ab);
   _3 = (int) _2;
   *z_19(D) = _3;

and that via negate propagation I guess.

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

* [Bug tree-optimization/105163] [9/10/11/12 Regression] ICE: SSA corruption since r0-122928
  2022-04-05 16:16 [Bug c/105163] New: ICE: SSA corruption gscfq@t-online.de
                   ` (3 preceding siblings ...)
  2022-04-06  7:15 ` rguenth at gcc dot gnu.org
@ 2022-04-06  8:33 ` cvs-commit at gcc dot gnu.org
  2022-05-19 14:03 ` [Bug tree-optimization/105163] [9/10/11 " cvs-commit at gcc dot gnu.org
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-04-06  8:33 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from CVS 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:44fe49401725055a740ce47e80561b6932b8cd01

commit r12-8018-g44fe49401725055a740ce47e80561b6932b8cd01
Author: Richard Biener <rguenther@suse.de>
Date:   Wed Apr 6 09:36:38 2022 +0200

    tree-optimization/105163 - abnormal SSA coalescing and reassoc

    The negate propagation optimizations in reassoc did not look out for
    abnormal SSA coalescing issues.  The following fixes that.

    2022-04-06  Richard Biener  <rguenther@suse.de>

            PR tree-optimization/105163
            * tree-ssa-reassoc.cc (repropagate_negates): Avoid propagating
            negated abnormals.

            * gcc.dg/torture/pr105163.c: New testcase.

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

* [Bug tree-optimization/105163] [9/10/11 Regression] ICE: SSA corruption since r0-122928
  2022-04-05 16:16 [Bug c/105163] New: ICE: SSA corruption gscfq@t-online.de
                   ` (4 preceding siblings ...)
  2022-04-06  8:33 ` cvs-commit at gcc dot gnu.org
@ 2022-05-19 14:03 ` cvs-commit at gcc dot gnu.org
  2022-05-27  9:47 ` [Bug tree-optimization/105163] [10 " rguenth at gcc dot gnu.org
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-05-19 14:03 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-11 branch has been updated by Richard Biener
<rguenth@gcc.gnu.org>:

https://gcc.gnu.org/g:132c3bb06a90887f5c173e00b7f2c5163e054ac1

commit r11-10015-g132c3bb06a90887f5c173e00b7f2c5163e054ac1
Author: Richard Biener <rguenther@suse.de>
Date:   Wed Apr 6 09:36:38 2022 +0200

    tree-optimization/105163 - abnormal SSA coalescing and reassoc

    The negate propagation optimizations in reassoc did not look out for
    abnormal SSA coalescing issues.  The following fixes that.

    2022-04-06  Richard Biener  <rguenther@suse.de>

            PR tree-optimization/105163
            * tree-ssa-reassoc.c (repropagate_negates): Avoid propagating
            negated abnormals.

            * gcc.dg/torture/pr105163.c: New testcase.

    (cherry picked from commit 44fe49401725055a740ce47e80561b6932b8cd01)

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

* [Bug tree-optimization/105163] [10 Regression] ICE: SSA corruption since r0-122928
  2022-04-05 16:16 [Bug c/105163] New: ICE: SSA corruption gscfq@t-online.de
                   ` (5 preceding siblings ...)
  2022-05-19 14:03 ` [Bug tree-optimization/105163] [9/10/11 " cvs-commit at gcc dot gnu.org
@ 2022-05-27  9:47 ` rguenth at gcc dot gnu.org
  2022-05-27 13:15 ` cvs-commit at gcc dot gnu.org
  2022-05-27 13:18 ` rguenth at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-05-27  9:47 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|9.5                         |10.4

--- Comment #6 from Richard Biener <rguenth at gcc dot gnu.org> ---
GCC 9 branch is being closed

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

* [Bug tree-optimization/105163] [10 Regression] ICE: SSA corruption since r0-122928
  2022-04-05 16:16 [Bug c/105163] New: ICE: SSA corruption gscfq@t-online.de
                   ` (6 preceding siblings ...)
  2022-05-27  9:47 ` [Bug tree-optimization/105163] [10 " rguenth at gcc dot gnu.org
@ 2022-05-27 13:15 ` cvs-commit at gcc dot gnu.org
  2022-05-27 13:18 ` rguenth at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-05-27 13:15 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

commit r10-10767-gbdfe7e5510b28c3ab8f8cd0fd7f715f2da3af938
Author: Richard Biener <rguenther@suse.de>
Date:   Wed Apr 6 09:36:38 2022 +0200

    tree-optimization/105163 - abnormal SSA coalescing and reassoc

    The negate propagation optimizations in reassoc did not look out for
    abnormal SSA coalescing issues.  The following fixes that.

    2022-04-06  Richard Biener  <rguenther@suse.de>

            PR tree-optimization/105163
            * tree-ssa-reassoc.c (repropagate_negates): Avoid propagating
            negated abnormals.

            * gcc.dg/torture/pr105163.c: New testcase.

    (cherry picked from commit 44fe49401725055a740ce47e80561b6932b8cd01)

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

* [Bug tree-optimization/105163] [10 Regression] ICE: SSA corruption since r0-122928
  2022-04-05 16:16 [Bug c/105163] New: ICE: SSA corruption gscfq@t-online.de
                   ` (7 preceding siblings ...)
  2022-05-27 13:15 ` cvs-commit at gcc dot gnu.org
@ 2022-05-27 13:18 ` rguenth at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-05-27 13:18 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to work|                            |10.3.1
         Resolution|---                         |FIXED
      Known to fail|                            |10.3.0
             Status|ASSIGNED                    |RESOLVED

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

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

end of thread, other threads:[~2022-05-27 13:18 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-05 16:16 [Bug c/105163] New: ICE: SSA corruption gscfq@t-online.de
2022-04-05 16:17 ` [Bug c/105163] " gscfq@t-online.de
2022-04-05 16:59 ` [Bug tree-optimization/105163] " jakub at gcc dot gnu.org
2022-04-05 17:00 ` [Bug tree-optimization/105163] [9/10/11/12 Regression] ICE: SSA corruption since r0-122928 jakub at gcc dot gnu.org
2022-04-06  7:15 ` rguenth at gcc dot gnu.org
2022-04-06  8:33 ` cvs-commit at gcc dot gnu.org
2022-05-19 14:03 ` [Bug tree-optimization/105163] [9/10/11 " cvs-commit at gcc dot gnu.org
2022-05-27  9:47 ` [Bug tree-optimization/105163] [10 " rguenth at gcc dot gnu.org
2022-05-27 13:15 ` cvs-commit at gcc dot gnu.org
2022-05-27 13:18 ` 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).