home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / os / vms / 22134 < prev    next >
Encoding:
Internet Message Format  |  1993-01-28  |  2.0 KB

  1. Path: sparky!uunet!UB.com!pacbell.com!ames!agate!ucbvax!snogum.enet.dec.com!blair
  2. From: blair@snogum.enet.dec.com ("Blair Phillips, Digital Services, Canberra, Oz")
  3. Newsgroups: comp.os.vms
  4. Subject: Re: VAXC divide problems (V3.2)
  5. Message-ID: <9301270009.AA11412@easynet.crl.dec.com>
  6. Date: 27 Jan 93 00:09:25 GMT
  7. Sender: daemon@ucbvax.BERKELEY.EDU
  8. Distribution: world
  9. Organization: The Internet
  10. Lines: 45
  11.  
  12. louis@barra.com writes:
  13. ~>>
  14. ~>>Don't ask me why it allocated space on the stack without using it, 
  15. ~>
  16. ~>I think the stack space is for the condition handler.
  17. ~
  18. ~    Think again. The subl2 is obviously for the variable i which is
  19.                                   ^^^^^^^^^
  20. ~    allocated on the stack. It's true that the code generated doesn't
  21. ~    actually use this space because the C compiler decides that it can
  22. ~    do this small routine using r0, r1 and the value "passed in" on
  23. ~    the stack.
  24. ~
  25. ~    It seems that the compiler didn't "notice" that it didn't use the
  26. ~    space it put asside on the stack for i. This has obviously nothing
  27. ~    to do with a condition handler.
  28.  
  29. Louis,
  30.  
  31. I wouldn't use the term "obviously" about *any* code generated by the VAX C
  32. compiler!
  33.  
  34. The null procedure 
  35.  
  36. func(){} 
  37.  
  38. still generates the "subl2 #4, sp" instruction, so it has nothing to do with
  39. local variable declarations.
  40.  
  41. My recollection is that the space was reserved as working storage for a 
  42. conditional handler unwinding the stack. It may be part of the longjmp() code
  43. that needs this space. longjmp() unwinds the stack carefully (using the same
  44. code as the Pascal uplevel GOTO). 
  45.  
  46. I haven't looked at the code for at least 5 years, so my memory may be faulty.
  47. If you have access to source listings, working through the longjmp code is an
  48. entertaining way to waste a few hours.
  49.  
  50. Blair
  51. ----------
  52. Blair Phillips                    Blair@snogum.enet.dec.com
  53. Digital Equipment Corp (Aust) P/L        Phone: (+61 6) 2754874
  54. Canberra, Australia                FAX  : (+61 6) 2473654
  55. {Any opinions expressed are my own, not those of Digital Equipment Corporation}
  56.  
  57.