[4.6 regression/armhf] ICE, unable to find a register to spill in class 'LO_REGS'

Bug #903178 reported by Matthias Klose on 2011-12-12
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Linaro GCC
Won't Fix
Medium
Ramana Radhakrishnan
gcc-4.6 (Ubuntu)
Medium
Unassigned

Bug Description

seen with gcc-4.6 4.6.2-7ubuntu1, works with gcc-4.5

$ gcc -c -O2 -g TextDiagnosticPrinter.ii
/scratch/packages/llvm/clang-2.9/tools/clang/lib/Frontend/TextDiagnosticPrinter.cpp: In member function 'void clang::TextDiagnosticPrinter::EmitCaretDiagnostic(clang::SourceLocation, clang::CharSourceRange*, unsigned int, const clang::SourceManager&, const clang::FixItHint*, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int)':
/scratch/packages/llvm/clang-2.9/tools/clang/lib/Frontend/TextDiagnosticPrinter.cpp:592:1: error: unable to find a register to spill in class 'LO_REGS'
/scratch/packages/llvm/clang-2.9/tools/clang/lib/Frontend/TextDiagnosticPrinter.cpp:592:1: error: this is the insn:
(insn 137 148 138 3 (parallel [
            (set (reg/v:SI 208 [ Suppressed ])
                (and:SI (ltu:SI (reg/v:SI 1356 [ OnMacroInst ])
                        (reg/v:SI 1358 [ MacroSkipEnd ]))
                    (geu:SI (reg/v:SI 1356 [ OnMacroInst ])
                        (reg/v:SI 1357 [ MacroSkipStart ]))))
            (clobber (reg:CC 24 cc))
        ]) /scratch/packages/llvm/clang-2.9/tools/clang/lib/Frontend/TextDiagnosticPrinter.cpp:311 282 {*and_scc_scc_nodom}
     (expr_list:REG_UNUSED (reg:CC 24 cc)
        (nil)))
/scratch/packages/llvm/clang-2.9/tools/clang/lib/Frontend/TextDiagnosticPrinter.cpp:592: confused by earlier errors, bailing out

Matthias Klose (doko) wrote :
Michael Hope (michaelh1) wrote :

Thank you for the bug report. I've confirmed this with gcc-linaro-4.6-2011.12 on ARM:

michaelh@ursa3:~/linaro/bugs$ /tools/toolchains/arch/armv7l/gcc-linaro-4.6-2011.12-armv7l-natty-cbuild21
2-tcpanda03-cortexa9r1/bin/gcc -c -g -O2 TextDiagnosticPrinter2.ii
TextDiagnosticPrinter2.ii: In member function 'void clang::TextDiagnosticPrinter::EmitCaretDiagnostic(clang::SourceLocation, clang::CharSourceRange*, unsigned int, const clang::SourceManager&, const clang::FixItHint*, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int)':
TextDiagnosticPrinter2.ii:29848:1: error: unable to find a register to spill in class 'LO_REGS'
TextDiagnosticPrinter2.ii:29848:1: error: this is the insn:
(insn 137 150 138 3 (parallel [
            (set (reg/v:SI 208 [ Suppressed ])
                (and:SI (ltu:SI (reg/v:SI 1356 [ OnMacroInst ])
                        (reg/v:SI 1358 [ MacroSkipEnd ]))
                    (geu:SI (reg/v:SI 1356 [ OnMacroInst ])
                        (reg/v:SI 1357 [ MacroSkipStart ]))))
            (clobber (reg:CC 24 cc))
        ]) TextDiagnosticPrinter2.ii:29667 282 {*and_scc_scc_nodom}
     (expr_list:REG_UNUSED (reg:CC 24 cc)
        (nil)))
TextDiagnosticPrinter2.ii:29848: confused by earlier errors, bailing out

The work-around is to compile at -O1. The fault does not exist in gcc-4.5.3, gcc-4.6.2, or gcc-4.7~svn182152. The fault was introduced in the 2011.09 release.

I've set it to medium priority as it is a ftbfs and a work-around exists.

Changed in gcc-linaro:
status: New → Confirmed
status: Confirmed → Triaged
importance: Undecided → Medium
Michael Hope (michaelh1) wrote :

The fault was introduced somewhere in bzr106805 to 106808.

The most suspicious one is "

106807 [merge]
committer: Ramana Radhakrishnan <email address hidden>
branch nick: 4.6
timestamp: Mon 2011-09-12 15:14:00 +0100
message:
  backport conditional compares changes.
"""

Ramana, could you have a look at it?

Changed in gcc-linaro:
assignee: nobody → Ramana Radhakrishnan (ramana)

Also happens on armel - so this is not just armhf.

Ramana

On 12 December 2011 21:48, Michael Hope <email address hidden> wrote:
> The fault was introduced somewhere in bzr106805 to 106808.
>
> The most suspicious one is "
>
> 106807 [merge]
> committer: Ramana Radhakrishnan <email address hidden>
> branch nick: 4.6
> timestamp: Mon 2011-09-12 15:14:00 +0100
> message:
>  backport conditional compares changes.
> """
>
> Ramana, could you have a look at it?
>
> ** Changed in: gcc-linaro
>     Assignee: (unassigned) => Ramana Radhakrishnan (ramana)
>
> --
> You received this bug notification because you are a member of Linaro
> Toolchain Developers, which is subscribed to Linaro GCC.
> https://bugs.launchpad.net/bugs/903178
>
> Title:
>  [4.6 regression/armhf] ICE, unable to find a register to spill in
>  class 'LO_REGS'
>
> Status in Linaro GCC:
>  Triaged
> Status in “gcc-4.6” package in Ubuntu:
>  Confirmed
>
> Bug description:
>  seen with gcc-4.6 4.6.2-7ubuntu1, works with gcc-4.5
>
>
>  $ gcc -c -O2 -g TextDiagnosticPrinter.ii
>  /scratch/packages/llvm/clang-2.9/tools/clang/lib/Frontend/TextDiagnosticPrinter.cpp: In member function 'void clang::TextDiagnosticPrinter::EmitCaretDiagnostic(clang::SourceLocation, clang::CharSourceRange*, unsigned int, const clang::SourceManager&, const clang::FixItHint*, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int)':
>  /scratch/packages/llvm/clang-2.9/tools/clang/lib/Frontend/TextDiagnosticPrinter.cpp:592:1: error: unable to find a register to spill in class 'LO_REGS'
>  /scratch/packages/llvm/clang-2.9/tools/clang/lib/Frontend/TextDiagnosticPrinter.cpp:592:1: error: this is the insn:
>  (insn 137 148 138 3 (parallel [
>              (set (reg/v:SI 208 [ Suppressed ])
>                  (and:SI (ltu:SI (reg/v:SI 1356 [ OnMacroInst ])
>                          (reg/v:SI 1358 [ MacroSkipEnd ]))
>                      (geu:SI (reg/v:SI 1356 [ OnMacroInst ])
>                          (reg/v:SI 1357 [ MacroSkipStart ]))))
>              (clobber (reg:CC 24 cc))
>          ]) /scratch/packages/llvm/clang-2.9/tools/clang/lib/Frontend/TextDiagnosticPrinter.cpp:311 282 {*and_scc_scc_nodom}
>       (expr_list:REG_UNUSED (reg:CC 24 cc)
>          (nil)))
>  /scratch/packages/llvm/clang-2.9/tools/clang/lib/Frontend/TextDiagnosticPrinter.cpp:592: confused by earlier errors, bailing out
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/gcc-linaro/+bug/903178/+subscriptions

Ramana Radhakrishnan (ramana) wrote :

This is funny -

For Linaro 4.6 for the afflicted instruction we see :

Reload 0: reload_out (SI) = (reg/v:SI 208 [ Suppressed ])
 LO_REGS, RELOAD_OTHER (opnum = 0)
 reload_out_reg: (reg/v:SI 208 [ Suppressed ])
Reload 1: reload_in (SI) = (reg/v:SI 1356 [ OnMacroInst ])
 LO_REGS, RELOAD_FOR_INPUT (opnum = 1)
 reload_in_reg: (reg/v:SI 1356 [ OnMacroInst ])
Reload 2: reload_in (SI) = (reg/v:SI 1358 [ MacroSkipEnd ])
 LO_REGS, RELOAD_FOR_INPUT (opnum = 2)
 reload_in_reg: (reg/v:SI 1358 [ MacroSkipEnd ])
Reload 3: reload_in (SI) = (reg/v:SI 1356 [ OnMacroInst ])
 LO_REGS, RELOAD_FOR_INPUT (opnum = 4)
 reload_in_reg: (reg/v:SI 1356 [ OnMacroInst ])
Reload 4: reload_in (SI) = (reg/v:SI 1357 [ MacroSkipStart ])
 LO_REGS, RELOAD_FOR_INPUT (opnum = 5)
 reload_in_reg: (reg/v:SI 1357 [ MacroSkipStart ])
$19 = void

For FSF trunk we seem to start with a different set of reload classes :

<ramana> and for the same insn in FSF trunk I see
<ramana> Reload 0: reload_out (SI) = (reg/v:SI 181 [ Suppressed ])
<ramana> LO_REGS, RELOAD_OTHER (opnum = 0)
<ramana> reload_out_reg: (reg/v:SI 181 [ Suppressed ])
<ramana> Reload 1: reload_in (SI) = (reg/v:SI 1321 [ OnMacroInst ])
<ramana> GENERAL_REGS, RELOAD_FOR_INPUT (opnum = 1)
<ramana> reload_in_reg: (reg/v:SI 1321 [ OnMacroInst ])
<ramana> Reload 2: reload_in (SI) = (reg/v:SI 1323 [ MacroSkipEnd ])
<ramana> GENERAL_REGS, RELOAD_FOR_INPUT (opnum = 2)
<ramana> reload_in_reg: (reg/v:SI 1323 [ MacroSkipEnd ])
<ramana> Reload 3: reload_in (SI) = (reg/v:SI 1321 [ OnMacroInst ])
<ramana> GENERAL_REGS, RELOAD_FOR_INPUT (opnum = 4)
<ramana> reload_in_reg: (reg/v:SI 1321 [ OnMacroInst ])
<ramana> Reload 4: reload_in (SI) = (reg/v:SI 1322 [ MacroSkipStart ])
<ramana> GENERAL_REGS, RELOAD_FOR_INPUT (opnum = 5)
<ramana> reload_in_reg: (reg/v:SI 1322 [ MacroSkipStart ])
<ramana>

That looks fishy to me - rsandifo on IRC also pointed out to make sure we understand why FSF trunk thinks that the output reload should be in the LO_REGS . The only reason I can think of that is that we might prefer lo_regs there to allow the compiler to generate 16 bit encodings if possible but this is proving to be interesting.

cheers
Ramana

Matthias Klose (doko) wrote :

still seen with the 4.6 2012-03 release

Matthias Klose (doko) on 2012-09-06
Changed in gcc-4.6 (Ubuntu):
status: Confirmed → Triaged

Will not fix in older linaro gcc releases. Internal compiler error does not occur with latest releases of linaro 4.9 or 4.9

Changed in gcc-linaro:
status: Triaged → Won't Fix
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers