- ir_mode *mode = get_irn_mode(node);
- tarval *tv;
- unsigned bits;
-
- if (mode_is_int(mode)) {
- tv = get_Const_tarval(node);
- bits = log2(get_tarval_long(tv));
-
- if (bits > ARR_SIZE(status->const_info.int_bits_count))
- bits = ARR_SIZE(status->const_info.int_bits_count);
-
- cnt_inc(&status->const_info.int_bits_count[bits]);
- }
- else if (mode_is_float(mode)) {
- tv = get_Const_tarval(node);
-
- cnt_inc(&status->const_info.floats[classify_float_value(tv)]);
- }
- else {
- /* something different */
- cnt_inc(&status->const_info.others);
- }
+ ir_mode *mode = get_irn_mode(node);
+ tarval *tv;
+ unsigned bits;
+
+ if (mode_is_int(mode)) {
+ tv = get_Const_tarval(node);
+
+ /* FIXME: */
+ if (! tarval_is_long(tv))
+ return;
+
+ bits = log2abs(get_tarval_long(tv));
+
+ if (bits > ARR_SIZE(status->const_info.int_bits_count))
+ bits = ARR_SIZE(status->const_info.int_bits_count);
+
+ cnt_inc(&status->const_info.int_bits_count[bits]);
+ } else if (mode_is_float(mode)) {
+ tv = get_Const_tarval(node);
+
+ cnt_inc(&status->const_info.floats[classify_float_value(tv)]);
+ } else {
+ /* something different */
+ cnt_inc(&status->const_info.others);
+ }