home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / gnu / gcc / bug / 2783 < prev    next >
Encoding:
Text File  |  1992-11-17  |  1.2 KB  |  61 lines

  1. Newsgroups: gnu.gcc.bug
  2. Path: sparky!uunet!usc!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!cc.uow.EDU.AU!amorton
  3. From: amorton@cc.uow.EDU.AU (andrew morton)
  4. Subject: CSE optimization opportunities missed (68k)
  5. Message-ID: <199211180103.AA11562@wampyr.cc.uow.edu.au>
  6. Sender: gnulists@ai.mit.edu
  7. Organization: GNUs Not Usenet
  8. Distribution: gnu
  9. Date: Wed, 18 Nov 1992 17:03:01 GMT
  10. Approved: bug-gcc@prep.ai.mit.edu
  11. Lines: 48
  12.  
  13. A few things I have noticed in gcc2.2.2 (m68k):
  14.  
  15. The code
  16.  
  17. foo()
  18. {
  19.     bar(0x12345);
  20.     bar(0x12345);
  21.     bar(0x12345);
  22.     bar(0x12345);
  23.     bar(0x12345);
  24. }
  25.  
  26. Doesn't put the constant into a register: it seems that
  27. constant function arguments are being missed as CSE
  28. candidates.
  29.  
  30. Also, in the code
  31.  
  32. foo(int a, int b, int c, int d)
  33. {
  34.     a += 0x12345;
  35.     b += 0x12345;
  36.     c += 0x12345;
  37.     d += 0x12345;
  38.     bar(a, b, c, d);
  39.     zot(0x12345);
  40. }
  41.  
  42. The constants used in the additions are held in a register
  43. but that register is not used for the call to zot(): a constant
  44. is pushed instead.
  45.  
  46. Thirdly, there seems to be a problem with -funroll-all-loops
  47. and -frerun-cse-after-loops.  In the code
  48.  
  49. foo()
  50. {
  51.     int i;
  52.  
  53.     for (i = 0; i < 10; i++)
  54.         bar();
  55. }
  56.  
  57. The address of bar() is not held in a register after
  58. unrolling.
  59.  
  60.  
  61.