home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / gnu / gcc / help / 2475 < prev    next >
Encoding:
Text File  |  1992-11-08  |  2.1 KB  |  93 lines

  1. Newsgroups: gnu.gcc.help
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!cs.utexas.edu!csc.ti.com!tilde.csc.ti.com!fstop.csc.ti.com!fstop!west
  3. From: west@chance.tsd.itg.ti.com (Roger West)
  4. Subject: -fpic coredumps on a sparc
  5. Message-ID: <WEST.92Nov7223312@chance.tsd.itg.ti.com>
  6. Sender: usenet@csc.ti.com
  7. Nntp-Posting-Host: chance.tsd.itg.ti.com
  8. Organization: Texas Instruments, Speech Mushrooms.
  9. Date: Sun, 8 Nov 1992 04:33:12 GMT
  10. Lines: 81
  11.  
  12.  
  13. Has anyone gotten gcc 2.3.1 to sucessfully generate position independent code
  14. on a sparc?  Is PIC code generation even expected to be working yet?  Here's
  15. what I'm getting...
  16.  
  17.     gcc2 -fpic -S -o fun.s fun.c
  18.     gcc2: Internal compiler error: program cc1 got fatal signal 6
  19.  
  20.  
  21. This is what I'm trying to compile..
  22.  
  23.     extern void puts();
  24.  
  25.     void fun() {
  26.     puts("Called fun.");
  27.     }
  28.  
  29.  
  30. This is as far as gcc gets...
  31.  
  32.     gcc2_compiled.:
  33.     .text
  34.         .align 8
  35.     LC0:
  36.         .ascii "Called fun.\0"
  37.         .align 4
  38.         .global _fun
  39.         .proc    020
  40.     _fun:
  41.         !#PROLOGUE# 0
  42.         save %sp,-112,%sp
  43.     L2:
  44.         call L3
  45.         nop
  46.     L3:
  47.         sethi %hi(__GLOBAL_OFFSET_TABLE_-(
  48.  
  49.  
  50. Here's what the Sun cc compiler produces...
  51.  
  52.     LL0:
  53.         .seg    "data"
  54.         .seg    "text"
  55.         .proc 020
  56.         .global    _fun
  57.     _fun:
  58.         !#PROLOGUE# 0
  59.         sethi    %hi(LF13),%g1
  60.         add        %g1,%lo(LF13),%g1
  61.         save    %sp,%g1,%sp
  62.     1:
  63.         call        2f
  64.         sethi    %hi(__GLOBAL_OFFSET_TABLE_ - (1b-.)), %l7
  65.     2:
  66.         or        %l7, %lo(__GLOBAL_OFFSET_TABLE_ - (1b-.)), %l7
  67.         add        %l7, %o7, %l7
  68.         !#PROLOGUE# 1
  69.         .seg    "data1"
  70.     L15:
  71.         .ascii    "Called fun.\0"
  72.         .seg    "text"
  73.         ld        [%l7+L15],%o0
  74.         call    _puts,1
  75.         nop
  76.     LE13:
  77.         ret
  78.         restore
  79.        LF13 = -96
  80.         LP13 = 96
  81.         LST13 = 96
  82.         LT13 = 96
  83.         .seg    "data"
  84.  
  85.  
  86. Thanks for any responses.
  87. --
  88.    _____________________________________________________________
  89.    |   Roger West              Internet: west@tsd.itg.ti.com   |
  90.    |   Texas Instruments Inc.    TI MSG: RWES                  |
  91.    |   PO Box 149149, MS 2201     Voice: (512) 250-7372        |
  92.    |___Austin, TX 78714-9149________Fax: (512) 250-7104________|
  93.