This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

optimizer bugs, -g weirdness and an Open Server patch


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)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]