Re-merge patch and fixes (was: x86_64 gcc build failure with 2011.01-0)

Bug #701733 reported by Andrew Stubbs
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Linaro GCC
Fix Released
Medium
Andrew Stubbs
gcc-4.5 (Ubuntu)
Fix Released
High
Unassigned

Bug Description

From the Ubuntu build log:
   http://launchpadlibrarian.net/62080751/buildlog_ubuntu-natty-amd64.gcc-4.5_4.5.2-1ubuntu4_FAILEDTOBUILD.txt.gz

../../src/gcc/coverage.c: In function 'htab_counts_entry_hash':
../../src/gcc/coverage.c:148:1: error: unrecognizable insn:
(insn 25 7 26 2 ../../src/gcc/coverage.c:147 (set (reg:DI 1 dx)
        (mem/s:SI (plus:DI (reg/v/f:DI 5 di [orig:64 of ] [64])
                (const_int 4 [0x4])) [4 entry_2->ctr+0 S4 A32])) -1 (nil))
../../src/gcc/coverage.c:148:1: internal compiler error: in extract_insn, at recog.c:2104
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-4.5/README.Bugs> for instructions.

On closer inspection, our own build log shows the problem, but in a different place, and it did not affect the test run, apparently:
  http://ex.seabright.co.nz/build/gcc-linaro-4.5-2011.01-0/logs/x86_64-lucid-cbuild24-orion/gcc-build.txt

We should probably check the build status in addition to the test results!

Revision history for this message
Ulrich Weigand (uweigand) wrote :

The invalid RTL was introduced by the following peephole in i386.md:

;; After splitting up read-modify operations, array accesses with memory
;; operands might end up in form:
;; sall $2, %eax
;; movl 4(%esp), %edx
;; addl %edx, %eax
;; instead of pre-splitting:
;; sall $2, %eax
;; addl 4(%esp), %eax
;; Turn it into:
;; movl 4(%esp), %edx
;; leal (%edx,%eax,4), %eax

(define_peephole2
  [(match_scratch:SI 5 "r")
   (parallel [(set (match_operand 0 "register_operand" "")
                   (ashift (match_operand 1 "register_operand" "")
                           (match_operand 2 "const_int_operand" "")))
               (clobber (reg:CC FLAGS_REG))])
   (parallel [(set (match_operand 3 "register_operand" "")
                   (plus (match_dup 0)
                         (match_operand 4 "x86_64_general_operand" "")))
                   (clobber (reg:CC FLAGS_REG))])]
  "INTVAL (operands[2]) >= 0 && INTVAL (operands[2]) <= 3
   /* Validate MODE for lea. */
   && ((!TARGET_PARTIAL_REG_STALL
        && (GET_MODE (operands[0]) == QImode
            || GET_MODE (operands[0]) == HImode))
       || GET_MODE (operands[0]) == SImode
       || (TARGET_64BIT && GET_MODE (operands[0]) == DImode))
   /* We reorder load and the shift. */
   && !reg_overlap_mentioned_p (operands[0], operands[4])"
  [(set (match_dup 5) (match_dup 4))
   (set (match_dup 0) (match_dup 1))]
{
  enum machine_mode mode = GET_MODE (operands[1]) == DImode ? DImode : SImode;
  int scale = 1 << INTVAL (operands[2]);
  rtx index = gen_lowpart (Pmode, operands[1]);
  rtx base = gen_lowpart (Pmode, operands[5]);
  rtx dest = gen_lowpart (mode, operands[3]);

  operands[1] = gen_rtx_PLUS (Pmode, base,
                              gen_rtx_MULT (Pmode, index, GEN_INT (scale)));
  if (mode != Pmode)
    operands[1] = gen_rtx_SUBREG (mode, operands[1], 0);
  operands[5] = base;
  operands[0] = dest;
})

Note how operands[5] is always DImode, while operands[4] may be some other mode.

Revision history for this message
Ulrich Weigand (uweigand) wrote :

This was fixed in mainline as PR target/44721:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44721

Revision history for this message
Ulrich Weigand (uweigand) wrote :

Note that there were two additional bugs in mainline also introduced by the same peephole patch:

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

Matthias Klose (doko)
Changed in gcc-4.5 (Ubuntu):
importance: Undecided → High
status: New → Confirmed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package gcc-4.5 - 4.5.2-1ubuntu5

---------------
gcc-4.5 (4.5.2-1ubuntu5) natty; urgency=low

  * Update the Linaro support to the 4.5 2011.01-1 release. LP: #701733.
 -- Matthias Klose <email address hidden> Thu, 13 Jan 2011 23:52:30 +0100

Changed in gcc-4.5 (Ubuntu):
status: Confirmed → Fix Released
Changed in gcc-linaro:
status: New → Triaged
importance: Critical → Medium
Revision history for this message
Michael Hope (michaelh1) wrote :

This patch was reverted in the 2011.01-1 release. Renaming this ticket so that the patch and follow up fixes can be tracked.

summary: - x86_64 gcc build failure with 2011.01-0
+ Re-merge patch and fixes (was: x86_64 gcc build failure with 2011.01-0)
Revision history for this message
Michael Hope (michaelh1) wrote :

Andrew, what's the status of this one? The upstream fix and follow on fixes seem to have been done.

Revision history for this message
Andrew Stubbs (ams-codesourcery) wrote :

These patches were re-merged in lp:gcc-linaro/4.5,revno=99475, and released in 4.5-2011.03-0.

Changed in gcc-linaro:
milestone: none → 4.5-2011.03-0
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.