target/8870: ICE converting from unsigned short to MMX type

otaylor@redhat.com otaylor@redhat.com
Sat Dec 7 21:36:00 GMT 2002


>Number:         8870
>Category:       target
>Synopsis:       ICE converting from unsigned short to MMX type
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          ice-on-legal-code
>Submitter-Id:   net
>Arrival-Date:   Sat Dec 07 21:36:00 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     otaylor@redhat.com
>Release:        CVS Head, 7 December 2002
>Organization:
>Environment:
Linux/ia32
>Description:
Conversions directly from a 16-bit unsigned integer 
to a MMX type cause problems. (Conversion from
a 16-bit signed integer works fine, however.)
>How-To-Repeat:
When compiled with:

 gcc -c -O1 -mmmx -march=i686 -mcpu=i686 truncate-bug.c

===
typedef int v4hi __attribute__ ((mode (V4HI)));

static inline v4hi
cvtsi_v4hi (int i)
{
  long long tmp = (unsigned int)i;
  return (v4hi) tmp;
}

v4hi
bar (unsigned short a)
{
  return cvtsi_v4hi (a);
}
===

Produces:

===
truncate-bug.c: In function `bar':
truncate-bug.c:14: internal compiler error: in trunc_int_for_mode, at explow.c:54
===

This code compiles without error with the Red Hat 8
compiler, so probably with stock gcc-3.2 as well.

Changing 'unsigned short' to 'short' above, makes the
ICE go away.
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the Gcc-prs mailing list