------- Comment #5 from pinskia at gcc dot gnu dot org  2006-12-13 06:40 -------
Reduced testcase:
typedef struct num {
char is_fixnum;
long long ivalue;
} num;
num num_intdiv(num a, num b)
{
  num ret;
  ret.ivalue = a.ivalue / b.ivalue;
  return ret;
}

-----------
On the trunk we get a better ICE:
t.i: In function ‘num_intdiv’:
t.i:8: internal compiler error: in emit_move_insn, at expr.c:3276
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.

This comes:
(define_expand "div<mode>3"
  [(set (match_operand:GPR 0 "gpc_reg_operand" "")
        (div:GPR (match_operand:GPR 1 "gpc_reg_operand" "")
                 (match_operand:GPR 2 "reg_or_cint_operand" "")))]
  ""
  "
{
  if (GET_CODE (operands[2]) == CONST_INT
      && INTVAL (operands[2]) > 0
      && exact_log2 (INTVAL (operands[2])) >= 0)
    ;
  else if (TARGET_POWERPC)
    {
      operands[2] = force_reg (SImode, operands[2]); <--- this force_reg

but it is obvious we could have DImode here.  operands[2] here is a subreg of a
TImode.
I commented out the defintion for MAX_FIXED_MODE_SIZE and it works.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   GCC host triplet|powerpc64-linux-gnu         |
 GCC target triplet|powerpc64-linux-gnu         |powerpc64-*-*
           Keywords|                            |ice-on-valid-code
   Last reconfirmed|0000-00-00 00:00:00         |2006-12-13 06:40:57
               date|                            |
            Summary|ICE with unrecognizable insn|[4.1/4.2/4.3 Regression] ICE
                   |on powerpc64 while building |with struct and divide
                   |gimp with -O1+              |
   Target Milestone|---                         |4.1.2


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30185

Reply via email to