From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15754 invoked by alias); 21 Jun 2011 14:38:06 -0000 Received: (qmail 15745 invoked by uid 22791); 21 Jun 2011 14:38:06 -0000 X-SWARE-Spam-Status: No, hits=-2.7 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 21 Jun 2011 14:37:52 +0000 From: "gandalf at winds dot org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/49487] New: Internal compiler error in AVR code X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: gandalf at winds dot org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Date: Tue, 21 Jun 2011 14:38:00 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2011-06/txt/msg01888.txt.bz2 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)