home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!UB.com!pacbell.com!ames!agate!ucbvax!snogum.enet.dec.com!blair
- From: blair@snogum.enet.dec.com ("Blair Phillips, Digital Services, Canberra, Oz")
- Newsgroups: comp.os.vms
- Subject: Re: VAXC divide problems (V3.2)
- Message-ID: <9301270009.AA11412@easynet.crl.dec.com>
- Date: 27 Jan 93 00:09:25 GMT
- Sender: daemon@ucbvax.BERKELEY.EDU
- Distribution: world
- Organization: The Internet
- Lines: 45
-
- louis@barra.com writes:
- ~>>
- ~>>Don't ask me why it allocated space on the stack without using it,
- ~>
- ~>I think the stack space is for the condition handler.
- ~
- ~ Think again. The subl2 is obviously for the variable i which is
- ^^^^^^^^^
- ~ allocated on the stack. It's true that the code generated doesn't
- ~ actually use this space because the C compiler decides that it can
- ~ do this small routine using r0, r1 and the value "passed in" on
- ~ the stack.
- ~
- ~ It seems that the compiler didn't "notice" that it didn't use the
- ~ space it put asside on the stack for i. This has obviously nothing
- ~ to do with a condition handler.
-
- Louis,
-
- I wouldn't use the term "obviously" about *any* code generated by the VAX C
- compiler!
-
- The null procedure
-
- func(){}
-
- still generates the "subl2 #4, sp" instruction, so it has nothing to do with
- local variable declarations.
-
- My recollection is that the space was reserved as working storage for a
- conditional handler unwinding the stack. It may be part of the longjmp() code
- that needs this space. longjmp() unwinds the stack carefully (using the same
- code as the Pascal uplevel GOTO).
-
- I haven't looked at the code for at least 5 years, so my memory may be faulty.
- If you have access to source listings, working through the longjmp code is an
- entertaining way to waste a few hours.
-
- Blair
- ----------
- Blair Phillips Blair@snogum.enet.dec.com
- Digital Equipment Corp (Aust) P/L Phone: (+61 6) 2754874
- Canberra, Australia FAX : (+61 6) 2473654
- {Any opinions expressed are my own, not those of Digital Equipment Corporation}
-
-