home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / amiga / programmer / 330 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  2.0 KB

  1. Path: alpha.isc.rit.edu!MJP3783
  2. From: mjp3783@alpha.isc.rit.edu
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: Re: Is this a SAS/C bug or have I coded it wrong?
  5. Date: 6 Jan 1996 16:56:44 GMT
  6. Organization: Rochester Institute of Technology
  7. Message-ID: <4cm9kc$kf7@news.isc.rit.edu>
  8. References: <4cfrc5$gsc@misery.millcomm.com>
  9. Reply-To: mjp3783@alpha.isc.rit.edu
  10. NNTP-Posting-Host: alpha.isc.rit.edu
  11.  
  12. In article <4cfrc5$gsc@misery.millcomm.com>, llucius@millcomm.com (Yambo) writes:
  13. >Is this a SAS/C bug or am I getting more blind???
  14. >
  15. >=========================================================================
  16. >The following code:
  17. >=========================================================================
  18. >
  19. >   tmpbuf[10];
  20. >
  21. >   int
  22.  
  23. I assume this was a mis-type and that this should have been:
  24. int tmpbuf[10];
  25.  
  26.  
  27. >   test( void )
  28. >   {
  29. >
  30. >      if ( tmpbuf[0] & 0x1f == 1 )
  31. >         return 1;
  32. >
  33. >      return 0;
  34. >   }
  35.  
  36. No, this is not a bug, this is optimization. If I type:
  37. if (1==2) a(); else b();
  38.  
  39. isn't that, really, the same as
  40. b();
  41. ???
  42.  
  43. >
  44. >=========================================================================
  45. >Produces:
  46. >=========================================================================
  47. >                 SECTION      text,CODE
  48. >   __code:
  49. >   test:
  50. >   ___test__1:
  51. >                 MOVEQ.L        #$0,D0                   ;7000 
  52. >   ___test__2:
  53. >                 RTS                                     ;4e75 
  54. >   __const:
  55. >   __strings:
  56. >                 XDEF           test
  57. >   
  58. >                 SECTION        __MERGED,BSS
  59. >   __MERGEDBSS
  60. >   tmpbuf:
  61. >                 DS.B           40
  62. >                 XDEF           tmpbuf
  63. >                 END
  64. >=========================================================================
  65. >Is this right?  Where'd the "IF" go?  Do I have it coded wrong?
  66. >
  67. >TIA
  68. >
  69. >-- 
  70. >__ Y_ a_ m_ b_ o_ | The leanest, meanest, fightinest sweet tater on Earth!
  71. >   oo o  oo o  o  | 
  72. >    o       o   o | llucius@millcomm.com
  73. > o oo    o     o  | 
  74. >-- -- -- -- -- -- | http://www.millcomm.com/~llucius/index.html (coming soon)
  75. >
  76.