home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / sys / next / programm / 8343 < prev    next >
Encoding:
Text File  |  1993-01-28  |  22.5 KB  |  1,058 lines

  1. Newsgroups: comp.sys.next.programmer
  2. Path: sparky!uunet!news.univie.ac.at!scsing.switch.ch!univ-lyon1.fr!ghost.dsi.unimi.it!rpi!gatech!hubcap!ncrcae!ncrhub2!ncrgw2!psinntp!fafnir!mckelvey
  3. From: mckelvey@fafnir.com (James W. McKelvey)
  4. Subject: Re: Code Generation Bug (long)
  5. Message-ID: <C1I64F.8nv@fafnir.com>
  6. Sender: mckelvey@fafnir.com (James W. McKelvey)
  7. Reply-To: mckelvey@fafnir.com
  8. Organization: Fafnir Software, Saugus, CA, USA
  9. Date: Wed, 27 Jan 1993 07:57:51 GMT
  10. Lines: 1046
  11.  
  12. Thanks for your responses.  Most people think it is a question of optimization.   
  13. This is not the case.  I have submitted this bug to NeXT.  Below is a shorter  
  14. version of what I gave them.  This is not reproducible as it does not include  
  15. some .h files needed to compile.
  16.  
  17. We have found a code generation bug in the 3.0 C compiler.  It occurs with  
  18. optimization OFF.  There are two symptoms:
  19. 1) Code mysteriously gets segmentation fault or other severe error.
  20. 2) A variable is "missing" in GDB.
  21.  
  22. Problem 1 is due to the compiler thinking that an A register contains the  
  23. offset for an automatic variable when it does not.  The variable is the same  
  24. one as in problem 2.
  25.  
  26. The following .s file demonstrates the problem.  Notice that there is no debug  
  27. record for automatic variable "innnx".  I have marked with "XXX" the places  
  28. where improper code is generated.  Register A2 is presumed to contain the  
  29. offset for "innnx" but it does not.
  30.  
  31. #NO_APP
  32. .stabs "ddu_add_table_field.c",100,0,0,Ltext0
  33. .text
  34. Ltext0:
  35. .stabs "int:t1=r1;-2147483648;2147483647;",128,0,0,0
  36. .stabs "char:t2=r2;0;127;",128,0,0,0
  37. .stabs "long int:t3=r1;-2147483648;2147483647;",128,0,0,0
  38. .stabs "unsigned int:t4=r1;0;-1;",128,0,0,0
  39. .stabs "long unsigned int:t5=r1;0;-1;",128,0,0,0
  40. .stabs "short int:t6=r1;-32768;32767;",128,0,0,0
  41. .stabs "long long int:t7=r1;0;-1;",128,0,0,0
  42. .stabs "short unsigned int:t8=r1;0;65535;",128,0,0,0
  43. .stabs "long long unsigned int:t9=r1;0;-1;",128,0,0,0
  44. .stabs "signed char:t10=r1;-128;127;",128,0,0,0
  45. .stabs "unsigned char:t11=r1;0;255;",128,0,0,0
  46. .stabs "float:t12=r1;4;0;",128,0,0,0
  47. .stabs "double:t13=r1;8;0;",128,0,0,0
  48. .stabs "long double:t14=r1;8;0;",128,0,0,0
  49. .stabs "void:t15=15",128,0,0,0
  50. .stabs "ptrdiff_t:t3",128,0,0,0
  51. .stabs "size_t:t5",128,0,0,0
  52. .stabs "wchar_t:t8",128,0,0,0
  53. .stabs "va_list:t16=*2",128,0,0,0
  54. .stabs  
  55. "_iobuf:T17=s20_cnt:1,0,32;_ptr:16,32,32;_base:16,64,32;_bufsiz:1,96,32;_flag:6 
  56. ,128,16;_file:11,144,8;_smallbuf:2,152,8;;",128,0,0,0
  57. .stabs "fpos_t:t3",128,0,0,0
  58. .stabs "STRING:t18=ar1;0;254;2",128,0,0,0
  59. .stabs "info_field:T19=s40field:20=ar1;0;9;16,0,320;;",128,0,0,0
  60. .stabs "INFOFIELD:t19",128,0,0,0
  61. .stabs "idtype:T21=s8identifier:16,0,32;length:1,32,32;;",128,0,0,0
  62. .stabs "IDTYPE:t21",128,0,0,0
  63. .stabs  
  64. "name_header:T22=s12forward:23=*22,0,32;backward:23,32,32;ident:24=*21,64,32;;" 
  65. ,128,0,0,0
  66. .stabs "NAME_HEADER:t22",128,0,0,0
  67. .stabs  
  68. "fieldtype:T25=s22field_type:16,0,32;field_length:1,32,32;field_name:16,64,32;f 
  69. ield_value_specified:1,96,32;field_value:26=*15,128,32;primary:2,160,8;;",128,0 
  70. ,0,0
  71. .stabs "FIELDTYPE:t25",128,0,0,0
  72. .stabs  
  73. "devtype:T27=s12dev_size:1,0,32;dev_name_length:1,32,32;dev_name:16,64,32;;",12 
  74. 8,0,0,0
  75. .stabs "DEVTYPE:t27",128,0,0,0
  76. .stabs  
  77. "queue_header:T28=s20forward:29=*28,0,32;backward:29,32,32;ident:24,64,32;field 
  78. :30=*25,96,32;dev:31=*27,128,32;;",128,0,0,0
  79. .stabs "QUEUE_HEADER:t28",128,0,0,0
  80. .stabs  
  81. "dsc_descriptor_d:T32=s8dsc_w_length:8,0,16;dsc_b_dtype:11,16,8;dsc_b_class:11, 
  82. 24,8;dsc_a_pointer:16,32,32;;",128,0,0,0
  83. .stabs  
  84. "dsc_descriptor_s:T33=s8dsc_w_length:8,0,16;dsc_b_dtype:11,16,8;dsc_b_class:11, 
  85. 24,8;dsc_a_pointer:16,32,32;;",128,0,0,0
  86. .stabs  
  87. "dsc_descriptor:T34=s8dsc_w_length:8,0,16;dsc_b_dtype:11,16,8;dsc_b_class:11,24 
  88. ,8;dsc_a_pointer:16,32,32;;",128,0,0,0
  89. .stabs "BOOL:t2",128,0,0,0
  90. .cstring
  91. LC0:
  92.     .ascii "\0"
  93. .text
  94.     .align 1
  95. .globl _ddu_add_table_field
  96. _ddu_add_table_field:
  97.     .stabd 68,0,10
  98.     link a6,#-66368
  99.     movel a2,sp@-
  100.     .stabd 68,0,14
  101. LBB2:
  102.     .stabd 68,0,16
  103.     movel #135561217,a6@(-20)
  104.     .stabd 68,0,20
  105.     clrl a6@(-36)
  106.     .stabd 68,0,29
  107.     movel #-66354,a0
  108.     clrl a0@(a6:l)
  109.     .stabd 68,0,30
  110.     movel #-66362,a0
  111.     clrl a0@(a6:l)
  112.     .stabd 68,0,33
  113.     movel a6,d0
  114.     addl #-65582,d0
  115.     movel d0,sp@-
  116.     jbsr _ddu_init
  117.     .stabd 68,0,34
  118.     movel a6,d0
  119.     addl #-65326,d0
  120.     movel d0,sp@-
  121.     jbsr _ddu_init
  122.     .stabd 68,0,35
  123.     movel a6,d0
  124.     addl #-65838,d0
  125.     movel d0,sp@-
  126.     jbsr _ddu_init
  127.     .stabd 68,0,36
  128.     movel a6,d0
  129.     addl #-66350,d0
  130.     movel d0,sp@-
  131.     jbsr _ddu_init
  132.     .stabd 68,0,37
  133.     movel a6,d0
  134.     addl #-66094,d0
  135.     movel d0,sp@-
  136.     jbsr _ddu_init
  137.     .stabd 68,0,39
  138.     movel a6,d0
  139.     addl #-66358,d0
  140.     movel d0,sp@-
  141.     movel a6,d0
  142.     addl #-65582,d0
  143.     movel d0,sp@-
  144.     pea _db_names_list
  145.     jbsr _ddu_get_identifier
  146.     movel d0,a6@(-20)
  147.     .stabd 68,0,40
  148.     moveb a6@(-17),d0
  149.     andb #1,d0
  150.     addw #32,sp
  151.     tstb d0
  152.     jne L2
  153.     .stabd 68,0,41
  154.     movel #135569664,sp@-
  155.     pea 1:w
  156.     jbsr _sts_handler
  157.     .stabd 68,0,42
  158.     movel #135569664,d0
  159.     jra L1
  160.     .stabd 68,0,43
  161. L2:
  162.     .stabd 68,0,44
  163.     movel a6,d0
  164.     addl #-66358,d0
  165.     movel d0,sp@-
  166.     movel a6,d0
  167.     addl #-65326,d0
  168.     movel d0,sp@-
  169.     pea _table_names_list
  170.     jbsr _ddu_get_identifier
  171.     movel d0,a6@(-20)
  172.     .stabd 68,0,45
  173.     moveb a6@(-17),d0
  174.     andb #1,d0
  175.     addw #12,sp
  176.     tstb d0
  177.     jne L3
  178.     .stabd 68,0,46
  179.     movel #135569664,sp@-
  180.     pea 1:w
  181.     jbsr _sts_handler
  182.     .stabd 68,0,47
  183.     movel #135569664,d0
  184.     jra L1
  185.     .stabd 68,0,48
  186. L3:
  187.     .stabd 68,0,51
  188.     moveq #-40,d0
  189.     addl a6,d0
  190.     movel d0,sp@-
  191.     pea _data_view_class
  192.     jbsr _msg_create_definition
  193.     movel d0,a6@(-20)
  194.     .stabd 68,0,52
  195.     addqw #8,sp
  196.     tstl a6@(-20)
  197.     jne L4
  198.     .stabd 68,0,53
  199.     movel #135569488,sp@-
  200.     pea 1:w
  201.     jbsr _sts_handler
  202.     .stabd 68,0,54
  203.     movel #135569488,d0
  204.     jra L1
  205.     .stabd 68,0,55
  206. L4:
  207.     .stabd 68,0,56
  208.     tstl a6@(-40)
  209.     jne L5
  210.     .stabd 68,0,57
  211.     movel #135569472,sp@-
  212.     pea 1:w
  213.     jbsr _sts_handler
  214.     .stabd 68,0,58
  215.     movel #135569472,d0
  216.     jra L1
  217.     .stabd 68,0,59
  218. L5:
  219.     .stabd 68,0,62
  220.     movel a6,d0
  221.     addl #-65326,d0
  222.     movel d0,sp@-
  223.     movel a6@(-40),sp@-
  224.     jbsr _msg_set_definition_name
  225.     movel d0,a6@(-20)
  226.     .stabd 68,0,63
  227.     addqw #8,sp
  228.     tstl a6@(-20)
  229.     jne L6
  230.     .stabd 68,0,64
  231.     movel #135569928,sp@-
  232.     pea 1:w
  233.     jbsr _sts_handler
  234.     .stabd 68,0,65
  235.     movel #135569928,d0
  236.     jra L1
  237.     .stabd 68,0,66
  238. L6:
  239.     .stabd 68,0,67
  240.     pea _data_view_class
  241.     movel a6@(-40),sp@-
  242.     jbsr _msg_set_definition_class
  243.     movel d0,a6@(-20)
  244.     .stabd 68,0,68
  245.     addqw #8,sp
  246.     tstl a6@(-20)
  247.     jne L7
  248.     .stabd 68,0,69
  249.     movel #135569888,sp@-
  250.     pea 1:w
  251.     jbsr _sts_handler
  252.     .stabd 68,0,70
  253.     movel #135569888,d0
  254.     jra L1
  255.     .stabd 68,0,71
  256. L7:
  257.     .stabd 68,0,72
  258.     pea _d3_relation_type
  259.     movel a6@(-40),sp@-
  260.     jbsr _msg_set_definition_type
  261.     movel d0,a6@(-20)
  262.     .stabd 68,0,73
  263.     addqw #8,sp
  264.     tstl a6@(-20)
  265.     jne L8
  266.     .stabd 68,0,74
  267.     movel #135569944,sp@-
  268.     pea 1:w
  269.     jbsr _sts_handler
  270.     .stabd 68,0,75
  271.     movel #135569944,d0
  272.     jra L1
  273.     .stabd 68,0,76
  274. L8:
  275.     .stabd 68,0,77
  276.     movel a6,d0
  277.     addl #-66350,d0
  278.     movel d0,sp@-
  279.     movel a6@(-40),sp@-
  280.     jbsr _msg_set_definition_desc
  281.     movel d0,a6@(-20)
  282.     .stabd 68,0,78
  283.     addqw #8,sp
  284.     tstl a6@(-20)
  285.     jne L9
  286.     .stabd 68,0,79
  287.     movel #135569904,sp@-
  288.     pea 1:w
  289.     jbsr _sts_handler
  290.     .stabd 68,0,80
  291.     movel #135569904,d0
  292.     jra L1
  293.     .stabd 68,0,81
  294. L9:
  295.     .stabd 68,0,83
  296.     tstl _dict_names_list
  297.     jeq L10
  298.     .stabd 68,0,84
  299. L11:
  300.     tstl _dict_names_list
  301.     jeq L12
  302.     .stabd 68,0,85
  303. LBB3:
  304.     movel a6,d0
  305.     addl #-66358,d0
  306.     movel d0,sp@-
  307.     movel a6,d0
  308.     addl #-65070,d0
  309.     movel #-66362,a0
  310.     movel a0@(a6:l),d1
  311.     mulsl #255,d1
  312.     addl d1,d0
  313.     movel d0,sp@-
  314.     pea _dict_names_list
  315.     jbsr _ddu_get_identifier
  316.     movel d0,a6@(-20)
  317.     .stabd 68,0,88
  318.     moveb a6@(-17),d0
  319.     andb #1,d0
  320.     addw #12,sp
  321.     tstb d0
  322.     jne L13
  323.     .stabd 68,0,89
  324.     movel #135569664,sp@-
  325.     pea 1:w
  326.     jbsr _sts_handler
  327.     .stabd 68,0,90
  328.     movel #135569664,d0
  329.     jra L1
  330.     .stabd 68,0,91
  331. L13:
  332.     .stabd 68,0,92
  333.     movel a6,d0
  334.     addl #-65070,d0
  335.     movel #-66362,a0
  336.     movel a0@(a6:l),d1
  337.     mulsl #255,d1
  338.     addl d1,d0
  339.     movel d0,sp@-
  340.     movel a6@(-40),sp@-
  341.     jbsr _msg_set_defined_in
  342.     movel d0,a6@(-20)
  343.     .stabd 68,0,94
  344.     addqw #8,sp
  345.     tstl a6@(-20)
  346.     jne L14
  347.     .stabd 68,0,95
  348.     movel #135569920,sp@-
  349.     pea 1:w
  350.     jbsr _sts_handler
  351.     .stabd 68,0,96
  352.     movel #135569920,d0
  353.     jra L1
  354.     .stabd 68,0,97
  355. L14:
  356.     .stabd 68,0,98
  357.     movel #-66362,a0
  358.     movel #-66362,a2
  359.     movel a2@(a6:l),d0
  360.     movel d0,a1
  361.     addqw #1,a1
  362.     movel a1,a0@(a6:l)
  363.     .stabd 68,0,99
  364. LBE3:
  365.     jra L11
  366. L12:
  367.     .stabd 68,0,100
  368.     jra L15
  369. L10:
  370.     .stabd 68,0,101
  371. LBB4:
  372.     pea LC0
  373.     pea _DDD_NAME
  374.     jbsr _strcmp
  375.     addqw #8,sp
  376.     tstl d0
  377.     jeq L16
  378.     .stabd 68,0,103
  379.     movel #-66366,a0
  380.     movel a2@(a6:l),a0@(a6:l) XXX
  381.     .stabd 68,0,104
  382.     pea _DDD_NAME
  383.     movel a6,d0
  384.     addl #-65070,d0
  385.     movel a2@(a6:l),d1 XXX
  386.     mulsl #255,d1
  387.     addl d1,d0
  388.     movel d0,sp@-
  389.     jbsr _strcpy
  390.     .stabd 68,0,105
  391.     addqw #8,sp
  392.     jra L17
  393. L16:
  394.     .stabd 68,0,108
  395.     movel #135569752,sp@-
  396.     pea 1:w
  397.     jbsr _sts_handler
  398.     .stabd 68,0,109
  399.     addqw #8,sp
  400. L17:
  401.     .stabd 68,0,110
  402.     movel a6,d0
  403.     addl #-65070,d0
  404.     movel a2@(a6:l),d1 XXX
  405.     mulsl #255,d1
  406.     addl d1,d0
  407.     movel d0,sp@-
  408.     movel a2@(a6:l),sp@-  XXX
  409.     jbsr _msg_set_defined_in
  410.     movel d0,a6@(-20)
  411.     .stabd 68,0,111
  412.     addqw #8,sp
  413.     tstl a6@(-20)
  414.     jne L18
  415.     .stabd 68,0,112
  416.     movel #135569920,sp@-
  417.     pea 1:w
  418.     jbsr _sts_handler
  419.     .stabd 68,0,113
  420.     movel #135569920,d0
  421.     jra L1
  422.     .stabd 68,0,114
  423. L18:
  424.     .stabd 68,0,115
  425.     addql #1,a2@(a6:l)   XXX
  426.     .stabd 68,0,116
  427. LBE4:
  428. L15:
  429.     .stabd 68,0,118
  430.     movel a6,d0
  431.     addl #-65582,d0
  432.     movel d0,sp@-
  433.     movel a6@(-40),sp@-
  434.     jbsr _msg_set_defined_in
  435.     movel d0,a6@(-20)
  436.     .stabd 68,0,119
  437.     addqw #8,sp
  438.     tstl a6@(-20)
  439.     jne L19
  440.     .stabd 68,0,120
  441.     movel #135569920,sp@-
  442.     pea 1:w
  443.     jbsr _sts_handler
  444.     .stabd 68,0,121
  445.     movel #135569920,d0
  446.     jra L1
  447.     .stabd 68,0,122
  448. L19:
  449.     nop
  450.     .stabd 68,0,128
  451.     movel #-66366,a0
  452.     clrl a0@(a6:l)
  453. L20:
  454.     movel #-66366,a0
  455.     movel a0@(a6:l),a1
  456.     cmpl a2@(a6:l),a1   XXX
  457.     jge L21
  458.     .stabd 68,0,129
  459.     movel a6,d0
  460.     addl #-66358,d0
  461.     movel d0,sp@-
  462.     movel a6,d0
  463.     addl #-65070,d0
  464.     movel #-66366,a0
  465.     movel a0@(a6:l),d1
  466.     mulsl #255,d1
  467.     addl d1,d0
  468.     movel d0,sp@-
  469.     pea _dict_names_list
  470.     jbsr _ddu_add_identifier
  471.     movel d0,a6@(-20)
  472.     .stabd 68,0,132
  473.     moveb a6@(-17),d0
  474.     andb #1,d0
  475.     addw #12,sp
  476.     tstb d0
  477.     jne L23
  478.     .stabd 68,0,133
  479.     movel #135569440,sp@-
  480.     pea 1:w
  481.     jbsr _sts_handler
  482.     .stabd 68,0,134
  483.     movel #135569440,d0
  484.     jra L1
  485.     .stabd 68,0,135
  486. L23:
  487.     .stabd 68,0,136
  488.     .stabd 68,0,128
  489. L22:
  490.     movel #-66366,a0
  491.     addql #1,a0@(a6:l)
  492.     jra L20
  493. L21:
  494.     nop
  495.     .stabd 68,0,141
  496. L24:
  497.     tstl _table_field_list
  498.     jeq L25
  499.     .stabd 68,0,142
  500. LBB5:
  501.     movel a6,d0
  502.     addl #-66367,d0
  503.     movel d0,sp@-
  504.     movel a6,d0
  505.     addl #-66354,d0
  506.     movel d0,sp@-
  507.     moveq #-36,d0
  508.     addl a6,d0
  509.     movel d0,sp@-
  510.     movel a6,d0
  511.     addl #-65838,d0
  512.     movel d0,sp@-
  513.     moveq #-24,d0
  514.     addl a6,d0
  515.     movel d0,sp@-
  516.     movel a6,d0
  517.     addl #-66094,d0
  518.     movel d0,sp@-
  519.     pea _table_field_list
  520.     jbsr _ddu_get_field
  521.     movel d0,a6@(-20)
  522.     .stabd 68,0,149
  523.     moveb a6@(-17),d0
  524.     andb #1,d0
  525.     addw #28,sp
  526.     tstb d0
  527.     jne L26
  528.     .stabd 68,0,150
  529.     movel #135569656,sp@-
  530.     pea 1:w
  531.     jbsr _sts_handler
  532.     .stabd 68,0,151
  533.     movel #135569656,d0
  534.     jra L1
  535.     .stabd 68,0,152
  536. L26:
  537.     .stabd 68,0,156
  538.     moveq #-32,d0
  539.     addl a6,d0
  540.     movel d0,sp@-
  541.     moveq #-28,d0
  542.     addl a6,d0
  543.     movel d0,sp@-
  544.     movel a6,d0
  545.     addl #-66094,d0
  546.     movel d0,sp@-
  547.     jbsr _ddu_get_d3_datatype
  548.     movel d0,a6@(-20)
  549.     .stabd 68,0,157
  550.     moveb a6@(-17),d0
  551.     andb #1,d0
  552.     addw #12,sp
  553.     tstb d0
  554.     jne L27
  555.     .stabd 68,0,158
  556.     movel #135569528,sp@-
  557.     pea 1:w
  558.     jbsr _sts_handler
  559.     .stabd 68,0,159
  560.     movel #135569528,d0
  561.     jra L1
  562.     .stabd 68,0,160
  563. L27:
  564.     .stabd 68,0,163
  565.     movel #-66367,a0
  566.     moveb a0@(a6:l),d0
  567.     extbl d0
  568.     movel d0,sp@-
  569.     clrl sp@-
  570.     moveq #-44,d0
  571.     addl a6,d0
  572.     movel d0,sp@-
  573.     movel #-66354,a0
  574.     movel a0@(a6:l),sp@-
  575.     movel a6@(-36),sp@-
  576.     movel a6@(-32),sp@-
  577.     movel a6@(-24),sp@-
  578.     movel a6@(-28),sp@-
  579.     pea _data_item_class
  580.     movel a2@(a6:l),sp@-
  581.     movel a6,d0
  582.     addl #-65070,d0
  583.     movel d0,sp@-
  584.     movel a6,d0
  585.     addl #-66350,d0
  586.     movel d0,sp@-
  587.     movel a6,d0
  588.     addl #-65838,d0
  589.     movel d0,sp@-
  590.     jbsr _ddu_add_d3_field
  591.     movel d0,a6@(-20)
  592.     .stabd 68,0,176
  593.     moveb a6@(-17),d0
  594.     andb #1,d0
  595.     addw #52,sp
  596.     tstb d0
  597.     jne L28
  598.     .stabd 68,0,177
  599.     movel #135569408,sp@-
  600.     pea 1:w
  601.     jbsr _sts_handler
  602.     .stabd 68,0,178
  603.     movel #135569408,d0
  604.     jra L1
  605.     .stabd 68,0,179
  606. L28:
  607.     .stabd 68,0,182
  608.     movel a6@(-44),sp@-
  609.     movel a6@(-40),sp@-
  610.     jbsr _msg_set_ref_by_id
  611.     movel d0,a6@(-20)
  612.     .stabd 68,0,183
  613.     addqw #8,sp
  614.     tstl a6@(-20)
  615.     jne L29
  616.     .stabd 68,0,184
  617.     movel #135569912,sp@-
  618.     pea 1:w
  619.     jbsr _sts_handler
  620.     .stabd 68,0,185
  621.     movel #135569912,d0
  622.     jra L1
  623.     .stabd 68,0,186
  624. L29:
  625.     .stabd 68,0,187
  626. LBE5:
  627.     jra L24
  628. L25:
  629.     .stabd 68,0,190
  630.     movel #-65326,a1
  631.     addl a6,a1
  632.     movel a1,a6@(-4)
  633.     .stabd 68,0,191
  634.     moveb #14,a6@(-6)
  635.     .stabd 68,0,192
  636.     moveb #1,a6@(-5)
  637.     .stabd 68,0,193
  638.     movel a6,d0
  639.     addl #-65326,d0
  640.     movel d0,sp@-
  641.     jbsr _strlen
  642.     movew d0,a6@(-8)
  643.     .stabd 68,0,194
  644.     movel #-66366,a0
  645.     clrl a0@(a6:l)
  646.     addqw #4,sp
  647. L30:
  648.     movel #-66366,a0
  649.     movel a0@(a6:l),a1
  650.     cmpl a2@(a6:l),a1  XXX
  651.     jge L31
  652.     .stabd 68,0,195
  653. LBB6:
  654.     movel a6,d0
  655.     addl #-65070,d0
  656.     movel #-66366,a0
  657.     movel a0@(a6:l),d1
  658.     mulsl #255,d1
  659.     movel d0,a1
  660.     addl d1,a1
  661.     movel a1,a6@(-12)
  662.     .stabd 68,0,196
  663.     moveb #14,a6@(-14)
  664.     .stabd 68,0,197
  665.     moveb #1,a6@(-13)
  666.     .stabd 68,0,198
  667.     movel a6,d0
  668.     addl #-65070,d0
  669.     movel #-66366,a0
  670.     movel a0@(a6:l),d1
  671.     mulsl #255,d1
  672.     addl d1,d0
  673.     movel d0,sp@-
  674.     jbsr _strlen
  675.     movew d0,a6@(-16)
  676.     .stabd 68,0,199
  677.     movel a6,d0
  678.     addl #-65070,d0
  679.     movel #-66366,a0
  680.     movel a0@(a6:l),d1
  681.     mulsl #255,d1
  682.     addl d1,d0
  683.     movel d0,sp@-
  684.     movel a6@(-40),sp@-
  685.     jbsr _msg_save_definition
  686.     movel d0,a6@(-20)
  687.     .stabd 68,0,200
  688.     addw #12,sp
  689.     tstl a6@(-20)
  690.     jne L33
  691.     .stabd 68,0,201
  692.     moveq #-16,d0
  693.     addl a6,d0
  694.     movel d0,sp@-
  695.     movel a6,d0
  696.     subql #8,d0
  697.     movel d0,sp@-
  698.     pea 2:w
  699.     movel #135569880,sp@-
  700.     pea 4:w
  701.     jbsr _sts_handler
  702.     .stabd 68,0,203
  703.     movel #135569880,d0
  704.     jra L1
  705.     .stabd 68,0,204
  706.     jra L34
  707. L33:
  708.     .stabd 68,0,208
  709.     moveq #-16,d0
  710.     addl a6,d0
  711.     movel d0,sp@-
  712.     movel a6,d0
  713.     subql #8,d0
  714.     movel d0,sp@-
  715.     pea 2:w
  716.     movel #135565323,sp@-
  717.     pea 4:w
  718.     jbsr _sts_handler
  719.     .stabd 68,0,210
  720.     addw #20,sp
  721. L34:
  722.     .stabd 68,0,211
  723. LBE6:
  724.     .stabd 68,0,194
  725. L32:
  726.     movel #-66366,a0
  727.     addql #1,a0@(a6:l)
  728.     jra L30
  729. L31:
  730.     .stabd 68,0,213
  731.     movel a6@(-20),d0
  732.     jra L1
  733.     .stabd 68,0,214
  734. LBE2:
  735.     .stabd 68,0,214
  736. L1:
  737.     movel #-66368,a0
  738.     movel a6@(-4,a0:l),a2
  739.     unlk a6
  740.     rts
  741. .stabs "ddu_add_table_field:F1",36,0,0,_ddu_add_table_field
  742. .stabs "message1_desc:34",128,0,0,-8
  743. .stabs "message2_desc:34",128,0,0,-16
  744. .stabs "status:1",128,0,0,-20
  745. .stabs "field_length:1",128,0,0,-24
  746. .stabs "data_type:1",128,0,0,-28
  747. .stabs "scale:1",128,0,0,-32
  748. .stabs "value_specified:1",128,0,0,-36
  749. .stabs "context:5",128,0,0,-40
  750. .stabs "field_context:5",128,0,0,-44
  751. .stabs "table_d3_name:35=ar1;0;254;18",128,0,0,-65070
  752. .stabs "table_name:18",128,0,0,-65326
  753. .stabs "table_db_name:18",128,0,0,-65582
  754. .stabs "field_name:18",128,0,0,-65838
  755. .stabs "field_type:18",128,0,0,-66094
  756. .stabs "descrip:18",128,0,0,-66350
  757. .stabs "field_value:16",128,0,0,-66354
  758. .stabs "length:1",128,0,0,-66358
  759. .stabs "i:1",128,0,0,-66366
  760. .stabs "primary:2",128,0,0,-66367
  761. .stabn 192,0,0,LBB2
  762. .stabn 192,0,0,LBB3
  763. .stabn 224,0,0,LBE3
  764. .stabn 192,0,0,LBB4
  765. .stabn 224,0,0,LBE4
  766. .stabn 192,0,0,LBB5
  767. .stabn 224,0,0,LBE5
  768. .stabn 192,0,0,LBB6
  769. .stabn 224,0,0,LBE6
  770. .stabn 224,0,0,LBE2
  771. .stabs "identifier_list:G29",32,0,0,0
  772. .comm _identifier_list,4
  773. .stabs "attach_names_list:G29",32,0,0,0
  774. .comm _attach_names_list,4
  775. .stabs "class_list:G29",32,0,0,0
  776. .comm _class_list,4
  777. .stabs "cond_field_list:G29",32,0,0,0
  778. .comm _cond_field_list,4
  779. .stabs "db_dev_list:G29",32,0,0,0
  780. .comm _db_dev_list,4
  781. .stabs "db_names_list:G29",32,0,0,0
  782. .comm _db_names_list,4
  783. .stabs "def_field_list:G29",32,0,0,0
  784. .comm _def_field_list,4
  785. .stabs "def_field_name_list:G29",32,0,0,0
  786. .comm _def_field_name_list,4
  787. .stabs "def_names_list:G29",32,0,0,0
  788. .comm _def_names_list,4
  789. .stabs "dict_names_list:G29",32,0,0,0
  790. .comm _dict_names_list,4
  791. .stabs "dicts_names_list:G29",32,0,0,0
  792. .comm _dicts_names_list,4
  793. .stabs "file_names_list:G29",32,0,0,0
  794. .comm _file_names_list,4
  795. .stabs "msg_names_list:G29",32,0,0,0
  796. .comm _msg_names_list,4
  797. .stabs "msg_field_list:G29",32,0,0,0
  798. .comm _msg_field_list,4
  799. .stabs "msg_field_name_list:G29",32,0,0,0
  800. .comm _msg_field_name_list,4
  801. .stabs "msg_subtype_list:G29",32,0,0,0
  802. .comm _msg_subtype_list,4
  803. .stabs "msg_type_list:G29",32,0,0,0
  804. .comm _msg_type_list,4
  805. .stabs "pass_names_list:G29",32,0,0,0
  806. .comm _pass_names_list,4
  807. .stabs "proc_names_list:G29",32,0,0,0
  808. .comm _proc_names_list,4
  809. .stabs "server_names_list:G29",32,0,0,0
  810. .comm _server_names_list,4
  811. .stabs "subclass_list:G29",32,0,0,0
  812. .comm _subclass_list,4
  813. .stabs "syb_data_dev_list:G29",32,0,0,0
  814. .comm _syb_data_dev_list,4
  815. .stabs "syb_log_dev_list:G29",32,0,0,0
  816. .comm _syb_log_dev_list,4
  817. .stabs "table_field_list:G29",32,0,0,0
  818. .comm _table_field_list,4
  819. .stabs "table_field_name_list:G29",32,0,0,0
  820. .comm _table_field_name_list,4
  821. .stabs "table_names_list:G29",32,0,0,0
  822. .comm _table_names_list,4
  823. .stabs "trans_name_list:G29",32,0,0,0
  824. .comm _trans_name_list,4
  825. .stabs "trans_value_list:G29",32,0,0,0
  826. .comm _trans_value_list,4
  827. .stabs "user_names_list:G29",32,0,0,0
  828. .comm _user_names_list,4
  829. .stabs "view_field_list:G29",32,0,0,0
  830. .comm _view_field_list,4
  831. .stabs "view_names_list:G29",32,0,0,0
  832. .comm _view_names_list,4
  833.     .text
  834.     .stabs "",100,0,0,Letext
  835. Letext:
  836.  
  837. And here is the original C source:
  838.  
  839. #include "ddu_define.h"
  840. #include "ddu_queue.h"
  841. #include "ddu_message.h"
  842. #include "st_descrip.h"
  843. #include "st_stsdef.h"
  844.  
  845. typedef char BOOL;
  846.  
  847. int ddu_add_table_field(void)
  848. {
  849. #ifdef    DEBUG
  850.     static DESCRIPTOR    (current_module_desc, "ddu_add_table_field");
  851. #endif
  852.     struct dsc_descriptor    message1_desc,
  853.                 message2_desc;
  854.         int               status = DDU_NORMAL,
  855.                     field_length,
  856.                     data_type,
  857.                     scale,
  858.                     value_specified = FALSE;
  859.     unsigned long        context,
  860.                     field_context;
  861.         STRING            table_d3_name   [CONTEXT_MAX];
  862.     char            table_name    [TOKEN_LEN],
  863.                     table_db_name   [TOKEN_LEN],
  864.                     field_name    [TOKEN_LEN],
  865.                     field_type    [TOKEN_LEN],
  866.                     descrip            [TOKEN_LEN];
  867.         char            *field_value = NULL;
  868.     int            length, innnx=0, i;
  869.     BOOL            primary;
  870.  
  871.     ddu_init(table_db_name);
  872.     ddu_init(table_name);
  873.     ddu_init(field_name);
  874.     ddu_init(descrip);
  875.     ddu_init(field_type);
  876.  
  877.         status = ddu_get_identifier(&db_names_list, table_db_name, &length);
  878.     if (!STS_STATUS_SUCCESS(status)) {
  879.         sts_handler(1, DDU_GETIDENTERR);
  880.         return(DDU_GETIDENTERR);
  881.     }
  882.         status = ddu_get_identifier(&table_names_list, table_name, &length);
  883.     if (!STS_STATUS_SUCCESS(status)) {
  884.         sts_handler(1, DDU_GETIDENTERR);
  885.         return(DDU_GETIDENTERR);
  886.     }
  887.  
  888.     /* Create the table as a d3view. */
  889.     status = msg_create_definition(data_view_class, &context);
  890.     if (status == FAILURE) {
  891.         sts_handler(1, DDU_CREATEDEFERR); 
  892.         return(DDU_CREATEDEFERR);
  893.     }
  894.     if (context == NIL) {
  895.         sts_handler(1, DDU_CONTEXTERR);
  896.         return(DDU_CONTEXTERR);
  897.     }
  898.         
  899.     /* Put the characteristics of the message in the definition. */
  900.     status = msg_set_definition_name(context, table_name);
  901.     if (status == FAILURE) {
  902.         sts_handler(1, DDU_SETDEFNMERR); 
  903.         return(DDU_SETDEFNMERR);
  904.     }
  905.     status = msg_set_definition_class(context, data_view_class);
  906.     if (status == FAILURE) {
  907.         sts_handler(1, DDU_SETDEFCLSERR); 
  908.         return(DDU_SETDEFCLSERR);
  909.     }
  910.     status = msg_set_definition_type(context, d3_relation_type);
  911.         if (status == FAILURE) {
  912.         sts_handler(1, DDU_SETDEFTYERR); 
  913.         return(DDU_SETDEFTYERR);
  914.     }
  915.         status = msg_set_definition_desc(context, descrip);
  916.         if (status == FAILURE) {
  917.         sts_handler(1, DDU_SETDEFDESCERR); 
  918.         return(DDU_SETDEFDESCERR);
  919.     }
  920.  
  921.     if (dict_names_list != NULL) {
  922.         while (dict_names_list != NULL) {
  923.                 status = ddu_get_identifier(&dict_names_list, 
  924.                             table_d3_name[innnx], 
  925.                             &length);
  926.             if (!STS_STATUS_SUCCESS(status)) {
  927.                 sts_handler(1, DDU_GETIDENTERR);
  928.                 return(DDU_GETIDENTERR);
  929.             }
  930.                    status = msg_set_defined_in(context, 
  931.                             table_d3_name[innnx]);
  932.                 if (status == FAILURE) {
  933.                 sts_handler(1, DDU_SETDEFINERR); 
  934.                 return(DDU_SETDEFINERR);
  935.             }
  936.             innnx += 1;
  937.         }
  938.     } else {
  939.         if (strcmp(DDD_NAME, "") != 0)
  940.                 {
  941.                         i = innnx;
  942.             strcpy(table_d3_name[innnx], DDD_NAME);
  943.         }
  944.                 else
  945.                 {
  946.             sts_handler(1, DDU_NODDDFOUND);
  947.         }
  948.                status = msg_set_defined_in(innnx, table_d3_name[innnx]);
  949.             if (status == FAILURE) {
  950.             sts_handler(1, DDU_SETDEFINERR); 
  951.             return(DDU_SETDEFINERR);
  952.         }
  953.         innnx += 1;
  954.     }
  955.  
  956.         status = msg_set_defined_in(context, table_db_name);
  957.         if (status == FAILURE) {
  958.         sts_handler(1, DDU_SETDEFINERR); 
  959.         return(DDU_SETDEFINERR);
  960.     }
  961.  
  962.     /* This is done so that mapping multiple table definition 
  963.      * into dictionary will be implemented correctly. Anyway, 
  964.      * before the next command, "dict_names_list" will be 
  965.      * initialize to NULL */
  966.     for (i = 0; i < innnx; i++) {
  967.             status = ddu_add_identifier(&dict_names_list, 
  968.                         table_d3_name[i],
  969.                         &length);
  970.         if (!STS_STATUS_SUCCESS(status)) {
  971.             sts_handler(1, DDU_ADDIDENTERR);
  972.             return(DDU_ADDIDENTERR);
  973.         }
  974.     }    
  975.     
  976.         /* Now go through the list of table fields.  Get the field name,
  977.         ** field name length, data_type, and field length for each one.  Then
  978.         ** call the D3 stuff to load each one into the dictionary. */
  979.     while (table_field_list != NULL) {
  980.         status = ddu_get_field(&table_field_list,
  981.                           field_type,
  982.                        &field_length,
  983.                        field_name,
  984.                        &value_specified,
  985.                        &field_value,
  986.                        &primary);
  987.             if (!STS_STATUS_SUCCESS(status)) {
  988.             sts_handler(1, DDU_GETFIELDERR); 
  989.             return(DDU_GETFIELDERR);
  990.         }
  991.  
  992.         /* Get the data_type (an enumerated type) from the field_type
  993.          * (a character string ). */
  994.         status = ddu_get_d3_datatype(field_type, &data_type, &scale);
  995.         if (!STS_STATUS_SUCCESS(status)) {
  996.             sts_handler(1, DDU_GETD3DTTYERR); 
  997.             return(DDU_GETD3DTTYERR);
  998.         }
  999.  
  1000.         /* Put the field definitions in the D3 here. */
  1001.         status = ddu_add_d3_field(field_name,
  1002.                       descrip,
  1003.                       table_d3_name,
  1004.                       innnx,
  1005.                       data_item_class,
  1006.                       data_type,
  1007.                       field_length,
  1008.                       scale,
  1009.                       value_specified,
  1010.                       field_value,
  1011.                       &field_context,
  1012.                       LOCAL,
  1013.                       primary);
  1014.             if (!STS_STATUS_SUCCESS(status)) {
  1015.             sts_handler(1, DDU_ADDD3FIELDERR); 
  1016.             return(DDU_ADDD3FIELDERR);
  1017.         }
  1018.  
  1019.         /* Add a reference for the field to the table. */
  1020.         status = msg_set_ref_by_id(context, field_context);
  1021.             if (status == FAILURE) {
  1022.             sts_handler(1, DDU_SETREFIDERR); 
  1023.             return(DDU_SETREFIDERR);
  1024.         }
  1025.     }
  1026.  
  1027.         /* All the fields have been added to the table.  Save it now. */
  1028.     message1_desc.dsc_a_pointer = table_name;
  1029.         message1_desc.dsc_b_dtype   = DSC_K_DTYPE_T;
  1030.         message1_desc.dsc_b_class   = DSC_K_CLASS_S;
  1031.     message1_desc.dsc_w_length  = strlen(table_name);
  1032.     for (i = 0; i < innnx; i++) {
  1033.             message2_desc.dsc_a_pointer = table_d3_name[i];
  1034.             message2_desc.dsc_b_dtype   = DSC_K_DTYPE_T;
  1035.             message2_desc.dsc_b_class   = DSC_K_CLASS_S;
  1036.             message2_desc.dsc_w_length  = strlen(table_d3_name[i]);
  1037.             status = msg_save_definition(context, table_d3_name[i]);
  1038.             if (status == FAILURE) {
  1039.             sts_handler(4, DDU_SAVETABERR, 
  1040.                     2, &message1_desc, &message2_desc); 
  1041.             return(DDU_SAVETABERR);
  1042.         } else {
  1043.  
  1044.                 /* Let the user know the table was successfully 
  1045.              * added. */
  1046.             sts_handler(4, DDU_ADDTAB, 
  1047.                     2, &message1_desc, &message2_desc);
  1048.         }
  1049.     }
  1050.  
  1051.         return (status);
  1052. }
  1053. -- 
  1054. The gentle journey jars to stop. The drifting dream is
  1055. done.  The long gone goblins loom ahead; the deadly,
  1056. that we thought were dead, stand waiting, every one.
  1057. -- Walt Kelly    Jim McKelvey   mckelvey@fafnir.com
  1058.