https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109566

            Bug ID: 109566
           Summary: powerpc: unrecognizable insn for -mcpu=e6500
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: sebastian.hu...@embedded-brains.de
  Target Milestone: ---

Consider the following test case:

typedef int __int32_t;
typedef unsigned int __uint32_t;
typedef union
{
  double value;
  struct
  {
    __uint32_t msw;
    __uint32_t lsw;
  } parts;
} ieee_double_shape_type;
 double __ieee754_fmod(double x, double y)
{
 __int32_t n,hx,hy,hz,ix,iy,sx,i;
 __uint32_t lx,ly,lz;
 do { ieee_double_shape_type ew_u; ew_u.value = (x); (hx) = ew_u.parts.msw;
(lx) = ew_u.parts.lsw; } while (0);
 sx = hx&0x80000000;
 hx ^=sx;
 if(hx<=hy) {
 }
 if(hx<0x00100000) {
     if(hx==0) {
  for (ix = -1043, i=lx; i>0; i<<=1) ix -=1;
     }
 } else ix = (hx>>20)-1023;
 if(ix >= -1022)
     hx = 0x00100000|(0x000fffff&hx);
 while(hx<0x00100000) {
     if(n<=20) {
     }
 }
}

This yields:

powerpc-rtems6-gcc -O2  -mcpu=e6500  -c test.c
test.c: In function '__ieee754_fmod':
test.c:32:1: error: unrecognizable insn:
   32 | }
      | ^
(insn 52 8 53 2 (parallel [
            (set (reg:CC 100 0)
                (compare:CC (and:DI (ashift:DI (reg:DI 9 9 [123])
                            (const_int 33 [0x21]))
                        (const_int -9007199254740992 [0xffe0000000000000]))
                    (const_int 0 [0])))
            (clobber (reg:DI 9 9 [129]))
        ]) "test.c":21:4 -1
     (nil))
during RTL pass: split2
test.c:32:1: internal compiler error: in extract_insn, at recog.cc:2791
0x40730a _fatal_insn(char const*, rtx_def const*, char const*, int, char
const*)
        /home/EB/sebastian_h/src/gcc/gcc/rtl-error.cc:108
0x407329 _fatal_insn_not_found(rtx_def const*, char const*, int, char const*)
        /home/EB/sebastian_h/src/gcc/gcc/rtl-error.cc:116
0x957477 extract_insn(rtx_insn*)
        /home/EB/sebastian_h/src/gcc/gcc/recog.cc:2791
0x9574d1 extract_insn_cached(rtx_insn*)
        /home/EB/sebastian_h/src/gcc/gcc/recog.cc:2680
0x6a9a0b cleanup_subreg_operands(rtx_insn*)
        /home/EB/sebastian_h/src/gcc/gcc/final.cc:3054
0x95583c split_insn
        /home/EB/sebastian_h/src/gcc/gcc/recog.cc:3420
0x95a5b2 split_all_insns()
        /home/EB/sebastian_h/src/gcc/gcc/recog.cc:3488
0x95a6c8 execute
        /home/EB/sebastian_h/src/gcc/gcc/recog.cc:4412
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

Reply via email to