Compile the following testcase with arm-elf-gcc 3.4.3 as follows:
arm-elf-gcc -c -mcpu=arm7tdmi -O2 -mthumb  bitset1.cxx

With bitset1.cxx containing:
#include <bitset>
extern void check(void);

// 64 works, 65 doesn't
//#define N 64
#define N 65

int main( int argc, char *argv[] )
{
    typedef std::bitset<N> B;
    unsigned int i, j;

    B b1, b2;

    b2 = ~b1;
    if ( b2 != ~b1 )
        ;

    b2.reset();
    for ( i = j = 0; i < N; i++ ) {
        b2.set( j );
        if ( i != b1.test(j) )
            check();
        j++;
    }
    b2 = ~b2;
}

The result is:
bitset1.cxx: In function `int main(int, char**)':
bitset1.cxx:27: error: insn does not satisfy its constraints:
(insn:HI 472 471 473 5 (set (reg:SI 3 r3 [169])
        (mem/s:SI (plus:SI (reg:SI 1 r1 [304])
                (reg/f:SI 13 sp)) [7 <variable>._M_w S4 A32])) 126
{*thumb_movsi_insn} (nil)
    (expr_list:REG_EQUIV (mem/s:SI (plus:SI (reg:SI 1 r1 [304])
                (reg/f:SI 13 sp)) [7 <variable>._M_w S4 A32])
        (nil)))
bitset1.cxx:27: internal compiler error: in reload_cse_simplify_operands, at
postreload.c:391
Please submit a full bug report,
with preprocessed source if appropriate.

The testcase is a pared down fragment of a much larger function so it doesn't
make much sense any more, but it still reproduces the ICE.

I will attach the .ii file separately.

-- 
           Summary: [ARM thumb] ICE with C++ bitsets in thumb mode
           Product: gcc
           Version: 3.4.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: target
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jifl-bugzilla at jifvik dot org
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: arm-elf


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

Reply via email to