CAC 2016-12-02

testbitcat analysis

   concatit: proc (fbits);
     dcl   fbits     bit (36);
     dcl   tbits     bit (52) aligned;
         tbits = fbits || (16)"0"b;
   end concatit;

Tracing through 'cat_op' in testbitcat_2.trace

       91 begin:    p = node_pt;
       92
       93           p1 = ref(1);
       94           p2 = ref(2);
       95           p3 = ref(3);
       96
       97           q2 = p -> operand(2);
       98           q3 = p -> operand(3);
       99
      100           type = p1 -> reference.data_type;
      101           n = convert_size(type);
      102           size1 = p1 -> reference.c_length * n;
      103           size2 = p2 -> reference.c_length * n;
      104           size3 = p3 -> reference.c_length * n;
      105           s2 = fixed(size2 > bits_per_word,1);
      106           dt = type - char_string;

p1 set to 000407400043:016700000000
p2 set to 000410400043:000272000000
p3 set to 000407400043:017314000000
q2 set to 000410400043:000272000000
q3 set to 000407400043:017314000000
type set to  000000000016 (bit_string)
n set to 1
size1 set to 000000000064 (52.)  [so p1 is 'tbits'?]
size2 set to 000000000044 (36.) [p2 is fbits?]
size3 set to 000000000020 (16.)  [p3 ks (16)"0"b]
s2 set to 0 [fbits is not more then 1 word long?]
dt set 1. [type is 14., char_string is 13.] 

      108           goto switch(code);

code is 1.

      253 switch(1):
      254 ea:       if ^ p1 -> reference.long_ref
      255           then do;

reference is 166014000000; long ref is not set.

      256                if size2 ^= bits_per_word then goto ee1;

size2==bits_per_word, so:

      257                if p2 -> reference.ref_count < 1 then call compile_exp(q2);

ref_count i s 1, so:

      258                else p2 = compile_exp$save(q2);    /* needed later */

compile_exp is called.

      259                goto aa_2a;

      206 aa_2:     if size2 = bits_per_word & mod(code,2) ^= 0
      207           then do;
      208                call expmac((lda),p2);
      209 aa_2a:         call expmac((ldq),p3);
      210                end;
      211           else do;
      212 aa_3:          call compile_exp(q3);

Moving the label 'aa_2a' up one line appears to fix the problem.
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License