Skip to contentSkip to conversation

One more gcc patch

PATCH Ralf Baechle 2 participants 3 messages Sep 8, 2000 – Sep 12, 2000 MIPS

lore
Share & tools
lore
#0 lore raw

Ooops, this fixes a bug in the previous patch for gcc-current. So this patch does:

- fix constructors which were not run for shared libs
- fix warnings when building the compiler itself
- Keith's gcse patch
- gcc was generating code which was calling __main from the beginning of main which is wrong for Linux

Ralf

gcc/config/mips/linux.h +17 -0
diff -urN gcc-cygnus/gcc/config/mips/linux.h gcc/gcc/config/mips/linux.h
@@ -170,3 +170,20 @@
 %{mabi=64: -64} \
 %{!fno-PIC:%{!fno-pic:-KPIC}} \
 %{fno-PIC:-non_shared} %{fno-pic:-non_shared}"
+
+/* On svr4, we *do* have support for the .init and .fini sections, and we
+   can put stuff in there to be executed before and after `main'.  We let
+   crtstuff.c and other files know this by defining the following symbols.
+   The definitions say how to change sections to the .init and .fini
+   sections.  This is the same for all known svr4 assemblers.  */
+
+#define INIT_SECTION_ASM_OP     "\t.section\t.init"
+#define FINI_SECTION_ASM_OP     "\t.section\t.fini"
+
+/* Undef junk imported from mips/elf.h.  */
+#undef CTOR_LIST_BEGIN
+#undef CTOR_LIST_END
+#undef DTOR_LIST_BEGIN
+#undef DTOR_LIST_END
+
+#undef INVOKE__main
gcc/config/mips/mips.h +1 -1
diff -urN gcc-cygnus/gcc/config/mips/mips.h gcc/gcc/config/mips/mips.h
@@ -1900,7 +1900,7 @@
 
 extern enum reg_class mips_char_to_class[];
 
-#define REG_CLASS_FROM_LETTER(C) mips_char_to_class[ (C) ]
+#define REG_CLASS_FROM_LETTER(C) mips_char_to_class[ (int) (C) ]
 
 /* The letters I, J, K, L, M, N, O, and P in a register constraint
    string can be used to stand for particular ranges of immediate
gcc/gcse.c +3 -1
diff -urN gcc-cygnus/gcc/gcse.c gcc/gcc/gcse.c
@@ -1924,7 +1924,9 @@
 	  /* Don't GCSE something if we can't do a reg/reg copy.  */
 	  && can_copy_p [GET_MODE (dest)]
 	  /* Is SET_SRC something we want to gcse?  */
-	  && want_to_gcse_p (src))
+	  && want_to_gcse_p (src)
+	  /* Copy between modes is prohibited */
+	  && GET_MODE (src) == GET_MODE (dest))
 	{
 	  /* An expression is not anticipatable if its operands are
 	     modified before this insn.  */
#1 lore raw
Quoted 10 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

Ralf Baechle writes:

Ooops, this fixes a bug in the previous patch for gcc-current. So this patch does:

- fix constructors which were not run for shared libs
- fix warnings when building the compiler itself
- Keith's gcse patch
- gcc was generating code which was calling __main from the beginning of main which is wrong for Linux

Did you run the testsuite?

It doesn't seem to fix C++:

                === libstdc++ Summary ===
# of expected passes            9
# of unexpected failures        10
# of expected failures          11

The number for g++ are even worse, I stopped the check

Any idea how to get C++ working?

Andreas

Signature · 4 lines
 Andreas Jaeger
  SuSE Labs [email protected]
   private [email protected]
    http://www.suse.de/~aj
#2 lore raw
Quoted 1 line · Andreas Jaeger

Did you run the testsuite?

No; I tried rebuilding a large number of RH 6.2 packages. A few of them are broken in ways that make me suspect the compiler is broken. Might also be binutils; I did upgrade both in one step.

Quoted 11 lines

It doesn't seem to fix C++:

                === libstdc++ Summary ===
# of expected passes            9
# of unexpected failures        10
# of expected failures          11

The number for g++ are even worse, I stopped the check

Any idea how to get C++ working?

Debugging?

I think historically nobody did ever invest time into getting the libg++ to work so we somewhen have to pay that price ...

Ralf