public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/49927] New: ice in spill_failure, at reload1.c:2120
@ 2011-08-01  4:18 regehr at cs dot utah.edu
  2011-08-01  8:08 ` [Bug rtl-optimization/49927] [4.7 Regression] " ubizjak at gmail dot com
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: regehr at cs dot utah.edu @ 2011-08-01  4:18 UTC (permalink / raw)
  To: gcc-bugs

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

           Summary: ice in spill_failure, at reload1.c:2120
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: regehr@cs.utah.edu


regehr@home:~/volatile/bugs/tmp040$ current-gcc -c -O0 small.c

small.c: In function ‘func_7’:
small.c:8:1: error: unable to find a register to spill in class ‘Q_REGS’
small.c:8:1: error: this is the insn:
(insn 9 8 10 2 (set (mem/s/j:QI (plus:SI (plus:SI (subreg:SI (reg:DI 60 [
g_91.1 ]) 0)
                    (subreg:SI (reg:DI 59 [ g_91.0 ]) 0))
                (symbol_ref:SI ("g_73") <var_decl 0xb72f9720 g_73>)) [0 g_73 S1
A8])
        (reg:QI 4 si [orig:62 D.1999 ] [62])) small.c:6 52 {*movqi_internal}
     (expr_list:REG_DEAD (reg:QI 4 si [orig:62 D.1999 ] [62])
        (expr_list:REG_DEAD (reg:DI 60 [ g_91.1 ])
            (expr_list:REG_DEAD (reg:DI 59 [ g_91.0 ])
                (nil)))))
small.c:8:1: internal compiler error: in spill_failure, at reload1.c:2120
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

regehr@home:~/volatile/bugs/tmp040$ current-gcc -v

Using built-in specs.
COLLECT_GCC=current-gcc
COLLECT_LTO_WRAPPER=/mnt/z/z/compiler-install/gcc-r176994-install/libexec/gcc/i686-pc-linux-gnu/4.7.0/lto-wrapper
Target: i686-pc-linux-gnu
Configured with: ../configure --with-libelf=/usr/local --enable-lto
--prefix=/mnt/z/z/compiler-install/gcc-r176994-install
--program-prefix=r176994- --enable-languages=c,c++
Thread model: posix
gcc version 4.7.0 20110801 (experimental) (GCC) 

regehr@home:~/volatile/bugs/tmp040$ cat small.c

char g_73[1][1];
long long g_91;
int *
func_7 (int p_11, int p_12)
{
  --g_73[g_91][g_91];
  return 0;
}


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

* [Bug rtl-optimization/49927] [4.7 Regression] ice in spill_failure, at reload1.c:2120
  2011-08-01  4:18 [Bug c/49927] New: ice in spill_failure, at reload1.c:2120 regehr at cs dot utah.edu
@ 2011-08-01  8:08 ` ubizjak at gmail dot com
  2011-08-01 10:08 ` jakub at gcc dot gnu.org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: ubizjak at gmail dot com @ 2011-08-01  8:08 UTC (permalink / raw)
  To: gcc-bugs

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

Uros Bizjak <ubizjak at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Target|                            |i686-pc-linux-gnu
             Status|UNCONFIRMED                 |NEW
           Keywords|                            |ra
   Last reconfirmed|                            |2011.08.01 08:07:57
          Component|c                           |rtl-optimization
                 CC|                            |vmakarov at gcc dot gnu.org
     Ever Confirmed|0                           |1
            Summary|ice in spill_failure, at    |[4.7 Regression] ice in
                   |reload1.c:2120              |spill_failure, at
                   |                            |reload1.c:2120
   Target Milestone|---                         |4.7.0
      Known to fail|                            |4.7.0

--- Comment #1 from Uros Bizjak <ubizjak at gmail dot com> 2011-08-01 08:07:58 UTC ---
Register allocator failure:

We have:

(insn 9 8 10 2 (set (mem/s/j:QI
(plus:SI (plus:SI (subreg:SI (reg:DI 60 [ g_91.1 ]) 0)
                    (subreg:SI (reg:DI 59 [ g_91.0 ]) 0))
                (symbol_ref:SI ("g_73")  <var_decl 0x2b6b55451140 g_73>)) [0
g_73 S1 A8])
        (reg:QI 62 [ D.1999 ])) pr49927.c:6 66 {*movqi_internal}
     (nil))


Reloads for insn # 9
Reload 0: reload_in (DI) = (reg:DI 60 [ g_91.1 ])
    GENERAL_REGS, RELOAD_FOR_OPERAND_ADDRESS (opnum = 0)
    reload_in_reg: (reg:DI 60 [ g_91.1 ])
Reload 1: reload_in (DI) = (reg:DI 59 [ g_91.0 ])
    INDEX_REGS, RELOAD_FOR_OPERAND_ADDRESS (opnum = 0)
    reload_in_reg: (reg:DI 59 [ g_91.0 ])
Reload 2: reload_in (QI) = (reg:QI 4 si [orig:62 D.1999 ] [62])
    Q_REGS, RELOAD_FOR_INPUT (opnum = 1)
    reload_in_reg: (reg:QI 4 si [orig:62 D.1999 ] [62])

Register si is not valid for QImode on 32bit x86.

GCC 4.4 works OK, so confirmed regression on x86_64-pc-linux-gnu with -O0 -m32.


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

* [Bug rtl-optimization/49927] [4.7 Regression] ice in spill_failure, at reload1.c:2120
  2011-08-01  4:18 [Bug c/49927] New: ice in spill_failure, at reload1.c:2120 regehr at cs dot utah.edu
  2011-08-01  8:08 ` [Bug rtl-optimization/49927] [4.7 Regression] " ubizjak at gmail dot com
@ 2011-08-01 10:08 ` jakub at gcc dot gnu.org
  2011-08-01 10:14 ` jakub at gcc dot gnu.org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: jakub at gcc dot gnu.org @ 2011-08-01 10:08 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-08-01 10:07:57 UTC ---
Caused by http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=176536
Shorter testcase:
char a[1][1];
long long b;

void
foo (void)
{
  --a[b][b];
}

I'd say it is a mistake to allow subregs of DImode pseudos in the addresses for
-m32, it makes sense only for TARGET_64BIT when DImode is just a single general
register.  Because otherwise the subregs of DImode registers in addresses
increase register pressure on the insn in question, especially if in the
address there is more than one.


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

* [Bug rtl-optimization/49927] [4.7 Regression] ice in spill_failure, at reload1.c:2120
  2011-08-01  4:18 [Bug c/49927] New: ice in spill_failure, at reload1.c:2120 regehr at cs dot utah.edu
  2011-08-01  8:08 ` [Bug rtl-optimization/49927] [4.7 Regression] " ubizjak at gmail dot com
  2011-08-01 10:08 ` jakub at gcc dot gnu.org
@ 2011-08-01 10:14 ` jakub at gcc dot gnu.org
  2011-08-01 11:34 ` ubizjak at gmail dot com
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: jakub at gcc dot gnu.org @ 2011-08-01 10:14 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-08-01 10:14:12 UTC ---
So perhaps it shouldn't be DImode but Pmode.


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

* [Bug rtl-optimization/49927] [4.7 Regression] ice in spill_failure, at reload1.c:2120
  2011-08-01  4:18 [Bug c/49927] New: ice in spill_failure, at reload1.c:2120 regehr at cs dot utah.edu
                   ` (2 preceding siblings ...)
  2011-08-01 10:14 ` jakub at gcc dot gnu.org
@ 2011-08-01 11:34 ` ubizjak at gmail dot com
  2011-08-01 12:58 ` ubizjak at gmail dot com
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: ubizjak at gmail dot com @ 2011-08-01 11:34 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Uros Bizjak <ubizjak at gmail dot com> 2011-08-01 11:34:29 UTC ---
(In reply to comment #3)
> So perhaps it shouldn't be DImode but Pmode.

Yes, this is a very good suggestion.

BTW: I plan to relax the check for SUBREG_PROMOTED_UNSIGNED_P [1] with
paradoxical subregs.

[1] http://gcc.gnu.org/ml/gcc-patches/2011-07/msg01647.html


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

* [Bug rtl-optimization/49927] [4.7 Regression] ice in spill_failure, at reload1.c:2120
  2011-08-01  4:18 [Bug c/49927] New: ice in spill_failure, at reload1.c:2120 regehr at cs dot utah.edu
                   ` (3 preceding siblings ...)
  2011-08-01 11:34 ` ubizjak at gmail dot com
@ 2011-08-01 12:58 ` ubizjak at gmail dot com
  2011-08-01 17:14 ` uros at gcc dot gnu.org
  2011-08-01 17:16 ` [Bug target/49927] " ubizjak at gmail dot com
  6 siblings, 0 replies; 8+ messages in thread
From: ubizjak at gmail dot com @ 2011-08-01 12:58 UTC (permalink / raw)
  To: gcc-bugs

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

Uros Bizjak <ubizjak at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
         AssignedTo|unassigned at gcc dot       |ubizjak at gmail dot com
                   |gnu.org                     |

--- Comment #5 from Uros Bizjak <ubizjak at gmail dot com> 2011-08-01 12:56:29 UTC ---
Created attachment 24881
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=24881
Untested patch

I'm testing the attached patch.


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

* [Bug rtl-optimization/49927] [4.7 Regression] ice in spill_failure, at reload1.c:2120
  2011-08-01  4:18 [Bug c/49927] New: ice in spill_failure, at reload1.c:2120 regehr at cs dot utah.edu
                   ` (4 preceding siblings ...)
  2011-08-01 12:58 ` ubizjak at gmail dot com
@ 2011-08-01 17:14 ` uros at gcc dot gnu.org
  2011-08-01 17:16 ` [Bug target/49927] " ubizjak at gmail dot com
  6 siblings, 0 replies; 8+ messages in thread
From: uros at gcc dot gnu.org @ 2011-08-01 17:14 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from uros at gcc dot gnu.org 2011-08-01 17:13:35 UTC ---
Author: uros
Date: Mon Aug  1 17:13:30 2011
New Revision: 177064

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=177064
Log:
    PR target/49927
    * config/i386/i386.c (ix86_address_subreg_operand): New.
    (ix86_decompose_address): Use ix86_address_subreg_operand.
    (ix86_legitimate_address_p): Do not assert that subregs satisfy
    register_no_elim_operand in DImode.

testsuite/ChangeLog:

    PR target/49927
    * gcc.target/i386/pr49927.c: New test.


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


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

* [Bug target/49927] [4.7 Regression] ice in spill_failure, at reload1.c:2120
  2011-08-01  4:18 [Bug c/49927] New: ice in spill_failure, at reload1.c:2120 regehr at cs dot utah.edu
                   ` (5 preceding siblings ...)
  2011-08-01 17:14 ` uros at gcc dot gnu.org
@ 2011-08-01 17:16 ` ubizjak at gmail dot com
  6 siblings, 0 replies; 8+ messages in thread
From: ubizjak at gmail dot com @ 2011-08-01 17:16 UTC (permalink / raw)
  To: gcc-bugs

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

Uros Bizjak <ubizjak at gmail dot com> changed:

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

--- Comment #7 from Uros Bizjak <ubizjak at gmail dot com> 2011-08-01 17:15:58 UTC ---
Fixed.


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

end of thread, other threads:[~2011-08-01 17:16 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-01  4:18 [Bug c/49927] New: ice in spill_failure, at reload1.c:2120 regehr at cs dot utah.edu
2011-08-01  8:08 ` [Bug rtl-optimization/49927] [4.7 Regression] " ubizjak at gmail dot com
2011-08-01 10:08 ` jakub at gcc dot gnu.org
2011-08-01 10:14 ` jakub at gcc dot gnu.org
2011-08-01 11:34 ` ubizjak at gmail dot com
2011-08-01 12:58 ` ubizjak at gmail dot com
2011-08-01 17:14 ` uros at gcc dot gnu.org
2011-08-01 17:16 ` [Bug target/49927] " 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).