public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "gandalf at winds dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/49487] New: Internal compiler error in AVR code
Date: Tue, 21 Jun 2011 14:38:00 -0000	[thread overview]
Message-ID: <bug-49487-4@http.gcc.gnu.org/bugzilla/> (raw)

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

           Summary: Internal compiler error in AVR code
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: gandalf@winds.org
                CC: eric.weddington@atmel.com
              Host: x86_64-unknown-linux-gnu
            Target: avr-unknown-none
             Build: x86_64-unknown-linux-gnu


Compiling the following function triggers an internal compiler error in (at
least) GCC versions 4.2, 4.3, 4.5 and the latest 4.7.0-20110620:

unsigned int test(unsigned int *ptr, unsigned int len)
{
  unsigned int sum=0, *p=ptr;

  while(p < ptr+len)
    sum += ({ unsigned int _x=(*p++); (_x << 8) | (_x >> 8); });

  if(__builtin_expect(len & 1, 0))
    sum += *p;

  return ~sum;
}

Compiler command and resulting output:

avr-gcc -O3 -Wall -mmcu=atmega644   -c -o test3.o test3.c
test3.c: In function 'test':
test3.c:12:1: error: could not split insn
(insn 40 38 41 (parallel [
            (set (reg:HI 20 r20 [92])
                (rotate:HI (reg/v:HI 20 r20 [orig:67 _x ] [67])
                    (const_int 8 [0x8])))
            (clobber (mem/c:QI (plus:HI (reg/f:HI 28 r28)
                        (const_int 1 [0x1])) [4 %sfp+1 S1 A8]))
        ]) test3.c:6 64 {*rotbhi}
     (nil))
test3.c:12:1: internal compiler error: in final_scan_insn, at final.c:2724

This was compiled using a cross-compiler on an x86_64 system as outlined below:

Target: avr
Configured with: ../configure --target=avr --prefix=/usr/local/avr
--disable-nls --enable-languages=c --disable-bootstrap --disable-libssp
Thread model: single
gcc version 4.7.0 20110620 (experimental) (GCC)


             reply	other threads:[~2011-06-21 14:38 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-21 14:38 gandalf at winds dot org [this message]
2011-06-21 15:28 ` [Bug target/49487] " eric.weddington at atmel dot com
2011-06-21 15:58 ` j at uriah dot heep.sax.de
2011-06-21 16:15 ` eric.weddington at atmel dot com
2011-06-21 17:18 ` gandalf at winds dot org
2011-06-24 20:12 ` gjl at gcc dot gnu.org
2011-07-13 12:15 ` [Bug target/49487] Internal compiler error in AVR code (bytewise rotate) gjl at gcc dot gnu.org
2011-07-14 15:11 ` gjl at gcc dot gnu.org
2011-07-14 15:18 ` gjl at gcc dot gnu.org
2011-07-14 15:18 ` gjl at gcc dot gnu.org
2011-07-25  8:43 ` gjl at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-49487-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).