Bug 34266 - ICE
Summary: ICE
Status: RESOLVED DUPLICATE of bug 31684
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 4.2.2
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-11-28 19:11 UTC by Kate Minola
Modified: 2008-01-09 19:11 UTC (History)
5 users (show)

See Also:
Host: ia64-unknown-linux-gnu
Target: ia64-unknown-linux-gnu
Build: ia64-unknown-linux-gnu
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kate Minola 2007-11-28 19:11:42 UTC
/*
% uname -a
Linux lepidus 2.4.21-sgi302r24 #1 SMP Fri Oct 22 22:43:12 PDT 2004 ia64 ia64 ia64 GNU/Linux
% gcc -v
Using built-in specs.
Target: ia64-unknown-linux-gnu
Configured with: /usr/local/gcc-4.2.2/src/gcc-4.2.2/configure --enable-languages=c,c++,fortran --with-gnu-as --with-as=/usr/local/binutils-2.17/ia64-Linux-gcc-4.1.1/bin/as --with-gnu-ld --with-ld=/usr/local/binutils-2.17/ia64-Linux-gcc-4.1.1/bin/ld --with-gmp=/usr/local/gmp-4.2.1/ia64-Linux-gcc-4.2.0 --with-mpfr=/usr/local/mpfr-2.2.1/ia64-Linux-gmp-4.2.1-gcc-4.2.0 --prefix=/usr/local/gcc-4.2.2/ia64-Linux
Thread model: posix
gcc version 4.2.2
%
% gcc -funroll-loops -O2 -c foo.c    // gives ICE
%
% gcc -funroll-loops -O1 -c foo.c    // compiles successfully
% gcc -O2 -c foo.c                   // compiles successfully
%
% gcc-4.3-20071123 -funroll-loops -O2 -c foo.c
                                     // compiles successfully
*/


/*
from GNU gmp "longlong.h"
*/
#define umul_ppmm(ph, pl, m0, m1) \
    __asm__ ("xma.hu %0 = %2, %3, f0\n\txma.l %1 = %2, %3, f0"          \
             : "=&f" (ph), "=f" (pl)                                    \
             : "f" (m0), "f" (m1))

/* cut down from sage-2.8.14/flint-0.9-r1075.p1/ZmodF_mul.c */
inline
void bar(long* out, long a)
{
   umul_ppmm(*out, *out, a, a);
   *out += a * a;
}

void foo(long* out, long* in, long len)
{
   int i;   for (i = 0; i < len; i++)
      bar(out, in[i]);
}
Comment 1 Jim Wilson 2008-01-09 19:11:29 UTC
This is the same problem as PR 31684, which is fixed on mainline (pre-release gcc-4.3) but not on the gcc-4.2 branch.

*** This bug has been marked as a duplicate of 31684 ***