OSDN Git Service

* env.c [__alpha__ && __osf__] (AES_SOURCE): Define.
[pf3gnuchains/gcc-fork.git] / gcc / omega.c
index 900ca85..e307ba2 100644 (file)
@@ -5,14 +5,15 @@
    This code has no license restrictions, and is considered public
    domain.
 
    This code has no license restrictions, and is considered public
    domain.
 
-   Changes copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
+   Changes copyright (C) 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
+   Inc.
    Contributed by Sebastian Pop <sebastian.pop@inria.fr>
 
 This file is part of GCC.
 
 GCC is free software; you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free
    Contributed by Sebastian Pop <sebastian.pop@inria.fr>
 
 This file is part of GCC.
 
 GCC is free software; you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free
-Software Foundation; either version 2, or (at your option) any later
+Software Foundation; either version 3, or (at your option) any later
 version.
 
 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
 version.
 
 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
@@ -21,9 +22,8 @@ FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 for more details.
 
 You should have received a copy of the GNU General Public License
 for more details.
 
 You should have received a copy of the GNU General Public License
-along with GCC; see the file COPYING.  If not, write to the Free
-Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA.  */
+along with GCC; see the file COPYING3.  If not see
+<http://www.gnu.org/licenses/>.  */
 
 /* For a detailed description, see "Constraint-Based Array Dependence
    Analysis" William Pugh, David Wonnacott, TOPLAS'98 and David
 
 /* For a detailed description, see "Constraint-Based Array Dependence
    Analysis" William Pugh, David Wonnacott, TOPLAS'98 and David
@@ -35,7 +35,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 #include "system.h"
 #include "coretypes.h"
 #include "tm.h"
 #include "system.h"
 #include "coretypes.h"
 #include "tm.h"
-#include "errors.h"
 #include "ggc.h"
 #include "tree.h"
 #include "diagnostic.h"
 #include "ggc.h"
 #include "tree.h"
 #include "diagnostic.h"
@@ -1306,7 +1305,7 @@ verify_omega_pb (omega_pb pb)
   enum omega_result result;
   int e;
   bool any_color = false;
   enum omega_result result;
   int e;
   bool any_color = false;
-  omega_pb tmp_problem = XNEW (struct omega_pb);
+  omega_pb tmp_problem = XNEW (struct omega_pb_d);
 
   omega_copy_problem (tmp_problem, pb);
   tmp_problem->safe_vars = 0;
 
   omega_copy_problem (tmp_problem, pb);
   tmp_problem->safe_vars = 0;
@@ -2287,7 +2286,7 @@ omega_eliminate_redundant (omega_pb pb, bool expensive)
   if (!expensive)
     goto eliminate_redundant_done;
 
   if (!expensive)
     goto eliminate_redundant_done;
 
-  tmp_problem = XNEW (struct omega_pb);
+  tmp_problem = XNEW (struct omega_pb_d);
   conservative++;
 
   for (e = pb->num_geqs - 1; e >= 0; e--)
   conservative++;
 
   for (e = pb->num_geqs - 1; e >= 0; e--)
@@ -2434,7 +2433,7 @@ smooth_weird_equations (omega_pb pb)
                if (dump_file && (dump_flags & TDF_DETAILS))
                  {
                    fprintf (dump_file,
                if (dump_file && (dump_flags & TDF_DETAILS))
                  {
                    fprintf (dump_file,
-                            "Smoothing wierd equations; adding:\n");
+                            "Smoothing weird equations; adding:\n");
                    omega_print_geq (dump_file, pb, &pb->geqs[e3]);
                    fprintf (dump_file, "\nto:\n");
                    omega_print_problem (dump_file, pb);
                    omega_print_geq (dump_file, pb, &pb->geqs[e3]);
                    fprintf (dump_file, "\nto:\n");
                    omega_print_problem (dump_file, pb);
@@ -2454,7 +2453,7 @@ coalesce (omega_pb pb)
 {
   int e, e2;
   int colors = 0;
 {
   int e, e2;
   int colors = 0;
-  bool *is_dead = XNEWVEC (bool, OMEGA_MAX_GEQS);
+  bool *is_dead;
   int found_something = 0;
 
   for (e = 0; e < pb->num_geqs; e++)
   int found_something = 0;
 
   for (e = 0; e < pb->num_geqs; e++)
@@ -2464,6 +2463,8 @@ coalesce (omega_pb pb)
   if (colors < 2)
     return;
 
   if (colors < 2)
     return;
 
+  is_dead = XNEWVEC (bool, OMEGA_MAX_GEQS);
+
   for (e = 0; e < pb->num_geqs; e++)
     is_dead[e] = false;
 
   for (e = 0; e < pb->num_geqs; e++)
     is_dead[e] = false;
 
@@ -2647,7 +2648,7 @@ omega_eliminate_red (omega_pb pb, bool eliminate_all)
     return;
 
   conservative++;
     return;
 
   conservative++;
-  tmp_problem = XNEW (struct omega_pb);
+  tmp_problem = XNEW (struct omega_pb_d);
 
   for (e = pb->num_geqs - 1; e >= 0; e--)
     if (pb->geqs[e].color == omega_red)
 
   for (e = pb->num_geqs - 1; e >= 0; e--)
     if (pb->geqs[e].color == omega_red)
@@ -3047,7 +3048,8 @@ omega_do_elimination (omega_pb pb, int e, int i)
              eqn->coef[j] *= a;
            k = eqn->coef[i];
            eqn->coef[i] = 0;
              eqn->coef[j] *= a;
            k = eqn->coef[i];
            eqn->coef[i] = 0;
-           eqn->color |= sub->color;
+           if (sub->color == omega_red)
+             eqn->color = omega_red;
            for (j = n_vars; j >= 0; j--)
              eqn->coef[j] -= sub->coef[j] * k / c;
          }
            for (j = n_vars; j >= 0; j--)
              eqn->coef[j] -= sub->coef[j] * k / c;
          }
@@ -3489,7 +3491,7 @@ parallel_splinter (omega_pb pb, int e, int diff,
       omega_print_problem (dump_file, pb);
     }
 
       omega_print_problem (dump_file, pb);
     }
 
-  tmp_problem = XNEW (struct omega_pb);
+  tmp_problem = XNEW (struct omega_pb_d);
   omega_copy_eqn (&pb->eqs[0], &pb->geqs[e], pb->num_vars);
   pb->num_eqs = 1;
 
   omega_copy_eqn (&pb->eqs[0], &pb->geqs[e], pb->num_vars);
   pb->num_eqs = 1;
 
@@ -5497,7 +5499,7 @@ omega_alloc_problem (int nvars, int nprot)
   omega_initialize ();
 
   /* Allocate and initialize PB.  */
   omega_initialize ();
 
   /* Allocate and initialize PB.  */
-  pb = XCNEW (struct omega_pb);
+  pb = XCNEW (struct omega_pb_d);
   pb->var = XCNEWVEC (int, OMEGA_MAX_VARS + 2);
   pb->forwarding_address = XCNEWVEC (int, OMEGA_MAX_VARS + 2);
   pb->geqs = omega_alloc_eqns (0, OMEGA_MAX_GEQS);
   pb->var = XCNEWVEC (int, OMEGA_MAX_VARS + 2);
   pb->forwarding_address = XCNEWVEC (int, OMEGA_MAX_VARS + 2);
   pb->geqs = omega_alloc_eqns (0, OMEGA_MAX_GEQS);