This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug rtl-optimization/16123] New: THUMB -O1 -fnew-ra: struct copy causes ice


The following small file will cause gcc to crash with an internal compiler error:

    typedef struct {
        int a;
        int b;
        int c;
    } Splat;

    void zorch(Splat *s);

    void eek(Splat *s)
    {
        Splat s2 = *s;
        zorch(&s2);
    }

That's it. The error reported is:

    eek.c: In function `eek':
    eek.c:13: internal compiler error: in cselib_record_set, at cselib.c:1196
    Please submit a full bug report,
    with preprocessed source if appropriate.
    See <URL:http://gcc.gnu.org/bugs.html> for instructions.

The salient part of cselib.c reads:

      if (REG_VALUES (dreg) == 0)
    {
      VARRAY_PUSH_UINT (used_regs, dreg);
      REG_VALUES (dreg) = new_elt_list (REG_VALUES (dreg), src_elt);
    }
      else
    {
      if (REG_VALUES (dreg)->elt == 0)
        REG_VALUES (dreg)->elt = src_elt;
      else
        /* The register should have been invalidated.  */
        abort (); // LINE 1196
    }

The file was compiled with this line:

    $ arm-elf-gcc -c eek.c -mthumb -fno-builtin -O1 -fnew-ra

The compiler was built as follows:

    $ tar -xjvf gcc-core-3.4.0.tar.bz2
    $ cd gcc-3.4.0
    $ ./configure --prefix=/usr/local/armdev --target=arm-elf --with-newlib --enable-languages=c

    The following lines were uncommented in gcc/config/arm/t-arm-elf:

    MULTILIB_OPTIONS    += mno-thumb-interwork/mthumb-interwork
    MULTILIB_DIRNAMES   += normal interwork
    MULTILIB_EXCEPTIONS += *mapcs-26/*mthumb-interwork*

    $ make
    $ sudo make install

In case it matters, I'm currently using binutils-2.15.

-- 
           Summary: THUMB -O1 -fnew-ra: struct copy causes ice
           Product: gcc
           Version: new-ra
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: rtl-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: danfuzz at milk dot com
                CC: gcc-bugs at gcc dot gnu dot org
GCC target triplet: arm-elf-gcc


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]