public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: "J. Kean Johnston" <jkj@sco.com>
To: egcs@cygnus.com
Subject: optimizer bugs, -g weirdness and an Open Server patch
Date: Sat, 15 Nov 1997 21:04:00 -0000	[thread overview]
Message-ID: <19971115210620.30844@sco.com> (raw)

Hi all.

Below is a patch for sco5.h to do the right thing with constant data
when using PIC mode. The ommision was causing (at least) X11R6 to compile
certain modules incorrectly.  Also included is Robert's previous patch
to use ASM_OUTPUT_ALIGNED_BSS. Also included is a change to the specs
to ensure that the PIC version of libgcc.a is used if the user ever
uses -shared to generate shared libraries.  I can now reliably (and correctly)
generate shared libraries with GCC on Open Server.

On a side note, I decided today to "stress" the compiler a little.
After making GCC (manually, not using make bootstrap, but using 4 stages
and building with the flags specified below), I build the rest of EGCS.
With the optimizations flags below, the first time it barfed was while
compiling libstdc++/sinst.cc.  It have an "internal compiler error".
When I am done with the rest of my tests I will look into this in more
depth.  The flags I was using were:

CXXFLAGS=-O99 -m486 -fomit-frame-pointer -funroll-loops -frerun-cse-after-loop
         -fexpensive-optimizations
CFLAGS=$CXXFLAGS

Yes yes yes, -O99 isnt a real option but its big enough to get the max
optimizations I know of (I have had this argument a zillion times).

With 971114, compiling C++ with -g enables is causing labels to be
incorrectly generated.  For example, I get "unresolved symbol .L_T7895
with -g, works fine without -g. This bug sounds very familiar.

Anyway ... here is a patch which should go into the next snapshot, please:

Fri Nov 14 22:47:55 1997  J. Kean Johnston  <jkj@sco.com>

	* config/i386/sco5.h: Define ASM_OUTPUT_ALIGNED_BSS.
	Added SELECT_RTX_SECTION to do the right thing in PIC mode.
	Changed LIBGCC_SPEC and LIB_SPEC to link with correct libgcc.a

*** config/i386/sco5.h~	Sun Nov  2 18:43:35 1997
--- config/i386/sco5.h	Fri Nov 14 22:42:46 1997
***************
*** 284,289 ****
--- 284,297 ----
     }									\
  } while (0)
  
+ /* A C statement (sans semicolon) to output to the stdio stream
+    FILE the assembler definition of uninitialized global DECL named
+    NAME whose size is SIZE bytes and alignment is ALIGN bytes.
+    Try to use asm_output_aligned_bss to implement this macro.  */
+ 
+ #define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) 		\
+   asm_output_aligned_bss (FILE, DECL, NAME, SIZE, ALIGN)
+ 
  #undef ESCAPES
  #define ESCAPES \
  "\1\1\1\1\1\1\1\1btn\1fr\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\
***************
*** 367,372 ****
--- 375,393 ----
          fprintf ((FILE), "\n");						\
  } while (0) 
  
+ /* Must use data section for relocatable constants when pic.  */
+ #undef SELECT_RTX_SECTION
+ #define SELECT_RTX_SECTION(MODE,RTX)					\
+ {									\
+   if (TARGET_ELF) {							\
+     if (flag_pic && symbolic_operand (RTX))				\
+       data_section ();							\
+     else								\
+       const_section ();							\
+   } else								\
+     readonly_data_section();						\
+ }
+ 
  #undef ASM_OUTPUT_CASE_LABEL
  #define ASM_OUTPUT_CASE_LABEL(FILE,PREFIX,NUM,JUMPTABLE)		\
  do {									\
***************
*** 883,889 ****
  
  #undef LIB_SPEC
  #define LIB_SPEC \
!  "%{!shared:%{!symbolic:-lcrypt -lgen -lc}}"
  
  #define MASK_COFF     		010000000000	/* Mask for elf generation */
  #define TARGET_COFF             (target_flags & MASK_COFF)
--- 904,914 ----
  
  #undef LIB_SPEC
  #define LIB_SPEC \
!  "%{shared:pic/libgcc.a%s}%{!shared:%{!symbolic:-lcrypt -lgen -lc}}"
! 
! #undef LIBGCC_SPEC
! #define LIBGCC_SPEC \
!  "%{!shared:-lgcc}"
  
  #define MASK_COFF     		010000000000	/* Mask for elf generation */
  #define TARGET_COFF             (target_flags & MASK_COFF)

             reply	other threads:[~1997-11-15 21:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-11-15 21:04 J. Kean Johnston [this message]
1997-11-16 22:03 ` Jeffrey A Law
1997-11-17  9:39   ` Robert Lipe
1997-11-17  9:50     ` Jeffrey A Law

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=19971115210620.30844@sco.com \
    --to=jkj@sco.com \
    --cc=egcs@cygnus.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).