armel FTBFS due to compiler ICE

Bug #736661 reported by Jani Monoses on 2011-03-17
24
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Linaro GCC
Fix Released
High
Richard Sandiford
4.5
Fix Released
High
Richard Sandiford
4.6
Fix Released
High
Richard Sandiford
gcc
Fix Released
Medium
ace (Ubuntu)
Undecided
Unassigned
Oneiric
Undecided
Unassigned
gcc-4.5 (Ubuntu)
High
Unassigned
Oneiric
High
Unassigned
gcc-4.6 (Debian)
Fix Released
Unknown
gcc-4.6 (Ubuntu)
High
Unassigned
Oneiric
High
Unassigned
shibboleth-sp2 (Ubuntu)
Undecided
Unassigned
Oneiric
Undecided
Unassigned

Bug Description

http://launchpadlibrarian.net/66529698/buildlog_ubuntu-natty-armel.shibboleth-sp2_2.3.1%2Bdfsg-5ubuntu1_FAILEDTOBUILD.txt.gz

/bin/bash ../libtool --silent --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I.. -pthread -g -O2 -g -Wall -O2 -O2 -DNDEBUG -pthread -Wall -g -O2 -DNDEBUG -c -o XMLServiceProvider.lo `test -f 'impl/XMLServiceProvider.cpp' || echo './'`impl/XMLServiceProvider.cpp
impl/XMLServiceProvider.cpp: In member function 'std::pair<bool, bool><unnamed>::XMLConfig::_ZTv0_n24_NK12_GLOBAL__N_19XMLConfig7getBoolEPKcS2_(const char*, const char*) const':
impl/XMLServiceProvider.cpp:311:25: internal compiler error: in expand_expr_real_1, at expr.c:8454
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-4.5/README.Bugs> for instructions.

Jani Monoses (jani) on 2011-03-17
tags: added: arm-porting-queue
Michael Hope (michaelh1) wrote :

Could you provide the pre-processed source please so that we can look into it? The easiest way is to add -save-temps to the g++ command line and grab XMLServiceProvider.ii.

Changed in gcc-linaro:
status: New → Incomplete
Jani Monoses (jani) wrote :
Jani Monoses (jani) wrote :

The ICE is the same for this package, although I am not sure if the same error triggers it.
http://launchpadlibrarian.net/66374773/buildlog_ubuntu-natty-armel.ace_5.7.7-4_FAILEDTOBUILD.txt.gz

Changed in gcc-linaro:
status: Incomplete → New
status: New → Triaged
Ramana Radhakrishnan (ramana) wrote :

Confirmed with linaro-gcc 4.5 rev 99489 at all optimization levels and FSF trunk.

cheers
Ramana

Steve Langasek (vorlon) on 2011-03-30
tags: added: ftbfs
Michael Hope (michaelh1) on 2011-03-31
Changed in gcc-linaro:
importance: Undecided → Medium
Michael Hope (michaelh1) wrote :

Also occurs upstream in 4.5.2 and 4.6.0:

michaelh@ursa1:~/linaro/bugs$ /tools/toolchains/gcc-4.5.2-armv7l-maverick-cbuild93-ursa1-cortexa8r1/bin/g++ -O2 -S XMLServiceProvider.ii
impl/XMLServiceProvider.cpp: In member function 'std::pair<bool, bool><unnamed>::XMLConfig::_ZTv0_n24_NK12_GLOBAL__N_19XMLConfig7getBoolEPKcS2_(const char*, const char*) const':
impl/XMLServiceProvider.cpp:311:25: internal compiler error: in expand_expr_real_1, at expr.c:8529

michaelh@ursa1:~/linaro/bugs$ /tools/toolchains/gcc-4.6.0-armv7l-maverick-cbuild93-ursa1-cortexa8r1/bin/g++ -O2 -S XMLServiceProvider.ii
impl/XMLServiceProvider.cpp: In member function 'std::pair<bool, bool> {anonymous}::XMLConfig::_ZTv0_n24_NK12_GLOBAL__N_19XMLConfig7getBoolEPKcS2_(const char*, const char*) const':
impl/XMLServiceProvider.cpp:311:25: internal compiler error: in expand_expr_real_1, at expr.c:8512

Jani, could you report this upstream as well please and attach it to this ticket?

Originally reported here
https://bugs.launchpad.net/ubuntu/+source/shibboleth-sp2/+bug/736661

Occurs with 4.5.2 and 4.6.0

/bin/bash ../libtool --silent --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I.. -pthread -g -O2 -g -Wall -O2 -O2 -DNDEBUG -pthread -Wall -g -O2 -DNDEBUG -c -o XMLServiceProvider.lo `test -f 'impl/XMLServiceProvider.cpp' || echo './'`impl/XMLServiceProvider.cpp
impl/XMLServiceProvider.cpp: In member function 'std::pair<bool, bool><unnamed>::XMLConfig::_ZTv0_n24_NK12_GLOBAL__N_19XMLConfig7getBoolEPKcS2_(const char*, const char*) const':
impl/XMLServiceProvider.cpp:311:25: internal compiler error: in expand_expr_real_1, at expr.c:8454

Link to preprocessed source

https://bugs.launchpad.net/ubuntu/+source/shibboleth-sp2/+bug/736661/+attachment/1916995/+files/XMLServiceProvider.ii

Changed in gcc:
importance: Unknown → Medium
status: Unknown → New
Changed in gcc:
status: New → Confirmed
tags: added: oneiric
Changed in shibboleth-sp2 (Ubuntu):
milestone: none → oneiric-alpha-2
Michael Hope (michaelh1) wrote :

Note that this still occurs in gcc trunk 174795

Occurs in trunk r174795, 4.6.0, and 4.5.3.

In , Mikpe (mikpe) wrote :

It's caused or triggered by r154736:

Author: hubicka
Date: Sun Nov 29 10:32:08 2009
New Revision: 154736

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=154736
Log:

 * cgraph.c (same_body_alias_1): Break out of
 (same_body_alias): ... here; remove comdat check; it is handled
 in cp already.
 (cgraph_add_thunk): New.
 (dump_cgraph_node): Dump aliases and thunks.
 * cgraph.h (cgraph_thunk_info): New structure.
 (struct cgraph_node): Add thunk info.
 (cgraph_add_thunk): New.
        ...

One strange thing about that commit is that it added calls to record_loop_exits in ira.c, but the ChangeLog entry doesn't mention ira.c, and nothing else in the commit seems related to loops or ira. A local hack that got accidentally committed?

In , Mikpe (mikpe) wrote :

Created attachment 24484
reduced test case

With the massively reduced test case and r154736 built as a cross to armv5tel-linux-gnueabi, I get:

> /tmp/objdir/gcc/g++ -B/tmp/objdir/gcc -O1 -S XMLServiceProvider.cc
XMLServiceProvider.cc: In member function 'virtual thunk to XMLConfig::getBool() const':
XMLServiceProvider.cc:24:19: internal compiler error: in expand_expr_real_1, at expr.c:8510

Changed in shibboleth-sp2 (Ubuntu):
milestone: oneiric-alpha-2 → oneiric-alpha-3
Changed in ace (Ubuntu):
milestone: none → oneiric-alpha-3
Changed in ace (Ubuntu Oneiric):
milestone: oneiric-alpha-3 → none
status: New → Confirmed
tags: added: universe
Changed in shibboleth-sp2 (Ubuntu Oneiric):
milestone: oneiric-alpha-3 → none
status: New → Confirmed

The problem seems to be that promote_decl_mode() is changing the value returned from the pair constructor from HImode to BLKmode:

(gdb) p debug_tree(decl)
 <result_decl 0x2aaaab61ea80 D.2836
    type <record_type 0x2aaaab5d9930 pair no-force-blk type_5 type_6 BLK
        size <integer_cst 0x2aaaaaaf05f0 constant 16>
        unit size <integer_cst 0x2aaaaaaf0618 constant 2>
        align 8 symtab 0 alias set -1 canonical type 0x2aaaab5d9930
        fields <field_decl 0x2aaaab5f1d10 first type <boolean_type 0x2aaaaab08888 bool>
            unsigned nonlocal decl_3 QI file PR48660.cpp line 6 col 7
            size <integer_cst 0x2aaaaaaf04b0 constant 8>
            unit size <integer_cst 0x2aaaaaaf04d8 constant 1>
            align 8 offset_align 64
            offset <integer_cst 0x2aaaaaaf0410 constant 0>
            bit offset <integer_cst 0x2aaaaaaf0e38 constant 0> context <record_type 0x2aaaab5d9930 pair> chain <field_decl 0x2aaaab5f1da8 second>> context <translation_unit_decl 0x2aaaaaafb508 D.1>
        full-name "struct pair<bool, bool>"
        X() X(constX&) this=(X&) n_parents=0 use_template=1 interface-unknown
        pointer_to_this <pointer_type 0x2aaaab603150> chain <type_decl 0x2aaaab5ce958 pair>>
    used ignored regdecl BLK file PR48660.cpp line 31 col 1 size <integer_cst 0x2aaaaaaf05f0 16> unit size <integer_cst 0x2aaaaaaf0618 2>
    align 8
    (reg:HI 140 [ <retval> ])>

This is in turn happening because DECL_MODE (decl) == BLKmode, while in the caller, GET_MODE (decl_rtl) == HImode. It's not clear to me whether the rtx expression should have been in BLKmode in the first place, or whether expand_expr_real_1() should tolerate the conversion. The context in expand_expr_real_1() suggests that the point of the call to promote_decl_mode() was to get the signedness of the result, and the only use of its return value is in the gcc_assert(). I will check whether moving the gcc_assert() inside the results in promote_function_mode() branch results in correct code; however, that may just be papering over a real problem.

Changed in gcc-4.6 (Debian):
status: Unknown → Confirmed
In , Doko-v (doko-v) wrote :

works with 4.4.6, not with 4.5/4.6/trunk 20110824

Matthias Klose (doko) wrote :

raising importance, no work-around available besides using gcc-4.4

Changed in gcc-4.5 (Ubuntu Oneiric):
importance: Undecided → High
status: New → Confirmed
Changed in gcc-4.6 (Ubuntu Oneiric):
importance: Undecided → High
status: New → Confirmed
Matthias Klose (doko) on 2011-09-03
Changed in gcc-4.6 (Ubuntu Oneiric):
milestone: none → ubuntu-11.10-beta-2
Michael Hope (michaelh1) wrote :

(note to self: confirmed in gcc-4.5.3, gcc-4.6.1, gcc-4.7~svn178025, gcc-linaro-4.5-2011.08, gcc-linaro-4.6-2011.06-0, gcc-linaro-4.6-2011.07-0, gcc-linaro-4.6-2011.08).

Michael Hope (michaelh1) wrote :

Bumping to high as 4.4 is the only known work around.

Changed in gcc-linaro:
importance: Medium → High
Michael Hope (michaelh1) wrote :

Hi Richard. I've subscribed you to this bug. For some reason I can't assign the gcc-linaro aspect to you but I'm looking into why.

Changed in gcc-linaro:
assignee: nobody → Richard Sandiford (rsandifo)
Kate Stewart (kate.stewart) wrote :

Removing milestone since this is not a blocker for the beta 2 release, since the affected package is in universe. Any toolchain fixes before being applied now, need to be reviewed with other teams for impact.

Changed in gcc-4.6 (Ubuntu Oneiric):
milestone: ubuntu-11.10-beta-2 → none
Michael Hope (michaelh1) on 2011-09-09
Changed in gcc-linaro:
status: Triaged → In Progress
Changed in gcc:
status: Confirmed → In Progress
Michael Hope (michaelh1) wrote :

From the 2011-12-19 meeting: was blocked on the cdce3.C error, found to be linker specific, Richard will backport to the FSF 4.6 and 4.5 branches by EOY. We'll pick up in the merge at the start of Jan.

Author: rsandifo
Date: Wed Dec 21 16:34:41 2011
New Revision: 182595

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=182595
Log:
Add reference to PR middle-end/48660

Modified:
    trunk/gcc/ChangeLog

Fixed on trunk. I'll ask about backporting.

tags: added: ice
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package gcc-4.6 - 4.6.2-10ubuntu1

---------------
gcc-4.6 (4.6.2-10ubuntu1) precise; urgency=low

  * Merge with Debian.

gcc-4.6 (4.6.2-10) unstable; urgency=low

  * Update to SVN 20120104 (r182882) from the gcc-4_6-branch.
    - Fix PR tree-optimization/49651, PR tree-optimization/51042,
      PR tree-optimization/51070, PR target/51623, PR rtl-optimization/50396,
      PR target/51643, PR lto/41159, PR tree-optimization/51583,
      PR debug/49951, PR c++/51416, PR c++/51331, PR fortran/51502,
      PR fortran/51310, PR libstdc++/51711, PR libstdc++/51626,
      PR libstdc++/51083, PR libstdc++/50862, PR libstdc++/51540,
      PR bootstrap/51686, PR bootstrap/49907.

  [ Matthias Klose ]
  * Don't provide the 4.6.1 symlink anymore.
  * Fix generating libphobos dependency for gdc. Addresses: #653078.
  * Link libmudflapth.so with -lpthread.
  * Apply proposed backport for PR middle-end/48660 (Richard Sandiford).
    Closes: #630752, LP: #736661.
  * On armel/armhf, allow g*-multilib installation using the runtime
    libraries of the corresponding multiarch architecture.
  * Fix location of .jinfo files. Addresses: #654579.

  [ Aurelien Jarno ]
  * Re-enable parallel builds on kfreebsd-i386, as the problem from bug
    #637236 only affects kfreebsd-amd64.
 -- Matthias Klose <email address hidden> Wed, 04 Jan 2012 23:04:12 +0100

Changed in gcc-4.6 (Ubuntu):
status: Confirmed → Fix Released
Changed in gcc-4.6 (Debian):
status: Confirmed → Fix Released
Matthias Klose (doko) wrote :

shibboleth-sp2 built in precise

Changed in shibboleth-sp2 (Ubuntu):
status: Confirmed → Fix Released
Matthias Klose (doko) wrote :

ace 6.0.1-3 built in precise

Changed in ace (Ubuntu):
status: Confirmed → Fix Released

Author: rsandifo
Date: Fri Jan 6 14:56:46 2012
New Revision: 182955

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=182955
Log:
gcc/
 PR middle-end/48660
 * expr.h (copy_blkmode_to_reg): Declare.
 * expr.c (copy_blkmode_to_reg): New function.
 (expand_assignment): Don't expand register RESULT_DECLs before
 the lhs. Use copy_blkmode_to_reg to copy BLKmode values into a
 RESULT_DECL register.
 (expand_expr_real_1): Handle BLKmode decls when looking for promotion.

gcc/testsuite/
 PR middle-end/48660
 * g++.dg/pr48660.C: New test.

Added:
    branches/gcc-4_6-branch/gcc/testsuite/g++.dg/pr48660.C
Modified:
    branches/gcc-4_6-branch/gcc/ChangeLog
    branches/gcc-4_6-branch/gcc/expr.c
    branches/gcc-4_6-branch/gcc/expr.h
    branches/gcc-4_6-branch/gcc/testsuite/ChangeLog

Author: rsandifo
Date: Fri Jan 6 14:59:47 2012
New Revision: 182956

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=182956
Log:
gcc/
 PR middle-end/48660
 * expr.h (copy_blkmode_to_reg): Declare.
 * expr.c (copy_blkmode_to_reg): New function.
 (expand_assignment): Don't expand register RESULT_DECLs before
 the lhs. Use copy_blkmode_to_reg to copy BLKmode values into a
 RESULT_DECL register.
 (expand_expr_real_1): Handle BLKmode decls when looking for promotion.

gcc/testsuite/
 PR middle-end/48660
 * g++.dg/pr48660.C: New test.

Added:
    branches/gcc-4_5-branch/gcc/testsuite/g++.dg/pr48660.C
Modified:
    branches/gcc-4_5-branch/gcc/ChangeLog
    branches/gcc-4_5-branch/gcc/expr.c
    branches/gcc-4_5-branch/gcc/expr.h
    branches/gcc-4_5-branch/gcc/testsuite/ChangeLog

Fixed on branches and trunk.

Changed in gcc:
status: In Progress → Fix Released
Jani Monoses (jani) wrote :

This seems to no longer FTBFS

Changed in gcc-4.5 (Ubuntu):
status: Confirmed → Fix Released
Rolf Leggewie (r0lf) wrote :

oneiric has seen the end of its life and is no longer receiving any updates. Marking the oneiric task for this ticket as "Won't Fix".

Changed in gcc-4.5 (Ubuntu Oneiric):
status: Confirmed → Won't Fix
Changed in gcc-4.6 (Ubuntu Oneiric):
status: Confirmed → Won't Fix
Rolf Leggewie (r0lf) on 2014-12-03
Changed in ace (Ubuntu Oneiric):
status: Confirmed → Won't Fix
Changed in shibboleth-sp2 (Ubuntu Oneiric):
status: Confirmed → Won't Fix
To post a comment you must log in.
This report contains Public information  Edit
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.