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]

Re: optimization/3770: ICE on -mcpu=ultrasparc -O2

[Get raw message]

> Synopsis: ICE on -mcpu=ultrasparc -O2
> State-Changed-Why:
>     Same problem as PR/3623, PR/4420, PR/3306.  Register %f34
>     cannot handle a SFmode (see fix in PR/3623).  TBH, this PR
>     cannot be reproduced because attachment cannot be downloaded.

It should have been attached to the PR when setting it up, but I attach it
to this mail again.
Regards
  Wolfgang

-------------------------------------------------------------------------
Wolfgang Bangerth          email: wolfgang.bangerth@iwr.uni-heidelberg.de
                             www: http://gaia.iwr.uni-heidelberg.de/~wolf


// compile with -mcpu=ultrasparc -O2
struct FullMatrix
{
    float & el (const unsigned int i, const unsigned int j);
    float* val;
    unsigned int num_cols;
    void invert (FullMatrix &M);
};


inline float &
FullMatrix::el (const unsigned int i, const unsigned int j)
{
  return val[i*num_cols+j];
};


void
FullMatrix::invert (FullMatrix &M)
{
  switch (num_cols)
    {
      case 4:
      {
        const float t14 = M.el(0,0)*M.el(1,1);
        const float t15 = M.el(2,2)*M.el(3,3);
        const float t17 = M.el(2,3)*M.el(3,2);
        const float t19 = M.el(0,0)*M.el(2,1);
        const float t20 = M.el(1,2)*M.el(3,3);
        const float t22 = M.el(1,3)*M.el(3,2);
        const float t24 = M.el(0,0)*M.el(3,1);
        const float t25 = M.el(1,2)*M.el(2,3);
        const float t27 = M.el(1,3)*M.el(2,2);
        const float t29 = M.el(1,0)*M.el(0,1);
        const float t32 = M.el(1,0)*M.el(2,1);
        const float t33 = M.el(0,2)*M.el(3,3);
        const float t35 = M.el(0,3)*M.el(3,2);
        const float t37 = M.el(1,0)*M.el(3,1);
        const float t38 = M.el(0,2)*M.el(2,3);
        const float t40 = M.el(0,3)*M.el(2,2);
        const float t42 = t14*t15-t14*t17-t19*t20+t19*t22+
                           t24*t25-t24*t27-t29*t15+t29*t17+
                           t32*t33-t32*t35-t37*t38+t37*t40;
        const float t43 = M.el(2,0)*M.el(0,1);
        const float t46 = M.el(2,0)*M.el(1,1);
        const float t49 = M.el(2,0)*M.el(3,1);
        const float t50 = M.el(0,2)*M.el(1,3);
        const float t52 = M.el(0,3)*M.el(1,2);
        const float t54 = M.el(3,0)*M.el(0,1);
        const float t57 = M.el(3,0)*M.el(1,1);
        const float t60 = M.el(3,0)*M.el(2,1);
        const float t63 = t43*t20-t43*t22-t46*t33+t46*t35+
                           t49*t50-t49*t52-t54*t25+t54*t27+
                           t57*t38-t57*t40-t60*t50+t60*t52;
        const float t65 = 1/(t42+t63);
        const float t71 = M.el(0,2)*M.el(2,1);
        const float t73 = M.el(0,3)*M.el(2,1);
        const float t75 = M.el(0,2)*M.el(3,1);
        const float t77 = M.el(0,3)*M.el(3,1);
        const float t81 = M.el(0,1)*M.el(1,2);
        const float t83 = M.el(0,1)*M.el(1,3);
        const float t85 = M.el(0,2)*M.el(1,1);
        const float t87 = M.el(0,3)*M.el(1,1);
        const float t101 = M.el(1,0)*M.el(2,2);
        const float t103 = M.el(1,0)*M.el(2,3);
        const float t105 = M.el(2,0)*M.el(1,2);
        const float t107 = M.el(2,0)*M.el(1,3);
        const float t109 = M.el(3,0)*M.el(1,2);
        const float t111 = M.el(3,0)*M.el(1,3);
        const float t115 = M.el(0,0)*M.el(2,2);
        const float t117 = M.el(0,0)*M.el(2,3);
        const float t119 = M.el(2,0)*M.el(0,2);
        const float t121 = M.el(2,0)*M.el(0,3);
        const float t123 = M.el(3,0)*M.el(0,2);
        const float t125 = M.el(3,0)*M.el(0,3);
        const float t129 = M.el(0,0)*M.el(1,2);
        const float t131 = M.el(0,0)*M.el(1,3);
        const float t133 = M.el(1,0)*M.el(0,2);
        const float t135 = M.el(1,0)*M.el(0,3);
        el(0,0) = (M.el(1,1)*M.el(2,2)*M.el(3,3)-M.el(1,1)*M.el(2,3)*M.el(3,2)-
                   M.el(2,1)*M.el(1,2)*M.el(3,3)+M.el(2,1)*M.el(1,3)*M.el(3,2)+
                   M.el(3,1)*M.el(1,2)*M.el(2,3)-M.el(3,1)*M.el(1,3)*M.el(2,2))*t65;
        el(0,1) = -(M.el(0,1)*M.el(2,2)*M.el(3,3)-M.el(0,1)*M.el(2,3)*M.el(3,2)-
                    t71*M.el(3,3)+t73*M.el(3,2)+t75*M.el(2,3)-t77*M.el(2,2))*t65;
        el(0,2) = (t81*M.el(3,3)-t83*M.el(3,2)-t85*M.el(3,3)+t87*M.el(3,2)+
                   t75*M.el(1,3)-t77*M.el(1,2))*t65;
        el(0,3) = -(t81*M.el(2,3)-t83*M.el(2,2)-t85*M.el(2,3)+t87*M.el(2,2)+
                    t71*M.el(1,3)-t73*M.el(1,2))*t65;
        el(1,0) = -(t101*M.el(3,3)-t103*M.el(3,2)-t105*M.el(3,3)+t107*M.el(3,2)+
                    t109*M.el(2,3)-t111*M.el(2,2))*t65;

        break;
      }

      default:
            *this = M;
    };
};




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