*** empty log message ***
authorchris <none@none>
Tue, 30 Nov 1999 15:20:10 +0000 (15:20 +0000)
committerchris <none@none>
Tue, 30 Nov 1999 15:20:10 +0000 (15:20 +0000)
narray/analyze.c

index 77029991e3500ba8b14b486a5fe4b9c8614db55b..3eaab8ca0d2c439a7e00625f145481026ee0a98c 100644 (file)
@@ -560,7 +560,9 @@ void add_to_vars(int var, int type, int direction)
        /* variable is not found in list -> add variable to list                                        */
        lv = DNEW(struct LoopVar);
 
+       lv->modified = lv->index = 0;
        lv->value = var;
+
        if (type == ARRAY_INDEX) {
                lv->index = 1;
                lv->static_u = lv->static_l = 1;    /* arrayindex -> var not modified */
@@ -582,10 +584,6 @@ void add_to_vars(int var, int type, int direction)
                        break;
                        }
                }
-       
-       /* !! strange 
-          lv->modified = 0; 
-          */
 
        /* no dynamic bounds have been determined so far                          */
        lv->dynamic_l = lv->dynamic_l_v = lv->dynamic_u = lv->dynamic_u_v = 0;
@@ -3332,6 +3330,8 @@ void optimize_single_loop(struct LoopContainer *lc)
        int i, head, node;
        struct Changes **changes;
 
+       struct LoopVar *lv;
+
        if ((changes = (struct Changes **) malloc(maxlocals * sizeof(struct Changes *))) == NULL)
                c_mem_error();
 
@@ -3395,6 +3395,12 @@ void optimize_single_loop(struct LoopContainer *lc)
 #ifdef LOOP_DEBUG
                printf("analyze for array access finished and found\n");        
                fflush(stdout);
+               lv = c_loopvars;
+               while (lv != NULL) {
+                       if (lv->modified)
+                               printf("Var --> %d\n", lv->value);
+                       lv = lv->next;
+               }
 #endif
 
                /* for performance reasons the list of all interesting loop vars is             */
@@ -3413,11 +3419,14 @@ void optimize_single_loop(struct LoopContainer *lc)
 
 #ifdef LOOP_DEBUG
                        printf("Analyzed for or/exception - no problems \n");            
-                       fflsuh(stdout);
+                       fflush(stdout);
 #endif
 
                        init_constraints(head); /* analyze dynamic bounds in header                     */
-                       /* show_right_side();                                                                                           */
+
+#ifdef LOOP_DEBUG                      
+                       show_right_side();
+#endif                                                                                         
 
                        if (c_rightside == NULL)
                                return;
@@ -3433,7 +3442,7 @@ void optimize_single_loop(struct LoopContainer *lc)
            
 #ifdef LOOP_DEBUG
                        printf("Array-bound checks finished\n");                                                        
-                       fflsuh(stdout);
+                       fflush(stdout);
 #endif
 
                        mark_loop_nodes(lc);