From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20355 invoked by alias); 8 Dec 2002 05: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 20336 invoked by uid 71); 8 Dec 2002 05:06:00 -0000 Resent-Date: 8 Dec 2002 05:06:00 -0000 Resent-Message-ID: <20021208050600.20335.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, otaylor@redhat.com Received: (qmail 20205 invoked by uid 61); 8 Dec 2002 05:04:26 -0000 Message-Id: <20021208050426.20204.qmail@sources.redhat.com> Date: Sat, 07 Dec 2002 21:06:00 -0000 From: otaylor@redhat.com Reply-To: otaylor@redhat.com To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version: gnatsweb-2.9.3 (1.1.1.1.2.31) Subject: target/8869: ICE with const variable optimization and MMX builtins X-SW-Source: 2002-12/txt/msg00456.txt.bz2 List-Id: >Number: 8869 >Category: target >Synopsis: ICE with const variable optimization and MMX builtins >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: ice-on-legal-code >Submitter-Id: net >Arrival-Date: Sat Dec 07 21:06:00 PST 2002 >Closed-Date: >Last-Modified: >Originator: otaylor@redhat.com >Release: CVS head, 7 December 2002 >Organization: >Environment: Linux/ia32 >Description: There seems to be problems related to compile time determinable constants as arguments of the MMX builtin functions. (This bug appears to occur with gcc-3.2 as well, though I've only tested the Red Hat 8 compiler, not stock 3.2) >How-To-Repeat: The following code, when compiled with: gcc -c -O1 -mmmx -march=i686 -mcpu=i686 constant-pool-bug.c === typedef int v4hi __attribute__ ((mode(V4HI))); typedef int di __attribute__ ((mode(DI))); static const di mmx_constants[1] = { 0x00ff000000000000LL }; v4hi foo (v4hi val) { return __builtin_ia32_paddw (val, (v4hi)mmx_constants[0]); } === Produces: === constant-pool-bug.c: In function `foo': constant-pool-bug.c:9: internal compiler error: in output_constant_pool, at varasm.c:3485 === This does not occur with -O0. Note that the cast to 'v4hi' seems to be important here. If you try the same thing using porl, which takes a 'di' directly: === typedef int di __attribute__ ((mode(DI))); static const di mmx_constants[1] = { 0x00ff000000000000LL }; di foo (di val) { return __builtin_ia32_por (val, mmx_constants[0]); } === You get a different ICE: === constant-pool-bug.c: In function `foo': constant-pool-bug.c:7: internal compiler error: in ix86_expand_binop_builtin, at config/i386/i386.c:12819 === Which I believe is a a duplicate of #8600. (Some circumstantial evidence indicates that #8600 is hiding this bug here, not vice versa, but I'm not sure about that.) >Fix: >Release-Note: >Audit-Trail: >Unformatted: