[Bug tree-optimization/28411] gfortran: Internal error: Illegal instruction

2006-07-18 Thread uros at kss-loka dot si


--- Comment #5 from uros at kss-loka dot si  2006-07-18 08:06 ---
This error can be tracked down to fold_negate_expr() returning NULL_TREE via
this path:

(a) constant_multiple_of() calls fold_unary_to_constant():

  /* If BOT seems to be negative, try dividing by -BOT instead, and negate
 the result afterwards.  */
  if (tree_int_cst_sign_bit (bot))
{
  negate = true;
  bot = fold_unary_to_constant (NEGATE_EXPR, type, bot);
}

(b) fold_unary_to_constant() calls fold_unary()

(c) fold_unary() calls fold_unary_negate() for NEGATE_EXPR:

case NEGATE_EXPR:
  tem = fold_negate_expr (arg0);
  if (tem)
return fold_convert (type, tem);
  return NULL_TREE;

(d) fold_negate_expr() returns NULL_TREE, because:

case INTEGER_CST:
  tem = fold_negate_const (t, type);
  if (! TREE_OVERFLOW (tem)
  || TYPE_UNSIGNED (type)
  || ! flag_trapv)
return tem;
  break;
  ...

default:
  break;
}

  return NULL_TREE;
}

From here, I don't know, what a correct solution would be...


-- 

uros at kss-loka dot si changed:

   What|Removed |Added

 CC||uros at kss-loka dot si


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



[Bug tree-optimization/28411] gfortran: Internal error: Illegal instruction

2006-07-18 Thread pinskia at gcc dot gnu dot org


--- Comment #6 from pinskia at gcc dot gnu dot org  2006-07-18 08:10 ---
(In reply to comment #5)
 This error can be tracked down to fold_negate_expr() returning NULL_TREE via
 this path:
 
 (a) constant_multiple_of() calls fold_unary_to_constant():

This tells you that constant_multiple_of is not able to handle NULL_TREEs for
the return of fold_unary_to_constant which is correct as the negative of
0x8000 will trap.


-- 


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