public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/95804] New: ice in generate_code_for_partition, at tree-loop-distribution.c:1323
@ 2020-06-21 19:40 dcb314 at hotmail dot com
  2020-06-22  8:48 ` [Bug tree-optimization/95804] " rguenth at gcc dot gnu.org
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: dcb314 at hotmail dot com @ 2020-06-21 19:40 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 95804
           Summary: ice in generate_code_for_partition, at
                    tree-loop-distribution.c:1323
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: dcb314 at hotmail dot com
  Target Milestone: ---

This C source code:

int a, b, c, e;
int *d;
void f() {
  int g;
  int *h;
  for (; b; b++) {
    for (; c; c++)
      ;
    e = *d || *h;
    for (; a; a++)
      h = g;
  }
  for (; e;)
    ;
}

on recent gcc trunk with compiler flag -O3 on x86_64, does this:

$ /home/dcb/gcc/results/bin/gcc -c -w -O3 bug624.c
during GIMPLE pass: ldist
bug624.c: In function ‘f’:
bug624.c:3:6: internal compiler error: in generate_code_for_partition, at
tree-loop-distribution.c:1323
    3 | void f() {
      |      ^
0x85d652 generate_code_for_partition
        ../../trunk.git/gcc/tree-loop-distribution.c:1323
0x3343807 loop_distribution::distribute_loop(loop*, vec<gimple*, va_heap,
vl_ptr>, control_dependences*, int*, bool*, bool)
        ../../trunk.git/gcc/tree-loop-distribution.c:3114
0x334a754 loop_distribution::execute(function*)
        ../../trunk.git/gcc/tree-loop-distribution.c:3303
0x334e075 execute
        ../../trunk.git/gcc/tree-loop-distribution.c:3391

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

* [Bug tree-optimization/95804] ice in generate_code_for_partition, at tree-loop-distribution.c:1323
  2020-06-21 19:40 [Bug c/95804] New: ice in generate_code_for_partition, at tree-loop-distribution.c:1323 dcb314 at hotmail dot com
@ 2020-06-22  8:48 ` rguenth at gcc dot gnu.org
  2020-06-22  9:06 ` amker at gcc dot gnu.org
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu.org @ 2020-06-22  8:48 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Version|unknown                     |11.0
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2020-06-22
           Keywords|                            |needs-bisection
          Component|target                      |tree-optimization
                 CC|                            |amker at gcc dot gnu.org,
                   |                            |rguenth at gcc dot gnu.org
     Ever confirmed|0                           |1

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
Confirmed.  We seem to end up with a reduction partition not in the last
position thus miss some required partition merging.

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

* [Bug tree-optimization/95804] ice in generate_code_for_partition, at tree-loop-distribution.c:1323
  2020-06-21 19:40 [Bug c/95804] New: ice in generate_code_for_partition, at tree-loop-distribution.c:1323 dcb314 at hotmail dot com
  2020-06-22  8:48 ` [Bug tree-optimization/95804] " rguenth at gcc dot gnu.org
@ 2020-06-22  9:06 ` amker at gcc dot gnu.org
  2020-06-22 15:26 ` dcb314 at hotmail dot com
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: amker at gcc dot gnu.org @ 2020-06-22  9:06 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from bin cheng <amker at gcc dot gnu.org> ---
(In reply to Richard Biener from comment #1)
> Confirmed.  We seem to end up with a reduction partition not in the last
> position thus miss some required partition merging.
Sorry for the breakage.

Whew, this part IS can of worms.  Will investigate it.

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

* [Bug tree-optimization/95804] ice in generate_code_for_partition, at tree-loop-distribution.c:1323
  2020-06-21 19:40 [Bug c/95804] New: ice in generate_code_for_partition, at tree-loop-distribution.c:1323 dcb314 at hotmail dot com
  2020-06-22  8:48 ` [Bug tree-optimization/95804] " rguenth at gcc dot gnu.org
  2020-06-22  9:06 ` amker at gcc dot gnu.org
@ 2020-06-22 15:26 ` dcb314 at hotmail dot com
  2020-06-25  6:07 ` [Bug tree-optimization/95804] [11 Regression] ICE in generate_code_for_partition, at tree-loop-distribution.c:1323 since r11-1565-g2c0069fafb53ccb7 marxin at gcc dot gnu.org
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: dcb314 at hotmail dot com @ 2020-06-22 15:26 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from David Binderman <dcb314 at hotmail dot com> ---
(In reply to bin cheng from comment #2)
> Whew, this part IS can of worms.  Will investigate it.

Great. The testcase I provided came from a C source code generator
called ccg. 

Here is another C test case which produces the same compiler crash with -O3:

$ more bug625.c
int a, b, c, d, e, f;
void g() {
  short *h = d;
  char *i = &b;
  for (; e; e++) {
    for (; f; f++) {
      b = 3;
      if ((c = 8) >= *i)
        a = 5 ? *h : 0;
      h = g;
    }
    i = &c;
  }
}

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

* [Bug tree-optimization/95804] [11 Regression] ICE in generate_code_for_partition, at tree-loop-distribution.c:1323 since r11-1565-g2c0069fafb53ccb7
  2020-06-21 19:40 [Bug c/95804] New: ice in generate_code_for_partition, at tree-loop-distribution.c:1323 dcb314 at hotmail dot com
                   ` (2 preceding siblings ...)
  2020-06-22 15:26 ` dcb314 at hotmail dot com
@ 2020-06-25  6:07 ` marxin at gcc dot gnu.org
  2020-07-08 17:56 ` marxin at gcc dot gnu.org
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: marxin at gcc dot gnu.org @ 2020-06-25  6:07 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|needs-bisection             |
            Summary|ice in                      |[11 Regression] ICE in
                   |generate_code_for_partition |generate_code_for_partition
                   |, at                        |, at
                   |tree-loop-distribution.c:13 |tree-loop-distribution.c:13
                   |23                          |23 since
                   |                            |r11-1565-g2c0069fafb53ccb7
             Blocks|                            |26163
                 CC|                            |marxin at gcc dot gnu.org

--- Comment #4 from Martin Liška <marxin at gcc dot gnu.org> ---
Started with r11-1565-g2c0069fafb53ccb7. I see it failing in blender SPEC
benchmark.


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=26163
[Bug 26163] [meta-bug] missed optimization in SPEC (2k17, 2k and 2k6 and 95)

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

* [Bug tree-optimization/95804] [11 Regression] ICE in generate_code_for_partition, at tree-loop-distribution.c:1323 since r11-1565-g2c0069fafb53ccb7
  2020-06-21 19:40 [Bug c/95804] New: ice in generate_code_for_partition, at tree-loop-distribution.c:1323 dcb314 at hotmail dot com
                   ` (3 preceding siblings ...)
  2020-06-25  6:07 ` [Bug tree-optimization/95804] [11 Regression] ICE in generate_code_for_partition, at tree-loop-distribution.c:1323 since r11-1565-g2c0069fafb53ccb7 marxin at gcc dot gnu.org
@ 2020-07-08 17:56 ` marxin at gcc dot gnu.org
  2020-07-09  1:50 ` amker at gcc dot gnu.org
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: marxin at gcc dot gnu.org @ 2020-07-08 17:56 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Martin Liška <marxin at gcc dot gnu.org> ---
@Bin: Any news about this?

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

* [Bug tree-optimization/95804] [11 Regression] ICE in generate_code_for_partition, at tree-loop-distribution.c:1323 since r11-1565-g2c0069fafb53ccb7
  2020-06-21 19:40 [Bug c/95804] New: ice in generate_code_for_partition, at tree-loop-distribution.c:1323 dcb314 at hotmail dot com
                   ` (4 preceding siblings ...)
  2020-07-08 17:56 ` marxin at gcc dot gnu.org
@ 2020-07-09  1:50 ` amker at gcc dot gnu.org
  2020-07-09 10:29 ` cvs-commit at gcc dot gnu.org
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: amker at gcc dot gnu.org @ 2020-07-09  1:50 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from bin cheng <amker at gcc dot gnu.org> ---
(In reply to Martin Liška from comment #5)
> @Bin: Any news about this?

Patch is approved, will apply soon.  Thanks

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

* [Bug tree-optimization/95804] [11 Regression] ICE in generate_code_for_partition, at tree-loop-distribution.c:1323 since r11-1565-g2c0069fafb53ccb7
  2020-06-21 19:40 [Bug c/95804] New: ice in generate_code_for_partition, at tree-loop-distribution.c:1323 dcb314 at hotmail dot com
                   ` (5 preceding siblings ...)
  2020-07-09  1:50 ` amker at gcc dot gnu.org
@ 2020-07-09 10:29 ` cvs-commit at gcc dot gnu.org
  2020-07-09 11:47 ` rguenth at gcc dot gnu.org
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-07-09 10:29 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Bin Cheng <amker@gcc.gnu.org>:

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

commit r11-1968-gdd21b03900085c4d60bf03207ad28bcbfbc86a4b
Author: Bin Cheng <bin.cheng@linux.alibaba.com>
Date:   Thu Jul 9 18:10:03 2020 +0800

    Schedule reduction partition in the last.

    If reduction partition's SCC is broken by runtime alias checks, force
    a negative post order to it so that it will be scheduled in the last.

    2020-07-09  Bin Cheng  <bin.cheng@linux.alibaba.com>

    gcc/
            PR tree-optimization/95804
            * tree-loop-distribution.c (break_alias_scc_partitions): Force
            negative post order to reduction partition.

    gcc/testsuite/
            PR tree-optimization/95804
            * gcc.dg/tree-ssa/pr95804.c: New test.

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

* [Bug tree-optimization/95804] [11 Regression] ICE in generate_code_for_partition, at tree-loop-distribution.c:1323 since r11-1565-g2c0069fafb53ccb7
  2020-06-21 19:40 [Bug c/95804] New: ice in generate_code_for_partition, at tree-loop-distribution.c:1323 dcb314 at hotmail dot com
                   ` (6 preceding siblings ...)
  2020-07-09 10:29 ` cvs-commit at gcc dot gnu.org
@ 2020-07-09 11:47 ` rguenth at gcc dot gnu.org
  2020-07-10  4:03 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu.org @ 2020-07-09 11:47 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Blocks|                            |95638
             Status|NEW                         |RESOLVED
   Target Milestone|---                         |11.0
         Resolution|---                         |FIXED

--- Comment #8 from Richard Biener <rguenth at gcc dot gnu.org> ---
Fixed - note it needs to be backported when the PR95638 fix is backported.


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95638
[Bug 95638] [10/11 Regression] Legit-looking code doesn't work with -O2

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

* [Bug tree-optimization/95804] [11 Regression] ICE in generate_code_for_partition, at tree-loop-distribution.c:1323 since r11-1565-g2c0069fafb53ccb7
  2020-06-21 19:40 [Bug c/95804] New: ice in generate_code_for_partition, at tree-loop-distribution.c:1323 dcb314 at hotmail dot com
                   ` (7 preceding siblings ...)
  2020-07-09 11:47 ` rguenth at gcc dot gnu.org
@ 2020-07-10  4:03 ` cvs-commit at gcc dot gnu.org
  2020-07-10  4:12 ` cvs-commit at gcc dot gnu.org
  2020-07-10  5:12 ` amker at gcc dot gnu.org
  10 siblings, 0 replies; 12+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-07-10  4:03 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #9 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-10 branch has been updated by Bin Cheng <amker@gcc.gnu.org>:

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

commit r10-8454-gc7247272375899af51726df8424e911f00374200
Author: Bin Cheng <bin.cheng@linux.alibaba.com>
Date:   Thu Jul 9 18:10:03 2020 +0800

    Schedule reduction partition in the last.

    If reduction partition's SCC is broken by runtime alias checks, force
    a negative post order to it so that it will be scheduled in the last.

    2020-07-09  Bin Cheng  <bin.cheng@linux.alibaba.com>

    gcc/
            PR tree-optimization/95804
            * tree-loop-distribution.c (break_alias_scc_partitions): Force
            negative post order to reduction partition.

    gcc/testsuite/
            PR tree-optimization/95804
            * gcc.dg/tree-ssa/pr95804.c: New test.

    (cherry picked from commit dd21b03900085c4d60bf03207ad28bcbfbc86a4b)

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

* [Bug tree-optimization/95804] [11 Regression] ICE in generate_code_for_partition, at tree-loop-distribution.c:1323 since r11-1565-g2c0069fafb53ccb7
  2020-06-21 19:40 [Bug c/95804] New: ice in generate_code_for_partition, at tree-loop-distribution.c:1323 dcb314 at hotmail dot com
                   ` (8 preceding siblings ...)
  2020-07-10  4:03 ` cvs-commit at gcc dot gnu.org
@ 2020-07-10  4:12 ` cvs-commit at gcc dot gnu.org
  2020-07-10  5:12 ` amker at gcc dot gnu.org
  10 siblings, 0 replies; 12+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-07-10  4:12 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #10 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-9 branch has been updated by Bin Cheng <amker@gcc.gnu.org>:

https://gcc.gnu.org/g:8c25c91b117d814cf5c1deffd8a79b03fce68621

commit r9-8731-g8c25c91b117d814cf5c1deffd8a79b03fce68621
Author: Bin Cheng <bin.cheng@linux.alibaba.com>
Date:   Thu Jul 9 18:10:03 2020 +0800

    Schedule reduction partition in the last.

    If reduction partition's SCC is broken by runtime alias checks, force
    a negative post order to it so that it will be scheduled in the last.

    2020-07-09  Bin Cheng  <bin.cheng@linux.alibaba.com>

    gcc/
            PR tree-optimization/95804
            * tree-loop-distribution.c (break_alias_scc_partitions): Force
            negative post order to reduction partition.

    gcc/testsuite/
            PR tree-optimization/95804
            * gcc.dg/tree-ssa/pr95804.c: New test.

    (cherry picked from commit dd21b03900085c4d60bf03207ad28bcbfbc86a4b)

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

* [Bug tree-optimization/95804] [11 Regression] ICE in generate_code_for_partition, at tree-loop-distribution.c:1323 since r11-1565-g2c0069fafb53ccb7
  2020-06-21 19:40 [Bug c/95804] New: ice in generate_code_for_partition, at tree-loop-distribution.c:1323 dcb314 at hotmail dot com
                   ` (9 preceding siblings ...)
  2020-07-10  4:12 ` cvs-commit at gcc dot gnu.org
@ 2020-07-10  5:12 ` amker at gcc dot gnu.org
  10 siblings, 0 replies; 12+ messages in thread
From: amker at gcc dot gnu.org @ 2020-07-10  5:12 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #11 from bin cheng <amker at gcc dot gnu.org> ---
(In reply to Richard Biener from comment #8)
> Fixed - note it needs to be backported when the PR95638 fix is backported.

I backported PR95638/PR95804 to GCC-10/GCC-9 branches.  However, unnecessary to
backport to GCC-8, because the starting issue (pr94125) is not exposed on it.

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

end of thread, other threads:[~2020-07-10  5:12 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-21 19:40 [Bug c/95804] New: ice in generate_code_for_partition, at tree-loop-distribution.c:1323 dcb314 at hotmail dot com
2020-06-22  8:48 ` [Bug tree-optimization/95804] " rguenth at gcc dot gnu.org
2020-06-22  9:06 ` amker at gcc dot gnu.org
2020-06-22 15:26 ` dcb314 at hotmail dot com
2020-06-25  6:07 ` [Bug tree-optimization/95804] [11 Regression] ICE in generate_code_for_partition, at tree-loop-distribution.c:1323 since r11-1565-g2c0069fafb53ccb7 marxin at gcc dot gnu.org
2020-07-08 17:56 ` marxin at gcc dot gnu.org
2020-07-09  1:50 ` amker at gcc dot gnu.org
2020-07-09 10:29 ` cvs-commit at gcc dot gnu.org
2020-07-09 11:47 ` rguenth at gcc dot gnu.org
2020-07-10  4:03 ` cvs-commit at gcc dot gnu.org
2020-07-10  4:12 ` cvs-commit at gcc dot gnu.org
2020-07-10  5:12 ` amker 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).