public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* target/8869: ICE with const variable optimization and MMX builtins
@ 2002-12-07 21:06 otaylor
  0 siblings, 0 replies; 2+ messages in thread
From: otaylor @ 2002-12-07 21:06 UTC (permalink / raw)
  To: gcc-gnats


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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: target/8869: ICE with const variable optimization and MMX builtins
@ 2002-12-08 13:27 reichelt
  0 siblings, 0 replies; 2+ messages in thread
From: reichelt @ 2002-12-08 13:27 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, nobody, otaylor

Synopsis: ICE with const variable optimization and MMX builtins

State-Changed-From-To: open->analyzed
State-Changed-By: reichelt
State-Changed-When: Sun Dec  8 13:27:18 2002
State-Changed-Why:
    Confirmed.
    The bug is already present in gcc 3.1

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=8869


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-12-08 21:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-12-07 21:06 target/8869: ICE with const variable optimization and MMX builtins otaylor
2002-12-08 13:27 reichelt

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).