Bug 16123 - [new-ra] THUMB -O1 -fnew-ra: struct copy causes ice
Summary: [new-ra] THUMB -O1 -fnew-ra: struct copy causes ice
Status: RESOLVED WONTFIX
Alias: None
Product: gcc
Classification: Unclassified
Component: rtl-optimization (show other bugs)
Version: 3.4.0
: P2 normal
Target Milestone: 4.0.0
Assignee: Not yet assigned to anyone
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks: 13246
  Show dependency treegraph
 
Reported: 2004-06-21 20:34 UTC by Dan Bornstein
Modified: 2005-01-17 15:21 UTC (History)
1 user (show)

See Also:
Host:
Target: arm-elf-gcc
Build:
Known to work:
Known to fail:
Last reconfirmed: 2004-08-03 19:11:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dan Bornstein 2004-06-21 20:34:15 UTC
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.
Comment 1 Andrew Pinski 2004-08-03 19:11:00 UTC
Confirming to ...
Comment 2 Andrew Pinski 2004-08-03 19:11:09 UTC
Suspending until either new-regalloc branch is merged to mainline, or bug is rechecked against 
new-regalloc branch.
Comment 3 Andrew Pinski 2005-01-17 15:21:04 UTC
Closing as wiill not fix as new-ra was removed from the mainline.