public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: otaylor@redhat.com
To: gcc-gnats@gcc.gnu.org
Subject: target/8869: ICE with const variable optimization and MMX builtins
Date: Sat, 07 Dec 2002 21:06:00 -0000	[thread overview]
Message-ID: <20021208050426.20204.qmail@sources.redhat.com> (raw)


>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:


             reply	other threads:[~2002-12-08  5:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-12-07 21:06 otaylor [this message]
2002-12-08 13:27 reichelt

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=20021208050426.20204.qmail@sources.redhat.com \
    --to=otaylor@redhat.com \
    --cc=gcc-gnats@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).