home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Professional / OS2PRO194.ISO / os2 / prgramer / adaptor / src / dependen.c < prev    next >
Text File  |  1994-01-02  |  34KB  |  1,504 lines

  1. # include "Dependen.h"
  2. # include "yyDepend.w"
  3. # include <stdio.h>
  4. # if defined __STDC__ | defined __cplusplus
  5. #  include <stdlib.h>
  6. # else
  7.    extern void exit ();
  8. # endif
  9. # include "Tree.h"
  10. # include "Definiti.h"
  11.  
  12. # ifndef NULL
  13. # define NULL 0L
  14. # endif
  15. # ifndef false
  16. # define false 0
  17. # endif
  18. # ifndef true
  19. # define true 1
  20. # endif
  21.  
  22. # ifdef yyInline
  23. # define yyALLOC(tree, free, max, alloc, nodesize, make, ptr, kind) \
  24.   if ((ptr = (tree) free) >= (tree) max) ptr = alloc (); \
  25.   free += nodesize [kind]; \
  26.   ptr->yyHead.yyMark = 0; \
  27.   ptr->Kind = kind;
  28. # else
  29. # define yyALLOC(tree, free, max, alloc, nodesize, make, ptr, kind) ptr = make (kind);
  30. # endif
  31.  
  32. # define yyWrite(s) (void) fputs (s, yyf)
  33. # define yyWriteNl (void) fputc ('\n', yyf)
  34.  
  35. # line 37 "Dependences.puma"
  36.  
  37.  
  38. # include "Tree.h"
  39. # include "Idents.h"
  40. # include "StringMe.h"
  41.  
  42. # undef DEBUG
  43.  
  44. void PrintNormRecord (s, e, loops, n)
  45. char s[];
  46. ExpNormRecord e;
  47. tTree loops[];
  48. int n;
  49.  
  50. {  int i;
  51.    printf ("Normalized Expression %s in %d loops: %d", s, n, e.vals[0]);
  52.    for (i=1; i<=n;i++)
  53.      printf (" + %d*I%d", e.vals[i], i);
  54.    printf ("\n");
  55. }
  56.  
  57.  
  58.  
  59. static FILE * yyf = stdout;
  60.  
  61. static void yyAbort
  62. # ifdef __cplusplus
  63.  (char * yyFunction)
  64. # else
  65.  (yyFunction) char * yyFunction;
  66. # endif
  67. {
  68.  (void) fprintf (stderr, "Error: module Dependences, routine %s failed\n", yyFunction);
  69.  exit (1);
  70. }
  71.  
  72. static void ExpNormal ARGS((tTree e, ptree loops, int n, bool * yyP2, ExpNormRecord * yyP1));
  73. static bool IsLoopVar ARGS((tIdent name, tTree loop));
  74. static void GetLoopIncrement ARGS((tTree t, bool * yyP4, int * yyP3));
  75. static void ForIdUpperBound ARGS((tTree slice, ptree loops, int m, bool * yyP6, ExpNormRecord * yyP5));
  76. static void ForIdLowerBound ARGS((tTree slice, ptree loops, int m, bool * yyP8, ExpNormRecord * yyP7));
  77. static void ExpUpperBound ARGS((ExpNormRecord e, ptree loops, int n, int ConstLoops, bool * yyP10, ExpNormRecord * yyP9));
  78. static void ExpLowerBound ARGS((ExpNormRecord e, ptree loops, int n, int ConstLoops, bool * yyP12, ExpNormRecord * yyP11));
  79. static bool ExpDifferent ARGS((ExpNormRecord e1, ptree loops1, int n1, ExpNormRecord e2, ptree loops2, int n2, int ConstLoops));
  80. static void DiffUppBound ARGS((ExpNormRecord e1, ptree loops1, int n1, ExpNormRecord e2, ptree loops2, int n2, int CommonLoops, int ConstLoops, bool * yyP14, int * yyP13));
  81. static void DiffLowBound ARGS((ExpNormRecord e1, ptree loops1, int n1, ExpNormRecord e2, ptree loops2, int n2, int CommonLoops, int ConstLoops, bool * yyP16, int * yyP15));
  82. static void DeltaCheck ARGS((ExpNormRecord e, ptree loops, int n, bool flow, int low, bool fup, int up, pPredVector p));
  83. static void ExpCompare ARGS((ExpNormRecord e1, ptree loops1, int n1, ExpNormRecord e2, ptree loops2, int n2, int CommonLoops, int ConstLoops, pPredVector p));
  84. static void IndexCompare ARGS((tTree e1, ptree loops1, int n1, tTree e2, ptree loops2, int n2, int CommonLoops, int ConstLoops, pPredVector p));
  85. void Dependences ARGS((tTree e1, ptree loops1, int n1, tTree e2, ptree loops2, int n2, int CommonLoops, int ConstLoops, pPredVector p));
  86.  
  87. static void ExpNormal
  88. # if defined __STDC__ | defined __cplusplus
  89. (register tTree e, ptree loops, register int n, register bool * yyP2, ExpNormRecord * yyP1)
  90. # else
  91. (e, loops, n, yyP2, yyP1)
  92.  register tTree e;
  93.  ptree loops;
  94.  register int n;
  95.  register bool * yyP2;
  96.  ExpNormRecord * yyP1;
  97. # endif
  98. {
  99. # line 75 "Dependences.puma"
  100.  
  101. int i;
  102.  
  103. # line 85 "Dependences.puma"
  104.  {
  105.   int c;
  106.   bool found;
  107.   ExpNormRecord val;
  108.   {
  109. # line 86 "Dependences.puma"
  110.  
  111. # line 87 "Dependences.puma"
  112.  
  113. # line 88 "Dependences.puma"
  114.  
  115. # line 89 "Dependences.puma"
  116.    GetIntConstValue (e, & found, & c);
  117. # line 90 "Dependences.puma"
  118.    if (! (found)) goto yyL1;
  119.   {
  120. # line 91 "Dependences.puma"
  121.  for (i=1;i<=n;i++) val.vals[i] = 0;
  122.      val.vals[0] = c;
  123.  
  124.   }
  125.   }
  126.    * yyP2 = found;
  127.    * yyP1 = val;
  128.    return;
  129.  }
  130. yyL1:;
  131.  
  132.   if (e->Kind == kOP_EXP) {
  133.   if (e->OP_EXP.EXP_OP->Kind == kOP_PLUS) {
  134. # line 102 "Dependences.puma"
  135.  {
  136.   bool yyV1;
  137.   ExpNormRecord yyV2;
  138.   bool yyV3;
  139.   ExpNormRecord yyV4;
  140.   {
  141. # line 103 "Dependences.puma"
  142.    ExpNormal (e->OP_EXP.OPND1, loops, n, & yyV1, & yyV2);
  143. # line 104 "Dependences.puma"
  144.    ExpNormal (e->OP_EXP.OPND2, loops, n, & yyV3, & yyV4);
  145. # line 105 "Dependences.puma"
  146.  if (yyV1 && yyV3)
  147.        { for (i=0; i<=n; i++)
  148.             yyV2.vals[i] += yyV4.vals[i];
  149.        }
  150.  
  151.   }
  152.    * yyP2 = yyV1 && yyV3;
  153.    * yyP1 = yyV2;
  154.    return;
  155.  }
  156.  
  157.   }
  158.   if (e->OP_EXP.EXP_OP->Kind == kOP_MINUS) {
  159. # line 112 "Dependences.puma"
  160.  {
  161.   bool yyV1;
  162.   ExpNormRecord yyV2;
  163.   bool yyV3;
  164.   ExpNormRecord yyV4;
  165.   {
  166. # line 113 "Dependences.puma"
  167.    ExpNormal (e->OP_EXP.OPND1, loops, n, & yyV1, & yyV2);
  168. # line 114 "Dependences.puma"
  169.    ExpNormal (e->OP_EXP.OPND2, loops, n, & yyV3, & yyV4);
  170. # line 115 "Dependences.puma"
  171.  if (yyV1 && yyV3)
  172.        { for (i=0; i<=n; i++)
  173.             yyV2.vals[i] -= yyV4.vals[i];
  174.        }
  175.  
  176.   }
  177.    * yyP2 = yyV1 && yyV3;
  178.    * yyP1 = yyV2;
  179.    return;
  180.  }
  181.  
  182.   }
  183.   if (e->OP_EXP.EXP_OP->Kind == kOP_TIMES) {
  184. # line 122 "Dependences.puma"
  185.  {
  186.   int c;
  187.   bool found1;
  188.   bool yyV1;
  189.   ExpNormRecord yyV2;
  190.   {
  191. # line 123 "Dependences.puma"
  192.  
  193. # line 124 "Dependences.puma"
  194.  
  195. # line 125 "Dependences.puma"
  196.    GetIntConstValue (e->OP_EXP.OPND1, & found1, & c);
  197. # line 126 "Dependences.puma"
  198.    if (! (found1)) goto yyL4;
  199.   {
  200. # line 127 "Dependences.puma"
  201.    ExpNormal (e->OP_EXP.OPND2, loops, n, & yyV1, & yyV2);
  202. # line 130 "Dependences.puma"
  203.  if (yyV1) { for (i=0;i<=n;i++) yyV2.vals[i] *= c; }
  204.   }
  205.   }
  206.    * yyP2 = found1 && yyV1;
  207.    * yyP1 = yyV2;
  208.    return;
  209.  }
  210. yyL4:;
  211.  
  212. # line 133 "Dependences.puma"
  213.  {
  214.   int c;
  215.   bool found2;
  216.   bool yyV1;
  217.   ExpNormRecord yyV2;
  218.   {
  219. # line 135 "Dependences.puma"
  220.  
  221. # line 136 "Dependences.puma"
  222.  
  223. # line 137 "Dependences.puma"
  224.    GetIntConstValue (e->OP_EXP.OPND2, & found2, & c);
  225. # line 139 "Dependences.puma"
  226.    if (! (found2)) goto yyL5;
  227.   {
  228. # line 141 "Dependences.puma"
  229.    ExpNormal (e->OP_EXP.OPND1, loops, n, & yyV1, & yyV2);
  230. # line 144 "Dependences.puma"
  231.  if (yyV1) { for (i=0;i<=n;i++) yyV2.vals[i] *= c; }
  232.   }
  233.   }
  234.    * yyP2 = yyV1 && found2;
  235.    * yyP1 = yyV2;
  236.    return;
  237.  }
  238. yyL5:;
  239.  
  240.   }
  241.   }
  242.   if (e->Kind == kOP1_EXP) {
  243.   if (e->OP1_EXP.EXP_OP1->Kind == kOP1_SIGN) {
  244. # line 147 "Dependences.puma"
  245.  {
  246.   bool yyV1;
  247.   ExpNormRecord yyV2;
  248.   {
  249. # line 148 "Dependences.puma"
  250.    ExpNormal (e->OP1_EXP.OPND, loops, n, & yyV1, & yyV2);
  251. # line 149 "Dependences.puma"
  252.  if (yyV1)
  253.        { for (i=0; i<=n; i++)
  254.             yyV2.vals[i] = -yyV2.vals[i];
  255.        }
  256.  
  257.   }
  258.    * yyP2 = yyV1;
  259.    * yyP1 = yyV2;
  260.    return;
  261.  }
  262.  
  263.   }
  264.   }
  265.   if (e->Kind == kVAR_EXP) {
  266.   if (e->VAR_EXP.V->Kind == kLOOP_VAR) {
  267. # line 156 "Dependences.puma"
  268.  {
  269.   bool found;
  270.   ExpNormRecord val;
  271.   {
  272. # line 157 "Dependences.puma"
  273.  
  274. # line 158 "Dependences.puma"
  275.  
  276. # line 159 "Dependences.puma"
  277.  found = false;
  278.      val.vals[0] = 0;
  279.      for (i=1; i<= n; i++)
  280.        { if (IsLoopVar (e->VAR_EXP.V->LOOP_VAR.LOOP_VARNAME->VAR_OBJ.Ident, loops[i-1]))
  281.             { val.vals[i] = 1;
  282.               found  = true;
  283.             }
  284.            else
  285.             val.vals[i] = 0;
  286.        }
  287.  
  288.   }
  289.    * yyP2 = found;
  290.    * yyP1 = val;
  291.    return;
  292.  }
  293.  
  294.   }
  295.   if (e->VAR_EXP.V->Kind == kUSED_VAR) {
  296. # line 172 "Dependences.puma"
  297.  {
  298.   bool found;
  299.   ExpNormRecord val;
  300.   {
  301. # line 173 "Dependences.puma"
  302.  
  303. # line 174 "Dependences.puma"
  304.  
  305. # line 175 "Dependences.puma"
  306.  found = false;
  307.      val.vals[0] = 0;
  308.      for (i=1; i<= n; i++)
  309.        { if (IsLoopVar (e->VAR_EXP.V->USED_VAR.VARNAME->VAR_OBJ.Ident, loops[i-1]))
  310.             { val.vals[i] = 1;
  311.               found  = true;
  312.             }
  313.            else
  314.             val.vals[i] = 0;
  315.        }
  316.  
  317.   }
  318.    * yyP2 = found;
  319.    * yyP1 = val;
  320.    return;
  321.  }
  322.  
  323.   }
  324.   }
  325.   if (e->Kind == kSLICE_EXP) {
  326. # line 196 "Dependences.puma"
  327.  {
  328.   ExpNormRecord val;
  329.   {
  330. # line 197 "Dependences.puma"
  331.  
  332.   }
  333.    * yyP2 = false;
  334.    * yyP1 = val;
  335.    return;
  336.  }
  337.  
  338.   }
  339. # line 200 "Dependences.puma"
  340.  {
  341.   ExpNormRecord val;
  342.   {
  343. # line 203 "Dependences.puma"
  344.  
  345.   }
  346.    * yyP2 = false;
  347.    * yyP1 = val;
  348.    return;
  349.  }
  350.  
  351. ;
  352. }
  353.  
  354. static bool IsLoopVar
  355. # if defined __STDC__ | defined __cplusplus
  356. (register tIdent name, register tTree loop)
  357. # else
  358. (name, loop)
  359.  register tIdent name;
  360.  register tTree loop;
  361. # endif
  362. {
  363.   if (loop->Kind == kACF_FORALL) {
  364. # line 208 "Dependences.puma"
  365.   {
  366. # line 209 "Dependences.puma"
  367.    if (! (IsLoopVar (name, loop->ACF_FORALL.FORALL_ID))) goto yyL1;
  368.   }
  369.    return true;
  370. yyL1:;
  371.  
  372.   }
  373.   if (loop->Kind == kUSED_VAR) {
  374. # line 212 "Dependences.puma"
  375.   {
  376. # line 213 "Dependences.puma"
  377.    if (! (name == loop->USED_VAR.VARNAME->VAR_OBJ.Ident)) goto yyL2;
  378.   }
  379.    return true;
  380. yyL2:;
  381.  
  382.   }
  383.   if (loop->Kind == kLOOP_VAR) {
  384. # line 216 "Dependences.puma"
  385.   {
  386. # line 217 "Dependences.puma"
  387.    if (! (name == loop->LOOP_VAR.LOOP_VARNAME->VAR_OBJ.Ident)) goto yyL3;
  388.   }
  389.    return true;
  390. yyL3:;
  391.  
  392.   }
  393.   return false;
  394. }
  395.  
  396. static void GetLoopIncrement
  397. # if defined __STDC__ | defined __cplusplus
  398. (register tTree t, register bool * yyP4, register int * yyP3)
  399. # else
  400. (t, yyP4, yyP3)
  401.  register tTree t;
  402.  register bool * yyP4;
  403.  register int * yyP3;
  404. # endif
  405. {
  406.   if (t->Kind == kACF_DO) {
  407. # line 228 "Dependences.puma"
  408.  {
  409.   bool found;
  410.   int val;
  411.   {
  412. # line 230 "Dependences.puma"
  413.  
  414. # line 232 "Dependences.puma"
  415.  if (t->ACF_DO.DO_RANGE->SLICE_EXP.INC == NoTree)
  416.          { found = true;
  417.            val   = 1;
  418.          }
  419.        else if (t->ACF_DO.DO_RANGE->SLICE_EXP.INC->Kind == kDUMMY_EXP)
  420.          { found = true;
  421.            val   = 1;
  422.          }
  423.        else
  424.          GetIntConstValue (t->ACF_DO.DO_RANGE->SLICE_EXP.INC, &found, &val);
  425.  
  426.   }
  427.    * yyP4 = found;
  428.    * yyP3 = val;
  429.    return;
  430.  }
  431.  
  432.   }
  433.   if (t->Kind == kACF_DOLOCAL) {
  434. # line 245 "Dependences.puma"
  435.  {
  436.   bool found;
  437.   int val;
  438.   {
  439. # line 247 "Dependences.puma"
  440.  
  441. # line 249 "Dependences.puma"
  442.  if (t->ACF_DOLOCAL.DOLOCAL_RANGE->SLICE_EXP.INC == NoTree)
  443.          { found = true;
  444.            val   = 1;
  445.          }
  446.        else if (t->ACF_DOLOCAL.DOLOCAL_RANGE->SLICE_EXP.INC->Kind == kDUMMY_EXP)
  447.          { found = true;
  448.            val   = 1;
  449.          }
  450.        else
  451.          GetIntConstValue (t->ACF_DOLOCAL.DOLOCAL_RANGE->SLICE_EXP.INC, &found, &val);
  452.  
  453.   }
  454.    * yyP4 = found;
  455.    * yyP3 = val;
  456.    return;
  457.  }
  458.  
  459.   }
  460.   if (t->Kind == kACF_FORALL) {
  461. # line 262 "Dependences.puma"
  462.  {
  463.   bool found;
  464.   int val;
  465.   {
  466. # line 264 "Dependences.puma"
  467.  
  468. # line 266 "Dependences.puma"
  469.  if (t->ACF_FORALL.FORALL_RANGE->SLICE_EXP.INC == NoTree)
  470.          { found = true;
  471.            val   = 1;
  472.          }
  473.        else if (t->ACF_FORALL.FORALL_RANGE->SLICE_EXP.INC->Kind == kDUMMY_EXP)
  474.          { found = true;
  475.            val   = 1;
  476.          }
  477.        else
  478.          GetIntConstValue (t->ACF_FORALL.FORALL_RANGE->SLICE_EXP.INC, &found, &val);
  479.  
  480.   }
  481.    * yyP4 = found;
  482.    * yyP3 = val;
  483.    return;
  484.  }
  485.  
  486.   }
  487. # line 279 "Dependences.puma"
  488.   {
  489. # line 280 "Dependences.puma"
  490.    printf ("Illegal Call of GetLoopIncrement\n");
  491. # line 281 "Dependences.puma"
  492.    FileUnparse (stdout, t);
  493. # line 282 "Dependences.puma"
  494.    exit (- 1);
  495.   }
  496.    * yyP4 = false;
  497.    * yyP3 = 0;
  498.    return;
  499.  
  500. ;
  501. }
  502.  
  503. static void ForIdUpperBound
  504. # if defined __STDC__ | defined __cplusplus
  505. (register tTree slice, ptree loops, register int m, register bool * yyP6, ExpNormRecord * yyP5)
  506. # else
  507. (slice, loops, m, yyP6, yyP5)
  508.  register tTree slice;
  509.  ptree loops;
  510.  register int m;
  511.  register bool * yyP6;
  512.  ExpNormRecord * yyP5;
  513. # endif
  514. {
  515.   if (slice->Kind == kSLICE_EXP) {
  516. # line 303 "Dependences.puma"
  517.  {
  518.   bool f;
  519.   ExpNormRecord r;
  520.   int incval;
  521.   {
  522. # line 305 "Dependences.puma"
  523.  
  524. # line 306 "Dependences.puma"
  525.  
  526. # line 307 "Dependences.puma"
  527.  
  528. # line 309 "Dependences.puma"
  529.  
  530.      if (slice->SLICE_EXP.INC == NoTree)
  531.         { f = true;
  532.           incval = 1;
  533.         }
  534.       else if (slice->SLICE_EXP.INC->Kind == kDUMMY_EXP)
  535.         { f = true;
  536.           incval = 1;
  537.         }
  538.       else
  539.         GetIntConstValue (slice->SLICE_EXP.INC, &f, &incval);
  540.  
  541.  
  542.  
  543.      if (f)
  544.        {
  545.          if (incval > 0)
  546.            {
  547.              ExpNormal (slice->SLICE_EXP.STOP, loops, m-1, &f, &r);
  548.            }
  549.          else
  550.            {
  551.              ExpNormal (slice->SLICE_EXP.START, loops, m-1, &f, &r);
  552.            }
  553.        }
  554.  
  555.  
  556.  
  557. # if DEBUG
  558.      if (f)
  559.        { printf ("Upper bound for loop variable %d found\n", m);
  560.          PrintNormRecord ("up", r, loops, m-1);
  561.        }
  562.       else
  563.          printf ("Upper bound for loop variable %d not found\n", m);
  564. # endif
  565.  
  566.  
  567.   }
  568.    * yyP6 = f;
  569.    * yyP5 = r;
  570.    return;
  571.  }
  572.  
  573.   }
  574. ;
  575. }
  576.  
  577. static void ForIdLowerBound
  578. # if defined __STDC__ | defined __cplusplus
  579. (register tTree slice, ptree loops, register int m, register bool * yyP8, ExpNormRecord * yyP7)
  580. # else
  581. (slice, loops, m, yyP8, yyP7)
  582.  register tTree slice;
  583.  ptree loops;
  584.  register int m;
  585.  register bool * yyP8;
  586.  ExpNormRecord * yyP7;
  587. # endif
  588. {
  589.   if (slice->Kind == kSLICE_EXP) {
  590. # line 352 "Dependences.puma"
  591.  {
  592.   bool f;
  593.   ExpNormRecord r;
  594.   int incval;
  595.   {
  596. # line 354 "Dependences.puma"
  597.  
  598. # line 355 "Dependences.puma"
  599.  
  600. # line 356 "Dependences.puma"
  601.  
  602. # line 358 "Dependences.puma"
  603.  
  604.      if (slice->SLICE_EXP.INC == NoTree)
  605.         { f = true;
  606.           incval = 1;
  607.         }
  608.       else if (slice->SLICE_EXP.INC->Kind == kDUMMY_EXP)
  609.         { f = true;
  610.           incval = 1;
  611.         }
  612.       else
  613.         GetIntConstValue (slice->SLICE_EXP.INC, &f, &incval);
  614.  
  615.  
  616.  
  617.      if (f)
  618.        {
  619.          if (incval < 0)
  620.            {
  621.              ExpNormal (slice->SLICE_EXP.STOP, loops, m-1, &f, &r);
  622.            }
  623.          else
  624.            {
  625.              ExpNormal (slice->SLICE_EXP.START, loops, m-1, &f, &r);
  626.            }
  627.        }
  628.  
  629.  
  630.  
  631. # ifdef DEBUG
  632.      if (f)
  633.        { printf ("Lower bound for loop variable %d found\n", m);
  634.          PrintNormRecord ("low", r, loops, m-1);
  635.        }
  636.       else
  637.          printf ("Lower bound for loop variable %d not found\n", m);
  638. # endif
  639.  
  640.  
  641.   }
  642.    * yyP8 = f;
  643.    * yyP7 = r;
  644.    return;
  645.  }
  646.  
  647.   }
  648. ;
  649. }
  650.  
  651. static void ExpUpperBound
  652. # if defined __STDC__ | defined __cplusplus
  653. (ExpNormRecord e, ptree loops, register int n, register int ConstLoops, register bool * yyP10, ExpNormRecord * yyP9)
  654. # else
  655. (e, loops, n, ConstLoops, yyP10, yyP9)
  656.  ExpNormRecord e;
  657.  ptree loops;
  658.  register int n;
  659.  register int ConstLoops;
  660.  register bool * yyP10;
  661.  ExpNormRecord * yyP9;
  662. # endif
  663. {
  664. # line 420 "Dependences.puma"
  665.  {
  666.   bool found;
  667.   ExpNormRecord bound;
  668.   ExpNormRecord h;
  669.   int k;
  670.   int i;
  671.   int a;
  672.   {
  673. # line 422 "Dependences.puma"
  674.  
  675. # line 423 "Dependences.puma"
  676.  
  677. # line 424 "Dependences.puma"
  678.  
  679. # line 425 "Dependences.puma"
  680.  
  681. # line 426 "Dependences.puma"
  682.  
  683. # line 427 "Dependences.puma"
  684.  
  685. # line 430 "Dependences.puma"
  686.  found = true;
  687.      bound = e;
  688.  
  689. # ifdef DEBUG
  690.      printf ("Call of ExpUpperBound, ConstLoops = %d\n", ConstLoops);
  691.      PrintNormRecord ("e", e, loops, n);
  692. # endif
  693.  
  694.      k     = n;
  695.      while (found && (k > ConstLoops))
  696.       {
  697.         a = bound.vals[k];
  698.         if (a > 0)
  699.          {
  700.            ForIdUpperBound (loops[k-1]->ACF_DO.DO_RANGE,loops,k,&found,&h);
  701.            if (found)
  702.              {
  703.                for (i=0; i<=k-1; i++)
  704.                   bound.vals[i] += a * h.vals[i];
  705.              }
  706.          }
  707.         else if (a < 0)
  708.          {
  709.            ForIdLowerBound (loops[k-1]->ACF_DO.DO_RANGE,loops,k,&found,&h);
  710.            if (found)
  711.              {
  712.                for (i=0; i<=k-1; i++)
  713.                   bound.vals[i] += a * h.vals[i];
  714.              }
  715.          }
  716.         k = k - 1;
  717.       }
  718.  
  719. # ifdef DEBUG
  720.      if (found)
  721.        { printf ("Upper Bound found\n");
  722.          PrintNormRecord ("up", bound, loops, ConstLoops);
  723.        }
  724.       else
  725.          printf ("Upper Bound not found\n");
  726. # endif
  727.  
  728.  
  729.   }
  730.    * yyP10 = found;
  731.    * yyP9 = bound;
  732.    return;
  733.  }
  734.  
  735. ;
  736. }
  737.  
  738. static void ExpLowerBound
  739. # if defined __STDC__ | defined __cplusplus
  740. (ExpNormRecord e, ptree loops, register int n, register int ConstLoops, register bool * yyP12, ExpNormRecord * yyP11)
  741. # else
  742. (e, loops, n, ConstLoops, yyP12, yyP11)
  743.  ExpNormRecord e;
  744.  ptree loops;
  745.  register int n;
  746.  register int ConstLoops;
  747.  register bool * yyP12;
  748.  ExpNormRecord * yyP11;
  749. # endif
  750. {
  751. # line 481 "Dependences.puma"
  752.  {
  753.   bool found;
  754.   ExpNormRecord bound;
  755.   ExpNormRecord h;
  756.   int k;
  757.   int i;
  758.   int a;
  759.   {
  760. # line 483 "Dependences.puma"
  761.  
  762. # line 484 "Dependences.puma"
  763.  
  764. # line 485 "Dependences.puma"
  765.  
  766. # line 486 "Dependences.puma"
  767.  
  768. # line 487 "Dependences.puma"
  769.  
  770. # line 488 "Dependences.puma"
  771.  
  772. # line 490 "Dependences.puma"
  773.  found = true;
  774.      bound = e;
  775.  
  776. # ifdef DEBUG
  777.      printf ("Call of ExpLowerBound, ConstLoops = %d\n", ConstLoops);
  778.      PrintNormRecord ("e", e, loops, n);
  779. # endif
  780.  
  781.      k     = n;
  782.      while (found && (k > ConstLoops))
  783.       {
  784.         a = bound.vals[k];
  785.         if (a > 0)
  786.          {
  787.            ForIdLowerBound (loops[k-1]->ACF_DO.DO_RANGE,loops,k,&found,&h);
  788.            if (found)
  789.              {
  790.                for (i=0; i<=k-1; i++)
  791.                   bound.vals[i] += a * h.vals[i];
  792.              }
  793.          }
  794.         else if (a < 0)
  795.          {
  796.            ForIdUpperBound (loops[k-1]->ACF_DO.DO_RANGE,loops,k,&found,&h);
  797.            if (found)
  798.              {
  799.                for (i=0; i<=k-1; i++)
  800.                   bound.vals[i] += a * h.vals[i];
  801.              }
  802.          }
  803.         k = k - 1;
  804.       }
  805.  
  806. # ifdef DEBUG
  807.      if (found)
  808.        { printf ("Lower Bound found\n");
  809.          PrintNormRecord ("low", bound, loops, ConstLoops);
  810.        }
  811.       else
  812.          printf ("Lower Bound not found\n");
  813. # endif
  814.  
  815.   }
  816.    * yyP12 = found;
  817.    * yyP11 = bound;
  818.    return;
  819.  }
  820.  
  821. ;
  822. }
  823.  
  824. static bool ExpDifferent
  825. # if defined __STDC__ | defined __cplusplus
  826. (ExpNormRecord e1, ptree loops1, register int n1, ExpNormRecord e2, ptree loops2, register int n2, register int ConstLoops)
  827. # else
  828. (e1, loops1, n1, e2, loops2, n2, ConstLoops)
  829.  ExpNormRecord e1;
  830.  ptree loops1;
  831.  register int n1;
  832.  ExpNormRecord e2;
  833.  ptree loops2;
  834.  register int n2;
  835.  register int ConstLoops;
  836. # endif
  837. {
  838. # line 547 "Dependences.puma"
  839.  
  840. int i;
  841.  
  842. # line 551 "Dependences.puma"
  843.  {
  844.   bool yyV1;
  845.   ExpNormRecord yyV2;
  846.   bool yyV3;
  847.   ExpNormRecord yyV4;
  848.   bool yyV5;
  849.   ExpNormRecord yyV6;
  850.   {
  851. # line 560 "Dependences.puma"
  852.    ExpUpperBound (e1, loops1, n1, ConstLoops, & yyV1, & yyV2);
  853. # line 561 "Dependences.puma"
  854.    if (! (yyV1)) goto yyL1;
  855.   {
  856. # line 568 "Dependences.puma"
  857.    ExpLowerBound (e2, loops2, n2, ConstLoops, & yyV3, & yyV4);
  858. # line 569 "Dependences.puma"
  859.    if (! (yyV3)) goto yyL1;
  860.   {
  861. # line 576 "Dependences.puma"
  862.  for (i=0; i<=ConstLoops; i++)
  863.         yyV4.vals[i] -= yyV2.vals[i];
  864.  
  865.  
  866. # line 584 "Dependences.puma"
  867.    ExpLowerBound (yyV4, loops1, ConstLoops, 0, & yyV5, & yyV6);
  868. # line 585 "Dependences.puma"
  869.    if (! (yyV5)) goto yyL1;
  870.   {
  871. # line 592 "Dependences.puma"
  872.    if (! ( yyV6.vals[0]  > 0)) goto yyL1;
  873.   }
  874.   }
  875.   }
  876.   }
  877.    return true;
  878.  }
  879. yyL1:;
  880.  
  881. # line 595 "Dependences.puma"
  882.  {
  883.   bool yyV1;
  884.   ExpNormRecord yyV2;
  885.   bool yyV3;
  886.   ExpNormRecord yyV4;
  887.   bool yyV5;
  888.   ExpNormRecord yyV6;
  889.   {
  890. # line 604 "Dependences.puma"
  891.    ExpLowerBound (e1, loops1, n1, ConstLoops, & yyV1, & yyV2);
  892. # line 605 "Dependences.puma"
  893.    if (! (yyV1)) goto yyL2;
  894.   {
  895. # line 612 "Dependences.puma"
  896.    ExpUpperBound (e2, loops2, n2, ConstLoops, & yyV3, & yyV4);
  897. # line 613 "Dependences.puma"
  898.    if (! (yyV3)) goto yyL2;
  899.   {
  900. # line 620 "Dependences.puma"
  901.  for (i=0; i<=ConstLoops; i++)
  902.         yyV2.vals[i] -= yyV4.vals[i];
  903.  
  904.  
  905. # line 628 "Dependences.puma"
  906.    ExpLowerBound (yyV2, loops1, ConstLoops, 0, & yyV5, & yyV6);
  907. # line 629 "Dependences.puma"
  908.    if (! (yyV5)) goto yyL2;
  909.   {
  910. # line 636 "Dependences.puma"
  911.    if (! ( yyV6.vals[0]  > 0)) goto yyL2;
  912.   }
  913.   }
  914.   }
  915.   }
  916.    return true;
  917.  }
  918. yyL2:;
  919.  
  920.   return false;
  921. }
  922.  
  923. static void DiffUppBound
  924. # if defined __STDC__ | defined __cplusplus
  925. (ExpNormRecord e1, ptree loops1, register int n1, ExpNormRecord e2, ptree loops2, register int n2, register int CommonLoops, register int ConstLoops, register bool * yyP14, register int * yyP13)
  926. # else
  927. (e1, loops1, n1, e2, loops2, n2, CommonLoops, ConstLoops, yyP14, yyP13)
  928.  ExpNormRecord e1;
  929.  ptree loops1;
  930.  register int n1;
  931.  ExpNormRecord e2;
  932.  ptree loops2;
  933.  register int n2;
  934.  register int CommonLoops;
  935.  register int ConstLoops;
  936.  register bool * yyP14;
  937.  register int * yyP13;
  938. # endif
  939. {
  940. # line 663 "Dependences.puma"
  941.  
  942. int i;
  943.  
  944. # line 667 "Dependences.puma"
  945.  {
  946.   bool found;
  947.   int val;
  948.   int m;
  949.   int i;
  950.   ExpNormRecord H1;
  951.   ExpNormRecord H2;
  952.   {
  953. # line 669 "Dependences.puma"
  954.  
  955. # line 670 "Dependences.puma"
  956.  
  957. # line 671 "Dependences.puma"
  958.  
  959. # line 672 "Dependences.puma"
  960.  
  961. # line 674 "Dependences.puma"
  962.  
  963. # line 675 "Dependences.puma"
  964.  
  965. # line 683 "Dependences.puma"
  966.  for (i=0; i<= n1; i++) H1.vals[i] = - e1.vals[i];
  967. # line 684 "Dependences.puma"
  968.    H2 = e2;
  969. # line 687 "Dependences.puma"
  970.  if (n1 > n2) m = n1;
  971.        else m = n2;
  972. # line 690 "Dependences.puma"
  973.    found = true;
  974. # line 692 "Dependences.puma"
  975.  
  976.  
  977.  
  978.      if (n1 > m)
  979.        ExpUpperBound (H1, loops1, n1, m, &found, &H1);
  980.      if (n2 > m)
  981.        ExpUpperBound (H2, loops2, n2, m, &found, &H2);
  982.  
  983.  
  984.  
  985.      for (i=CommonLoops+1; i<=m; i++)
  986.        found = (found && ( H1.vals[i] + H2.vals[i] == 0));
  987.  
  988. # line 706 "Dependences.puma"
  989.    if (! (found)) goto yyL1;
  990.   {
  991. # line 708 "Dependences.puma"
  992.  
  993.      for (i=0; i<=CommonLoops; i++)
  994.         H1.vals[i] += H2.vals[i];
  995.      ExpUpperBound (H1, loops1, CommonLoops, 0, &found, &H2);
  996.  
  997.      if (found)
  998.         val = H2.vals[0];
  999.  
  1000.   }
  1001.   }
  1002.    * yyP14 = found;
  1003.    * yyP13 = val;
  1004.    return;
  1005.  }
  1006. yyL1:;
  1007.  
  1008. ;
  1009. }
  1010.  
  1011. static void DiffLowBound
  1012. # if defined __STDC__ | defined __cplusplus
  1013. (ExpNormRecord e1, ptree loops1, register int n1, ExpNormRecord e2, ptree loops2, register int n2, register int CommonLoops, register int ConstLoops, register bool * yyP16, register int * yyP15)
  1014. # else
  1015. (e1, loops1, n1, e2, loops2, n2, CommonLoops, ConstLoops, yyP16, yyP15)
  1016.  ExpNormRecord e1;
  1017.  ptree loops1;
  1018.  register int n1;
  1019.  ExpNormRecord e2;
  1020.  ptree loops2;
  1021.  register int n2;
  1022.  register int CommonLoops;
  1023.  register int ConstLoops;
  1024.  register bool * yyP16;
  1025.  register int * yyP15;
  1026. # endif
  1027. {
  1028. # line 723 "Dependences.puma"
  1029.  
  1030. int i;
  1031.  
  1032. # line 727 "Dependences.puma"
  1033.  {
  1034.   bool found;
  1035.   int val;
  1036.   int m;
  1037.   int i;
  1038.   ExpNormRecord H1;
  1039.   ExpNormRecord H2;
  1040.   {
  1041. # line 729 "Dependences.puma"
  1042.  
  1043. # line 730 "Dependences.puma"
  1044.  
  1045. # line 731 "Dependences.puma"
  1046.  
  1047. # line 732 "Dependences.puma"
  1048.  
  1049. # line 734 "Dependences.puma"
  1050.  
  1051. # line 735 "Dependences.puma"
  1052.  
  1053. # line 743 "Dependences.puma"
  1054.  for (i=0; i<= n1; i++) H1.vals[i] = - e1.vals[i];
  1055. # line 744 "Dependences.puma"
  1056.    H2 = e2;
  1057. # line 747 "Dependences.puma"
  1058.  if (n1 > n2) m = n1;
  1059.        else m = n2;
  1060. # line 750 "Dependences.puma"
  1061.    found = true;
  1062. # line 752 "Dependences.puma"
  1063.  
  1064.  
  1065.  
  1066.      if (n1 > m)
  1067.        ExpLowerBound (H1, loops1, n1, m, &found, &H1);
  1068.      if (n2 > m)
  1069.        ExpLowerBound (H2, loops2, n2, m, &found, &H2);
  1070.  
  1071.  
  1072.  
  1073.      for (i=CommonLoops+1; i<=m; i++)
  1074.        found = (found && ( H1.vals[i] + H2.vals[i] == 0));
  1075.  
  1076. # line 766 "Dependences.puma"
  1077.    if (! (found)) goto yyL1;
  1078.   {
  1079. # line 768 "Dependences.puma"
  1080.  
  1081.      for (i=0; i<=CommonLoops; i++)
  1082.         H1.vals[i] += H2.vals[i];
  1083.      ExpLowerBound (H1, loops1, CommonLoops, 0, &found, &H2);
  1084.  
  1085.      if (found)
  1086.         val = H2.vals[0];
  1087.  
  1088.   }
  1089.   }
  1090.    * yyP16 = found;
  1091.    * yyP15 = val;
  1092.    return;
  1093.  }
  1094. yyL1:;
  1095.  
  1096. ;
  1097. }
  1098.  
  1099. static void DeltaCheck
  1100. # if defined __STDC__ | defined __cplusplus
  1101. (ExpNormRecord e, ptree loops, register int n, register bool flow, register int low, register bool fup, register int up, pPredVector p)
  1102. # else
  1103. (e, loops, n, flow, low, fup, up, p)
  1104.  ExpNormRecord e;
  1105.  ptree loops;
  1106.  register int n;
  1107.  register bool flow;
  1108.  register int low;
  1109.  register bool fup;
  1110.  register int up;
  1111.  pPredVector p;
  1112. # endif
  1113. {
  1114. # line 798 "Dependences.puma"
  1115.  
  1116. int i, comp, ncomps, dim, incval;
  1117. bool found;
  1118. int p_low, p_up, c;
  1119. char PVString[100];
  1120. ExpNormRecord inc;
  1121.  
  1122. # line 806 "Dependences.puma"
  1123.   {
  1124. # line 808 "Dependences.puma"
  1125.  ncomps = 0;
  1126.      dim    = PVGetDimension (p);
  1127.      c      = 0;
  1128.  
  1129. # ifdef DEBUG
  1130.      strcpy (PVString,""); PVOut (PVString, p);
  1131.      printf ("Call of DeltaCheck, p = %s\n", PVString);
  1132.      PrintNormRecord ("e", e, loops, n);
  1133. # endif
  1134.  
  1135.  
  1136.  
  1137.      inc = e;
  1138.      for (i=1; i<=n; i++)
  1139.        if ((inc.vals[i] != 0) && (i <= dim))
  1140.          {
  1141.            PVGetComponent (p, i, &p_low, &p_up);
  1142.            if ((p_low != 0) || (p_up != 0))
  1143.              {
  1144.                GetLoopIncrement (loops[i-1], &found, &incval);
  1145.                if (!found)
  1146.                  {
  1147.                    goto stop;
  1148.                  }
  1149.                inc.vals[i] *= incval;
  1150.              }
  1151.          }
  1152.  
  1153.  
  1154.  
  1155.      for (i=1; i<=n; i++)
  1156.        if ((inc.vals[i] != 0) && (i <= dim))
  1157.          {
  1158.            PVGetComponent (p, i, &p_low, &p_up);
  1159.            if (p_low == p_up)
  1160.  
  1161.              c += p_low * inc.vals[i];
  1162.            else
  1163.              { ncomps += 1;
  1164.                comp   = i;
  1165.              }
  1166.          }
  1167.  
  1168.      if (ncomps == 0)
  1169.         {
  1170. # ifdef DEBUG
  1171.           printf ("Delta Check, 0 relevant components\n");
  1172. # endif
  1173.           if (fup)
  1174.             { if (c < -up) PVSetFalse (p); }
  1175.           if (flow)
  1176.             { if (c > -low) PVSetFalse (p); }
  1177.         }
  1178.      if (ncomps == 1)
  1179.         {
  1180.  
  1181. # ifdef DEBUG
  1182.           printf ("Delta Check, 1 relevant component is %d\n", comp);
  1183. # endif
  1184.  
  1185.  
  1186.  
  1187.  
  1188.  
  1189.  
  1190.  
  1191.           if (inc.vals[comp] > 0)
  1192.             { if (fup)
  1193.  
  1194.                  p_low = (- up - c) / inc.vals[comp];
  1195.                else
  1196.                  p_low = -32767;
  1197.               if (flow)
  1198.                  p_up  = (- low - c) / inc.vals[comp];
  1199.                else
  1200.                  p_up  = 32767;
  1201.             }
  1202.            else
  1203.             { if (fup)
  1204.  
  1205.                  p_up  = (- up - c) / inc.vals[comp];
  1206.                else
  1207.                  p_up  = -32767;
  1208.               if (flow)
  1209.                  p_low = (- low - c) / inc.vals[comp];
  1210.                else
  1211.                  p_low = 32767;
  1212.             }
  1213.  
  1214. # ifdef DEBUG
  1215.           printf ("DeltaCheck, 1 comp, new range : %d - %d\n", p_low, p_up);
  1216. # endif
  1217.  
  1218.           PVAndComponent (p, comp, p_low, p_up);
  1219.           if (p_low != p_up) PVSetNotExact (p);
  1220.         }
  1221.  
  1222.  
  1223.  
  1224.     stop: ;
  1225.  
  1226. # ifdef DEBUG
  1227.      strcpy (PVString,""); PVOut (PVString, p);
  1228.      printf ("Result of DeltaCheck, p = %s\n", PVString);
  1229. # endif
  1230.  
  1231.  
  1232.   }
  1233.    return;
  1234.  
  1235. ;
  1236. }
  1237.  
  1238. static void ExpCompare
  1239. # if defined __STDC__ | defined __cplusplus
  1240. (ExpNormRecord e1, ptree loops1, register int n1, ExpNormRecord e2, ptree loops2, register int n2, register int CommonLoops, register int ConstLoops, pPredVector p)
  1241. # else
  1242. (e1, loops1, n1, e2, loops2, n2, CommonLoops, ConstLoops, p)
  1243.  ExpNormRecord e1;
  1244.  ptree loops1;
  1245.  register int n1;
  1246.  ExpNormRecord e2;
  1247.  ptree loops2;
  1248.  register int n2;
  1249.  register int CommonLoops;
  1250.  register int ConstLoops;
  1251.  pPredVector p;
  1252. # endif
  1253. {
  1254. # line 932 "Dependences.puma"
  1255.  
  1256. char PVString[100];
  1257.  
  1258. # line 950 "Dependences.puma"
  1259.  {
  1260.   int low;
  1261.   int up;
  1262.   bool flow;
  1263.   bool fup;
  1264.   {
  1265. # line 952 "Dependences.puma"
  1266.  
  1267. # line 953 "Dependences.puma"
  1268.  
  1269. # line 954 "Dependences.puma"
  1270.  
  1271. # line 955 "Dependences.puma"
  1272.  
  1273. # line 957 "Dependences.puma"
  1274.  
  1275. # ifdef DEBUG
  1276.      printf ("Call of ExpCompare\n");
  1277.      PrintNormRecord ("e1", e1, loops1, n1);
  1278.      PrintNormRecord ("e2", e2, loops2, n2);
  1279.      strcpy (PVString,""); PVOut (PVString, p);
  1280.      printf ("Predicate = %s\n", PVString);
  1281. # endif
  1282.  
  1283.      if (ExpDifferent (e1, loops1, n1, e2, loops2, n2, ConstLoops))
  1284.        {
  1285.           PVSetFalse (p);
  1286. # ifdef DEBUG
  1287.           printf ("ExpCompare: FALSE, both expressions are different\n");
  1288.           strcpy (PVString,""); PVOut (PVString, p);
  1289.           printf ("Result Predicate = %s\n", PVString);
  1290. # endif
  1291.           return;
  1292.        }
  1293.  
  1294. # ifdef DEBUG
  1295.      printf ("Expressions are not absolute different, consider e1 - e2\n");
  1296. # endif
  1297.  
  1298.      DiffLowBound (e1, loops1, n1, e2, loops2, n2, CommonLoops, ConstLoops,
  1299.                    &flow, &low);
  1300.  
  1301.      DiffUppBound (e1, loops1, n1, e2, loops2, n2, CommonLoops, ConstLoops,
  1302.                    &fup, &up);
  1303.  
  1304. # ifdef DEBUG
  1305.      if (flow)
  1306.         printf ("Difference has lower bound : %d\n", low);
  1307.       else
  1308.         printf ("Difference has no lower bound\n");
  1309.      if (fup)
  1310.         printf ("Difference has upper bound : %d\n", up);
  1311.       else
  1312.         printf ("Difference has no upper bound\n");
  1313. # endif
  1314.  
  1315.      if ((!flow) || (!fup))
  1316.         PVSetNotExact (p);
  1317.       else if (low != up)
  1318.         PVSetNotExact (p);
  1319.  
  1320.      DeltaCheck (e1, loops1, n1, flow, low, fup, up, p);
  1321.      if (!PVIsFalse (p))
  1322.        DeltaCheck (e2, loops2, n2, flow, low, fup, up, p);
  1323.  
  1324. # ifdef DEBUG
  1325.      strcpy (PVString,""); PVOut (PVString, p);
  1326.      printf ("ExpCompare: Final Result Predicate = %s\n", PVString);
  1327. # endif
  1328.  
  1329.   }
  1330.    return;
  1331.  }
  1332.  
  1333. ;
  1334. }
  1335.  
  1336. static void IndexCompare
  1337. # if defined __STDC__ | defined __cplusplus
  1338. (register tTree e1, ptree loops1, register int n1, register tTree e2, ptree loops2, register int n2, register int CommonLoops, register int ConstLoops, pPredVector p)
  1339. # else
  1340. (e1, loops1, n1, e2, loops2, n2, CommonLoops, ConstLoops, p)
  1341.  register tTree e1;
  1342.  ptree loops1;
  1343.  register int n1;
  1344.  register tTree e2;
  1345.  ptree loops2;
  1346.  register int n2;
  1347.  register int CommonLoops;
  1348.  register int ConstLoops;
  1349.  pPredVector p;
  1350. # endif
  1351. {
  1352. # line 1020 "Dependences.puma"
  1353.  
  1354. char PVString[100];
  1355.  
  1356.   if (e1->Kind == kBTE_LIST) {
  1357.   if (e2->Kind == kBTE_LIST) {
  1358. # line 1024 "Dependences.puma"
  1359.  {
  1360.   bool yyV1;
  1361.   ExpNormRecord yyV2;
  1362.   bool yyV3;
  1363.   ExpNormRecord yyV4;
  1364.   {
  1365. # line 1029 "Dependences.puma"
  1366.    IndexCompare (e1->BTE_LIST.Next, loops1, n1, e2->BTE_LIST.Next, loops2, n2, CommonLoops, ConstLoops, p);
  1367. # line 1032 "Dependences.puma"
  1368.    if (! ((! PVIsFalse (p)))) goto yyL1;
  1369.   {
  1370. # line 1036 "Dependences.puma"
  1371.    ExpNormal (e1->BTE_LIST.Elem, loops1, n1, & yyV1, & yyV2);
  1372. # line 1037 "Dependences.puma"
  1373.    if (! (yyV1)) goto yyL1;
  1374.   {
  1375. # line 1039 "Dependences.puma"
  1376.    ExpNormal (e2->BTE_LIST.Elem, loops2, n2, & yyV3, & yyV4);
  1377. # line 1040 "Dependences.puma"
  1378.    if (! (yyV3)) goto yyL1;
  1379.   {
  1380. # line 1044 "Dependences.puma"
  1381.    ExpCompare (yyV2, loops1, n1, yyV4, loops2, n2, CommonLoops, ConstLoops, p);
  1382.   }
  1383.   }
  1384.   }
  1385.   }
  1386.    return;
  1387.  }
  1388. yyL1:;
  1389.  
  1390. # line 1048 "Dependences.puma"
  1391.    return;
  1392.  
  1393.   }
  1394.   }
  1395.   if (e1->Kind == kBTE_EMPTY) {
  1396.   if (e2->Kind == kBTE_EMPTY) {
  1397. # line 1054 "Dependences.puma"
  1398.    return;
  1399.  
  1400.   }
  1401.   }
  1402. # line 1058 "Dependences.puma"
  1403.   {
  1404. # line 1060 "Dependences.puma"
  1405.    printf ("Internal Error in IndexCompare\n");
  1406. # line 1061 "Dependences.puma"
  1407.    printf ("e1 = ");
  1408. # line 1061 "Dependences.puma"
  1409.    FileUnparse (stdout, e1);
  1410. # line 1061 "Dependences.puma"
  1411.    printf ("\n");
  1412. # line 1062 "Dependences.puma"
  1413.    printf ("e2 = ");
  1414. # line 1062 "Dependences.puma"
  1415.    FileUnparse (stdout, e2);
  1416. # line 1062 "Dependences.puma"
  1417.    printf ("\n");
  1418. # line 1063 "Dependences.puma"
  1419.    exit (- 1);
  1420.   }
  1421.    return;
  1422.  
  1423. ;
  1424. }
  1425.  
  1426. void Dependences
  1427. # if defined __STDC__ | defined __cplusplus
  1428. (register tTree e1, ptree loops1, register int n1, register tTree e2, ptree loops2, register int n2, register int CommonLoops, register int ConstLoops, pPredVector p)
  1429. # else
  1430. (e1, loops1, n1, e2, loops2, n2, CommonLoops, ConstLoops, p)
  1431.  register tTree e1;
  1432.  ptree loops1;
  1433.  register int n1;
  1434.  register tTree e2;
  1435.  ptree loops2;
  1436.  register int n2;
  1437.  register int CommonLoops;
  1438.  register int ConstLoops;
  1439.  pPredVector p;
  1440. # endif
  1441. {
  1442. # line 1071 "Dependences.puma"
  1443.  
  1444. char PVString [100];
  1445.  
  1446.   if (e1->Kind == kINDEXED_VAR) {
  1447.   if (e1->INDEXED_VAR.IND_VAR->Kind == kUSED_VAR) {
  1448.   if (e2->Kind == kINDEXED_VAR) {
  1449.   if (e2->INDEXED_VAR.IND_VAR->Kind == kUSED_VAR) {
  1450. # line 1075 "Dependences.puma"
  1451.   {
  1452. # line 1078 "Dependences.puma"
  1453.    if (! (e1->INDEXED_VAR.IND_VAR->USED_VAR.VARNAME->VAR_OBJ.Ident == e2->INDEXED_VAR.IND_VAR->USED_VAR.VARNAME->VAR_OBJ.Ident)) goto yyL1;
  1454.   {
  1455. # line 1080 "Dependences.puma"
  1456.  
  1457. # ifdef DEBUG
  1458.      printf ("Call of Dependences\n");
  1459.      printf ("e1 = "); FileUnparse (stdout, e1); printf ("\n");
  1460.      printf ("e2 = "); FileUnparse (stdout, e2); printf ("\n");
  1461.      strcpy (PVString,""); PVOut (PVString, p);
  1462.      printf ("Dependences : Predicate = %s\n", PVString);
  1463. # endif
  1464.  
  1465.      IndexCompare (e1->INDEXED_VAR.IND_EXPS, loops1, n1, e2->INDEXED_VAR.IND_EXPS, loops2, n2,
  1466.                    CommonLoops, ConstLoops, p);
  1467. # ifdef DEBUG
  1468.      strcpy (PVString,""); PVOut (PVString, p);
  1469.      printf ("Dependences : ResultPredicate = %s\n", PVString);
  1470. # endif
  1471.  
  1472.   }
  1473.   }
  1474.    return;
  1475. yyL1:;
  1476.  
  1477.   }
  1478.   }
  1479.   }
  1480.   }
  1481. # line 1098 "Dependences.puma"
  1482.   {
  1483. # line 1100 "Dependences.puma"
  1484.    printf ("Dependences failed, only allowed for indexed expressions\n");
  1485. # line 1101 "Dependences.puma"
  1486.    FileUnparse (stdout, e1);
  1487. # line 1102 "Dependences.puma"
  1488.    FileUnparse (stdout, e2);
  1489. # line 1103 "Dependences.puma"
  1490.    exit (- 1);
  1491.   }
  1492.    return;
  1493.  
  1494. ;
  1495. }
  1496.  
  1497. void BeginDependences ()
  1498. {
  1499. }
  1500.  
  1501. void CloseDependences ()
  1502. {
  1503. }
  1504.