From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27615 invoked by alias); 11 Jul 2002 14:06: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 27596 invoked by uid 71); 11 Jul 2002 14:06:00 -0000 Resent-Date: 11 Jul 2002 14:06:00 -0000 Resent-Message-ID: <20020711140600.27595.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 25115 invoked from network); 11 Jul 2002 14:01:12 -0000 Received: from unknown (HELO mta01.chello.no) (212.186.255.12) by sources.redhat.com with SMTP; 11 Jul 2002 14:01:12 -0000 Received: from s.hn.org ([213.46.219.180]) by mta01.chello.no (InterMail vK.4.04.00.00 201-232-137 license e49469e1064252e0c4d3b333458c6cb7) with SMTP id <20020711140111.FBST402.mta01@s.hn.org> for ; Thu, 11 Jul 2002 16:01:11 +0200 Received: (qmail 2661 invoked by uid 1000); 11 Jul 2002 14:01:10 -0000 Message-Id: <20020711140110.2660.qmail@s.hn.org> Date: Thu, 11 Jul 2002 07:06:00 -0000 From: hakonrk@fys.uio.no To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version: 3.113 Subject: c/7277: Casting integers to vector types causes internal compiler error X-SW-Source: 2002-07/txt/msg00329.txt.bz2 List-Id: >Number: 7277 >Category: c >Synopsis: Casting integers to vector types causes internal compiler error >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: ice-on-legal-code >Submitter-Id: net >Arrival-Date: Thu Jul 11 07:06: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 Distribution: Slackware 8.1 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 >Description: Casting integers into vector types (of the same size) causes internal compiler errors. The following illustrates what happens when casting from a constant integer (code shown in How-To-Repeat): ############################################################################## $ gcc -v -c -mmmx cast.c Reading specs from /usr/local/gcc-3.1/lib/gcc-lib/i686-pc-linux-gnu/3.1/specs Configured with: /local/build/gcc/gcc-3.1/configure --prefix=/usr/local/gcc-3.1 --enable-languages=c --disable-nls Thread model: single gcc version 3.1 /usr/local/gcc-3.1/lib/gcc-lib/i686-pc-linux-gnu/3.1/cc1 -lang-c -v -D__GNUC__=3 -D__GNUC_MINOR__=1 -D__GNUC_PATCHLEVEL__=0 -D__ELF__ -Dunix -D__gnu_linux__ -Dlinux -D__ELF__ -D__unix__ -D__gnu_linux__ -D__linux__ -D__unix -D__linux -Asystem=posix -D__NO_INLINE__ -D__STDC_HOSTED__=1 -Acpu=i386 -Amachine=i386 -Di386 -D__i386 -D__i386__ -D__tune_i686__ -D__tune_pentiumpro__ cast.c -quiet -dumpbase cast.c -mmmx -version -o /tmp/cc2ubmWE.s GNU CPP version 3.1 (cpplib) (i386 Linux/ELF) GNU C version 3.1 (i686-pc-linux-gnu) compiled by GNU C version 3.1. ignoring nonexistent directory "/usr/local/gcc-3.1/i686-pc-linux-gnu/include" #include "..." search starts here: #include <...> search starts here: /usr/local/include /usr/local/gcc-3.1/include /usr/local/gcc-3.1/lib/gcc-lib/i686-pc-linux-gnu/3.1/include /usr/include End of search list. cast.c: In function `null': cast.c:6: Internal compiler error in output_constant_pool, at varasm.c:4064 Please submit a full bug report, with preprocessed source if appropriate. See for instructions. ############################################################################## When casting from a non-volatile variable, a new ICE appears if and only if optimization is enabled: Internal compiler error in subst, at combine.c:3546 This ICE will also manifest itself if one tries to trick the compiler by using a union of "long long" and "v8qi", assigning to the "long long" variable and returning the "v8qi" variable. Again, the ICE only appears when optimization is enabled. >How-To-Repeat: # 1 "cast.c" typedef int v8qi __attribute__ ((mode(V8QI))); v8qi null(void) { return (v8qi) 0LL; } >Fix: Work-around: Use a volatile temporary variable: /****************************************************************************/ typedef int v8qi __attribute__ ((mode(V8QI))); v8qi null(void) { volatile long long tmp = 0LL; return (v8qi) tmp; } /****************************************************************************/ >Release-Note: >Audit-Trail: >Unformatted: