This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

target/8869: ICE with const variable optimization and MMX builtins


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]