This is the mail archive of the gcc@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]

Re: ICE in gcc/libgcc2.c:566 (gcc trunk)


Hi Ian,
sorry to bother again. I reduced the code (attached) that segfaults here
on Core 2 Duo [1]. If I add -fno-split-wide-types the code does not segfault.
That flag comes from your patchset [2].

execute: 
# ./cc1 -quiet -m64 -O1 test.c -o test.o

Any ideas?


Regards,
Hanno

[1] http://gcc.gnu.org/ml/gcc/2007-02/msg00095.html
[2] http://gcc.gnu.org/ml/gcc-patches/2007-02/msg00002.html
typedef int TItype __attribute__ ((mode (TI)));
typedef int DItype __attribute__ ((mode (DI)));
typedef unsigned int UDItype __attribute__ ((mode (DI)));

struct DWstruct {DItype low, high;};
typedef union
{
  struct DWstruct s;
  TItype ll;
} DWunion;

TItype
__multi3 (TItype u, TItype v)
{
  const DWunion uu = {.ll = u};
  const DWunion vv = {.ll = v};
  DWunion w = {
    .ll = ({
      DWunion __w;
      do {
        UDItype __x0, __x1, __x2, __x3;
        UDItype __ul, __vl, __uh, __vh;
        __ul = ((UDItype) (uu.s.low) & (((UDItype) 1 << ((8 * 8) / 2)) - 1));
        __uh = ((UDItype) (uu.s.low) >> ((8 * 8) / 2));
        __vl = ((UDItype) (vv.s.low) & (((UDItype) 1 << ((8 * 8) / 2)) - 1));
        __vh = ((UDItype) (vv.s.low) >> ((8 * 8) / 2));
        __x0 = (UDItype) __ul * __vl;
        __x1 = (UDItype) __ul * __vh;
        __x2 = (UDItype) __uh * __vl;
        __x3 = (UDItype) __uh * __vh;
        __x1 += ((UDItype) (__x0) >> ((8 * 8) / 2));
        __x1 += __x2; if (__x1 < __x2) __x3 += ((UDItype) 1 << ((8 * 8) / 2));
        (__w.s.high) = __x3 + ((UDItype) (__x1) >> ((8 * 8) / 2));
        (__w.s.low) = ((UDItype) (__x1) & (((UDItype) 1 << ((8 * 8) / 2)) - 1))
		    * ((UDItype) 1 << ((8 * 8) / 2))
		    + ((UDItype) (__x0) & (((UDItype) 1 << ((8 * 8) / 2)) - 1));
      } while (0);
      __w.ll;
    }
  )};

  w.s.high += ((UDItype) uu.s.low * (UDItype) vv.s.high
        + (UDItype) uu.s.high * (UDItype) vv.s.low);

  return w.ll;
}

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