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]

freebsd and snaps after 980302



Hi,

I'm new to the list so i apologize if this has already been discussed.  On
snapshots newer that 980303 I have been unable to build a compiler that
produces executables that runs on freebsd-current(a.out). It
looks like
the changes to the emitted alignment directives is the cause. To get
snapshots after 980302 to produce executables that will run without
dumping core on freebsd-current(a.out) I have made the following two
patches. 

In egcs/gcc to final.c

------------- cut ----------------------------
--- final.c.980315	Tue Mar 17 07:44:33 1998
+++ final.c	Tue Mar 17 09:43:22 1998
@@ -1960,8 +1960,16 @@
       /* Align the beginning of a loop, for higher speed
 	 on certain machines.  */
 
-      if (NOTE_LINE_NUMBER (insn) == NOTE_INSN_LOOP_BEG)
+      if (NOTE_LINE_NUMBER (insn) == NOTE_INSN_LOOP_BEG) {
+#ifdef ASM_OUTPUT_LOOP_ALIGN
+	  rtx next = next_nonnote_insn (insn);
+	  if (next && GET_CODE (next) == CODE_LABEL)
+	    {
+	      ASM_OUTPUT_LOOP_ALIGN (asm_out_file);
+	    }
+#endif
 	break; /* This used to depend on optimize, but that was bogus.  */
+      }
       if (NOTE_LINE_NUMBER (insn) == NOTE_INSN_LOOP_END)
 	break;
 
-------------- cut ---------------------------

and in egcs/gcc/config/i386/freebsd.h

-------------- cut ---------------------------
--- freebsd.h.980308	Tue Mar 17 07:17:53 1998
+++ freebsd.h	Tue Mar 17 09:24:56 1998
@@ -66,7 +66,27 @@
 
 #undef ASM_APP_OFF
 #define ASM_APP_OFF "#NO_APP\n"
+
 
+
+
+
+#undef ASM_OUTPUT_ALIGN
+#define ASM_OUTPUT_ALIGN(FILE,LOG)      \
+  if ((LOG)!=0) fprintf ((FILE), "\t.p2align %d,0x90\n", (LOG))
+
+/* Align labels, etc. at 4-byte boundaries.
+   For the 486, align to 16-byte boundary for sake of cache.  */
+#undef ASM_OUTPUT_ALIGN_CODE
+#define ASM_OUTPUT_ALIGN_CODE(FILE) \
+  fprintf ((FILE), "\t.p2align %d,0x90\n", i386_align_jumps)
+
+/* Align start of loop at 4-byte boundary.  */
+#undef ASM_OUTPUT_LOOP_ALIGN
+#define ASM_OUTPUT_LOOP_ALIGN(FILE) \
+  fprintf ((FILE), "\t.p2align %d,0x90\n", i386_align_loops)
+
+
 /* The following macros are stolen from i386v4.h */
 /* These have to be defined to get PIC code correct */
 


dave adkins



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