OSDN Git Service

PR 49214 fd_gets should return NULL if nothing was read
[pf3gnuchains/gcc-fork.git] / gcc / ira-costs.c
index dd3123c..f517386 100644 (file)
@@ -1294,7 +1294,8 @@ scan_one_insn (rtx insn)
       && (note = find_reg_note (insn, REG_EQUIV, NULL_RTX)) != NULL_RTX
       && ((MEM_P (XEXP (note, 0)))
          || (CONSTANT_P (XEXP (note, 0))
-             && LEGITIMATE_CONSTANT_P (XEXP (note, 0))
+             && targetm.legitimate_constant_p (GET_MODE (SET_DEST (set)),
+                                               XEXP (note, 0))
              && REG_N_SETS (REGNO (SET_DEST (set))) == 1)))
     {
       enum reg_class cl = GENERAL_REGS;
@@ -1663,10 +1664,10 @@ find_costs_and_classes (FILE *dump_file)
                }
            }
          if (equiv_savings < 0)
-           temp_costs->mem_cost = -equiv_savings;
+           i_mem_cost = -equiv_savings;
          else if (equiv_savings > 0)
            {
-             temp_costs->mem_cost = 0;
+             i_mem_cost = 0;
              for (k = cost_classes_ptr->num - 1; k >= 0; k--)
                i_costs[k] += equiv_savings;
            }
@@ -1968,19 +1969,15 @@ free_ira_costs (void)
 {
   int i;
 
-  if (init_cost != NULL)
-    free (init_cost);
+  free (init_cost);
   init_cost = NULL;
   for (i = 0; i < MAX_RECOG_OPERANDS; i++)
     {
-      if (op_costs[i] != NULL)
-       free (op_costs[i]);
-      if (this_op_costs[i] != NULL)
-       free (this_op_costs[i]);
+      free (op_costs[i]);
+      free (this_op_costs[i]);
       op_costs[i] = this_op_costs[i] = NULL;
     }
-  if (temp_costs != NULL)
-    free (temp_costs);
+  free (temp_costs);
   temp_costs = NULL;
 }