From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19037 invoked by alias); 10 Jul 2002 23:36:00 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 19018 invoked by uid 71); 10 Jul 2002 23:36:00 -0000 Resent-Date: 10 Jul 2002 23:36:00 -0000 Resent-Message-ID: <20020710233600.19017.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-To: nobody@gcc.gnu.org Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, hakonrk@fys.uio.no Received: (qmail 17624 invoked from network); 10 Jul 2002 23:27:21 -0000 Received: from unknown (HELO mta02.chello.no) (212.186.255.11) by sources.redhat.com with SMTP; 10 Jul 2002 23:27:21 -0000 Received: from s.hn.org ([213.46.219.180]) by mta02.chello.no (InterMail vK.4.04.00.00 201-232-137 license e49469e1064252e0c4d3b333458c6cb7) with SMTP id <20020710232719.FRAG604.mta02@s.hn.org> for ; Thu, 11 Jul 2002 01:27:19 +0200 Received: (qmail 11657 invoked by uid 1000); 10 Jul 2002 23:27:19 -0000 Message-Id: <20020710232719.11656.qmail@s.hn.org> Date: Wed, 10 Jul 2002 16:36:00 -0000 From: hakonrk@fys.uio.no To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version: 3.113 Subject: c/7267: GCC 3.1 crash when using MMX code and -funroll-loops X-SW-Source: 2002-07/txt/msg00313.txt.bz2 List-Id: >Number: 7267 >Category: c >Synopsis: GCC 3.1 crash when using MMX code and -funroll-loops >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: ice-on-legal-code >Submitter-Id: net >Arrival-Date: Wed Jul 10 16:36:00 PDT 2002 >Closed-Date: >Last-Modified: >Originator: Haakon Riiser >Release: 3.1 >Organization: University of Oslo >Environment: System: Linux s 2.4.18 #2 Thu Jun 6 00:23:32 CEST 2002 i686 unknown Architecture: i686 host: i686-pc-linux-gnu build: i686-pc-linux-gnu target: i686-pc-linux-gnu configured with: /local/build/gcc/gcc-3.1/configure --prefix=/usr/local/gcc-3.1 --enable-languages=c --disable-nls Also verified o >Description: When compiling the code shown in "How-To-Repeat" with optimization and unroll-loops enabled, GCC 3.1 dies with an internal compiler error. The bug looks exactly the same in GCC 2.96 from Red Hat Linux 7.2 and 7.3, but GCC 2.95.3 produces the following output: foo.c: In function `foo': foo.c:7: invalid `asm': invalid expression as operand foo.c:8: invalid `asm': invalid expression as operand foo.c:7: invalid `asm': invalid expression as operand foo.c:8: invalid `asm': invalid expression as operand The code compiles perfectly with all tested GCC versions when "-funroll-loops" is not used. >How-To-Repeat: Compile with "gcc -c -O -funroll-loops foo.c". Preprocessor output follows: # 1 "foo.c" void foo(char *dst, int w) { int i; for (i = 0; i < 2; i++) { asm volatile ("movq %%mm0, %0\n" : "=X" (*(dst + w * 2))); asm volatile ("movq %%mm0, %0\n" : "=X" (*(dst + w * 2))); dst++; } asm volatile ("emms\n"); } >Fix: Work-around: Don't use -funroll-loops. >Release-Note: >Audit-Trail: >Unformatted: