public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug rtl-optimization/46829] New: ICE: in spill_failure, at reload1.c:2105 with -fschedule-insns -fsched-pressure and variadic function
@ 2010-12-06 20:59 zsojka at seznam dot cz
  2010-12-06 21:53 ` [Bug rtl-optimization/46829] " hjl.tools at gmail dot com
                   ` (12 more replies)
  0 siblings, 13 replies; 14+ messages in thread
From: zsojka at seznam dot cz @ 2010-12-06 20:59 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46829

           Summary: ICE: in spill_failure, at reload1.c:2105 with
                    -fschedule-insns -fsched-pressure and variadic
                    function
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: rtl-optimization
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: zsojka@seznam.cz
              Host: x86_64-pc-linux-gnu
            Target: x86_64-pc-linux-gnu


Created attachment 22663
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=22663
reduced testcase

Compiler flags:
gcc -O[123] -fschedule-insns -fsched-pressure

Compiler output:
$ gcc -O -fschedule-insns -fsched-pressure pr46829.c 
pr46829.c: In function 'foo':
pr46829.c:15:1: error: unable to find a register to spill in class 'AREG'
pr46829.c:15:1: error: this is the insn:
(insn 16 21 18 4 (parallel [
            (set (reg:SI 37 r8)
                (div:SI (reg:SI 37 r8 [orig:59 D.2694 ] [59])
                    (reg:SI 38 r9 [orig:60 D.2695 ] [60])))
            (set (reg:SI 1 dx [69])
                (mod:SI (reg:SI 37 r8 [orig:59 D.2694 ] [59])
                    (reg:SI 38 r9 [orig:60 D.2695 ] [60])))
            (clobber (reg:CC 17 flags))
        ]) pr46829.c:14 353 {*divmodsi4}
     (expr_list:REG_DEAD (reg:SI 37 r8 [orig:59 D.2694 ] [59])
        (expr_list:REG_UNUSED (reg:SI 1 dx [69])
            (expr_list:REG_UNUSED (reg:CC 17 flags)
                (nil)))))
pr46829.c:15:1: internal compiler error: in spill_failure, at reload1.c:2105
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

Tested revisions:
r167471 - crash
4.5.1 - crash


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

* [Bug rtl-optimization/46829] ICE: in spill_failure, at reload1.c:2105 with -fschedule-insns -fsched-pressure and variadic function
  2010-12-06 20:59 [Bug rtl-optimization/46829] New: ICE: in spill_failure, at reload1.c:2105 with -fschedule-insns -fsched-pressure and variadic function zsojka at seznam dot cz
@ 2010-12-06 21:53 ` hjl.tools at gmail dot com
  2010-12-06 22:17 ` zsojka at seznam dot cz
                   ` (11 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: hjl.tools at gmail dot com @ 2010-12-06 21:53 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46829

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2010.12.06 21:53:26
     Ever Confirmed|0                           |1

--- Comment #1 from H.J. Lu <hjl.tools at gmail dot com> 2010-12-06 21:53:26 UTC ---
Confirmed with revision 167517.


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

* [Bug rtl-optimization/46829] ICE: in spill_failure, at reload1.c:2105 with -fschedule-insns -fsched-pressure and variadic function
  2010-12-06 20:59 [Bug rtl-optimization/46829] New: ICE: in spill_failure, at reload1.c:2105 with -fschedule-insns -fsched-pressure and variadic function zsojka at seznam dot cz
  2010-12-06 21:53 ` [Bug rtl-optimization/46829] " hjl.tools at gmail dot com
@ 2010-12-06 22:17 ` zsojka at seznam dot cz
  2010-12-06 22:41 ` changpeng.fang at amd dot com
                   ` (10 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: zsojka at seznam dot cz @ 2010-12-06 22:17 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46829

--- Comment #2 from Zdenek Sojka <zsojka at seznam dot cz> 2010-12-06 22:17:44 UTC ---
This ICE is quite unlucky, it happened in 3rd package I tried to compile - now
I have compiled 70 packages since then, and this is still the only occurence.

(don't get me wrong, I really admire the work done in scheduling! -and in fact,
in all of gcc)


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

* [Bug rtl-optimization/46829] ICE: in spill_failure, at reload1.c:2105 with -fschedule-insns -fsched-pressure and variadic function
  2010-12-06 20:59 [Bug rtl-optimization/46829] New: ICE: in spill_failure, at reload1.c:2105 with -fschedule-insns -fsched-pressure and variadic function zsojka at seznam dot cz
  2010-12-06 21:53 ` [Bug rtl-optimization/46829] " hjl.tools at gmail dot com
  2010-12-06 22:17 ` zsojka at seznam dot cz
@ 2010-12-06 22:41 ` changpeng.fang at amd dot com
  2010-12-06 22:52 ` hjl.tools at gmail dot com
                   ` (9 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: changpeng.fang at amd dot com @ 2010-12-06 22:41 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46829

Changpeng Fang <changpeng.fang at amd dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |changpeng.fang at amd dot
                   |                            |com

--- Comment #3 from Changpeng Fang <changpeng.fang at amd dot com> 2010-12-06 22:41:29 UTC ---
Actually, I have opened bug 46793 last week, and it seems to be the same bug.
Bug 46793 has been marked as WONTFIX.


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

* [Bug rtl-optimization/46829] ICE: in spill_failure, at reload1.c:2105 with -fschedule-insns -fsched-pressure and variadic function
  2010-12-06 20:59 [Bug rtl-optimization/46829] New: ICE: in spill_failure, at reload1.c:2105 with -fschedule-insns -fsched-pressure and variadic function zsojka at seznam dot cz
                   ` (2 preceding siblings ...)
  2010-12-06 22:41 ` changpeng.fang at amd dot com
@ 2010-12-06 22:52 ` hjl.tools at gmail dot com
  2010-12-07 11:22 ` rguenth at gcc dot gnu.org
                   ` (8 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: hjl.tools at gmail dot com @ 2010-12-06 22:52 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46829

--- Comment #4 from H.J. Lu <hjl.tools at gmail dot com> 2010-12-06 22:52:04 UTC ---
(In reply to comment #3)
> Actually, I have opened bug 46793 last week, and it seems to be the same bug.
> Bug 46793 has been marked as WONTFIX.

No, it isn't. -fschedule-insns is bad for x86. "-fschedule-insns
-fsched-pressure"
should work.


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

* [Bug rtl-optimization/46829] ICE: in spill_failure, at reload1.c:2105 with -fschedule-insns -fsched-pressure and variadic function
  2010-12-06 20:59 [Bug rtl-optimization/46829] New: ICE: in spill_failure, at reload1.c:2105 with -fschedule-insns -fsched-pressure and variadic function zsojka at seznam dot cz
                   ` (3 preceding siblings ...)
  2010-12-06 22:52 ` hjl.tools at gmail dot com
@ 2010-12-07 11:22 ` rguenth at gcc dot gnu.org
  2010-12-07 17:34 ` zsojka at seznam dot cz
                   ` (7 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: rguenth at gcc dot gnu.org @ 2010-12-07 11:22 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46829

--- Comment #5 from Richard Guenther <rguenth at gcc dot gnu.org> 2010-12-07 11:21:45 UTC ---
It should work for x86_64, not necessarily i?86.


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

* [Bug rtl-optimization/46829] ICE: in spill_failure, at reload1.c:2105 with -fschedule-insns -fsched-pressure and variadic function
  2010-12-06 20:59 [Bug rtl-optimization/46829] New: ICE: in spill_failure, at reload1.c:2105 with -fschedule-insns -fsched-pressure and variadic function zsojka at seznam dot cz
                   ` (4 preceding siblings ...)
  2010-12-07 11:22 ` rguenth at gcc dot gnu.org
@ 2010-12-07 17:34 ` zsojka at seznam dot cz
  2010-12-07 22:42 ` changpeng.fang at amd dot com
                   ` (6 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: zsojka at seznam dot cz @ 2010-12-07 17:34 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46829

--- Comment #6 from Zdenek Sojka <zsojka at seznam dot cz> 2010-12-07 17:34:01 UTC ---
Created attachment 22674
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=22674
different testcase

A bit different testcase

$ gcc -O -fschedule-insns -fsched-pressure pr46829-2.c 
pr46829-2.c: In function 'foo':
pr46829-2.c:10:1: error: unable to find a register to spill in class 'AREG'
pr46829-2.c:10:1: error: this is the insn:
(insn 8 13 9 2 (parallel [
            (set (reg:SI 37 r8)
                (div:SI (reg:SI 2 cx [orig:59 b.0 ] [59])
                    (reg:SI 38 r9 [orig:60 a.1 ] [60])))
            (set (reg:SI 1 dx [66])
                (mod:SI (reg:SI 2 cx [orig:59 b.0 ] [59])
                    (reg:SI 38 r9 [orig:60 a.1 ] [60])))
            (clobber (reg:CC 17 flags))
        ]) pr46829-2.c:8 353 {*divmodsi4}
     (expr_list:REG_UNUSED (reg:SI 1 dx [66])
        (expr_list:REG_UNUSED (reg:CC 17 flags)
            (nil))))
pr46829-2.c:10:1: internal compiler error: in spill_failure, at reload1.c:2105
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.


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

* [Bug rtl-optimization/46829] ICE: in spill_failure, at reload1.c:2105 with -fschedule-insns -fsched-pressure and variadic function
  2010-12-06 20:59 [Bug rtl-optimization/46829] New: ICE: in spill_failure, at reload1.c:2105 with -fschedule-insns -fsched-pressure and variadic function zsojka at seznam dot cz
                   ` (5 preceding siblings ...)
  2010-12-07 17:34 ` zsojka at seznam dot cz
@ 2010-12-07 22:42 ` changpeng.fang at amd dot com
  2010-12-07 23:54 ` hjl.tools at gmail dot com
                   ` (5 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: changpeng.fang at amd dot com @ 2010-12-07 22:42 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46829

--- Comment #7 from Changpeng Fang <changpeng.fang at amd dot com> 2010-12-07 22:42:26 UTC ---
If you compile with dispatch scheduling enabled (together with -march=bdver1),
both test cases attached PASS.

gcc -O2 -fschedule-insns -fsched-pressure -mdispatch-scheduler -march=bdver1


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

* [Bug rtl-optimization/46829] ICE: in spill_failure, at reload1.c:2105 with -fschedule-insns -fsched-pressure and variadic function
  2010-12-06 20:59 [Bug rtl-optimization/46829] New: ICE: in spill_failure, at reload1.c:2105 with -fschedule-insns -fsched-pressure and variadic function zsojka at seznam dot cz
                   ` (6 preceding siblings ...)
  2010-12-07 22:42 ` changpeng.fang at amd dot com
@ 2010-12-07 23:54 ` hjl.tools at gmail dot com
  2010-12-09 19:17 ` changpeng.fang at amd dot com
                   ` (4 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: hjl.tools at gmail dot com @ 2010-12-07 23:54 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46829

--- Comment #8 from H.J. Lu <hjl.tools at gmail dot com> 2010-12-07 23:54:42 UTC ---
(In reply to comment #7)
> If you compile with dispatch scheduling enabled (together with -march=bdver1),
> both test cases attached PASS.
> 
> gcc -O2 -fschedule-insns -fsched-pressure -mdispatch-scheduler -march=bdver1

You can turn it on for -march=bdver1.


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

* [Bug rtl-optimization/46829] ICE: in spill_failure, at reload1.c:2105 with -fschedule-insns -fsched-pressure and variadic function
  2010-12-06 20:59 [Bug rtl-optimization/46829] New: ICE: in spill_failure, at reload1.c:2105 with -fschedule-insns -fsched-pressure and variadic function zsojka at seznam dot cz
                   ` (7 preceding siblings ...)
  2010-12-07 23:54 ` hjl.tools at gmail dot com
@ 2010-12-09 19:17 ` changpeng.fang at amd dot com
  2010-12-10 15:45 ` vmakarov at redhat dot com
                   ` (3 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: changpeng.fang at amd dot com @ 2010-12-09 19:17 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46829

Changpeng Fang <changpeng.fang at amd dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |vmakarov at redhat dot com

--- Comment #9 from Changpeng Fang <changpeng.fang at amd dot com> 2010-12-09 19:16:57 UTC ---
(In reply to comment #5)
> It should work for x86_64, not necessarily i?86.

Do you mean -fsched-pressure should be able to solve the problem completely
for x86-64?

Vladimir: Do you have any idea which direction to go in order to solve this
problem?


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

* [Bug rtl-optimization/46829] ICE: in spill_failure, at reload1.c:2105 with -fschedule-insns -fsched-pressure and variadic function
  2010-12-06 20:59 [Bug rtl-optimization/46829] New: ICE: in spill_failure, at reload1.c:2105 with -fschedule-insns -fsched-pressure and variadic function zsojka at seznam dot cz
                   ` (8 preceding siblings ...)
  2010-12-09 19:17 ` changpeng.fang at amd dot com
@ 2010-12-10 15:45 ` vmakarov at redhat dot com
  2012-08-17 18:39 ` ubizjak at gmail dot com
                   ` (2 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: vmakarov at redhat dot com @ 2010-12-10 15:45 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46829

--- Comment #10 from Vladimir Makarov <vmakarov at redhat dot com> 2010-12-10 15:45:33 UTC ---
(In reply to comment #9)
> (In reply to comment #5)
> > It should work for x86_64, not necessarily i?86.
> 
> Do you mean -fsched-pressure should be able to solve the problem completely
> for x86-64?
> 
> Vladimir: Do you have any idea which direction to go in order to solve this
> problem?

Introducing of -fsched-pressure just decreased probability of the bug when 1st
insn scheduling is used.  The patch introducing -fsched-pressure contained some
code in reload to decrease the probability even more.

Unfortunately, it did not eliminated it fully.  This bug can not be fixed in
scheduler (or the solution, like not moving through insn referring for a hard
register, will be too conservative especially for x86_64 and still will not fix
it for x86) because the scheduler can not see all info handled by reload.

IMHO, the right fix should be possibility to split live ranges for explicitly
mentioned hard register.  May be Jeff Law's current work will provide such
feature.

In any case, implementation of live range splitting in reload is too big and
complicated job even for stage #1.  There is no way to implement it at stage
#3.  It is also very unreasonable thing to do because any change in reload is
usually very bug prone.

I am sorry, but I don't see that it can be fixed for gcc4.6 fox x86/x86-64. 
Although it might be fixed for gcc4.7.


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

* [Bug rtl-optimization/46829] ICE: in spill_failure, at reload1.c:2105 with -fschedule-insns -fsched-pressure and variadic function
  2010-12-06 20:59 [Bug rtl-optimization/46829] New: ICE: in spill_failure, at reload1.c:2105 with -fschedule-insns -fsched-pressure and variadic function zsojka at seznam dot cz
                   ` (9 preceding siblings ...)
  2010-12-10 15:45 ` vmakarov at redhat dot com
@ 2012-08-17 18:39 ` ubizjak at gmail dot com
  2012-09-01 14:31 ` uros at gcc dot gnu.org
  2012-09-05  8:21 ` [Bug target/46829] " ubizjak at gmail dot com
  12 siblings, 0 replies; 14+ messages in thread
From: ubizjak at gmail dot com @ 2012-08-17 18:39 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46829

Uros Bizjak <ubizjak at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
                URL|                            |http://gcc.gnu.org/ml/gcc-p
                   |                            |atches/2012-08/msg01202.htm
                   |                            |l
         AssignedTo|unassigned at gcc dot       |ubizjak at gmail dot com
                   |gnu.org                     |

--- Comment #11 from Uros Bizjak <ubizjak at gmail dot com> 2012-08-17 18:37:44 UTC ---
Patch at [1].

[1] http://gcc.gnu.org/ml/gcc-patches/2012-08/msg01202.html


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

* [Bug rtl-optimization/46829] ICE: in spill_failure, at reload1.c:2105 with -fschedule-insns -fsched-pressure and variadic function
  2010-12-06 20:59 [Bug rtl-optimization/46829] New: ICE: in spill_failure, at reload1.c:2105 with -fschedule-insns -fsched-pressure and variadic function zsojka at seznam dot cz
                   ` (10 preceding siblings ...)
  2012-08-17 18:39 ` ubizjak at gmail dot com
@ 2012-09-01 14:31 ` uros at gcc dot gnu.org
  2012-09-05  8:21 ` [Bug target/46829] " ubizjak at gmail dot com
  12 siblings, 0 replies; 14+ messages in thread
From: uros at gcc dot gnu.org @ 2012-09-01 14:31 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46829

--- Comment #12 from uros at gcc dot gnu.org 2012-09-01 14:29:51 UTC ---
Author: uros
Date: Sat Sep  1 14:29:45 2012
New Revision: 190847

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=190847
Log:
    PR target/46829
    PR target/46843
    * config/i386/i386.c (ix86_legitimate_combined_insn): New function.
    (TARGET_LEGITIMATE_COMBINED_INSN): New macro.

testsuite/ChangeLog:

    PR target/46829
    PR target/46843
    * gcc.target/i386/pr46829.c: New test.
    * gcc.target/i386/pr46843.c: Ditto.


Added:
    trunk/gcc/testsuite/gcc.target/i386/pr46829.c
    trunk/gcc/testsuite/gcc.target/i386/pr46843.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/i386/i386.c
    trunk/gcc/testsuite/ChangeLog


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

* [Bug target/46829] ICE: in spill_failure, at reload1.c:2105 with -fschedule-insns -fsched-pressure and variadic function
  2010-12-06 20:59 [Bug rtl-optimization/46829] New: ICE: in spill_failure, at reload1.c:2105 with -fschedule-insns -fsched-pressure and variadic function zsojka at seznam dot cz
                   ` (11 preceding siblings ...)
  2012-09-01 14:31 ` uros at gcc dot gnu.org
@ 2012-09-05  8:21 ` ubizjak at gmail dot com
  12 siblings, 0 replies; 14+ messages in thread
From: ubizjak at gmail dot com @ 2012-09-05  8:21 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46829

Uros Bizjak <ubizjak at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
          Component|rtl-optimization            |target
         Resolution|                            |FIXED
   Target Milestone|---                         |4.8.0

--- Comment #13 from Uros Bizjak <ubizjak at gmail dot com> 2012-09-05 08:20:14 UTC ---
Fixed for 4.8.


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

end of thread, other threads:[~2012-09-05  8:21 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-12-06 20:59 [Bug rtl-optimization/46829] New: ICE: in spill_failure, at reload1.c:2105 with -fschedule-insns -fsched-pressure and variadic function zsojka at seznam dot cz
2010-12-06 21:53 ` [Bug rtl-optimization/46829] " hjl.tools at gmail dot com
2010-12-06 22:17 ` zsojka at seznam dot cz
2010-12-06 22:41 ` changpeng.fang at amd dot com
2010-12-06 22:52 ` hjl.tools at gmail dot com
2010-12-07 11:22 ` rguenth at gcc dot gnu.org
2010-12-07 17:34 ` zsojka at seznam dot cz
2010-12-07 22:42 ` changpeng.fang at amd dot com
2010-12-07 23:54 ` hjl.tools at gmail dot com
2010-12-09 19:17 ` changpeng.fang at amd dot com
2010-12-10 15:45 ` vmakarov at redhat dot com
2012-08-17 18:39 ` ubizjak at gmail dot com
2012-09-01 14:31 ` uros at gcc dot gnu.org
2012-09-05  8:21 ` [Bug target/46829] " ubizjak 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).