Patch: Darwin ppc: -falign-xxx

Dale Johannesen dalej@apple.com
Wed Oct 30 17:31:00 GMT 2002


These options did not work on Darwin since the assembler uses 0's (an 
illegal
instruction on ppc) to pad out .align in code sections, rather than 
NOPs.
This causes the .align32 directive to be used in code sections instead;
this is not available on other OSs so the patch is Darwin specific.
Bootstrapped and verified that the options now work.

Index: darwin.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/rs6000/darwin.h,v
retrieving revision 1.27
diff -u -d -b -w -c -3 -p -r1.27 darwin.h
*** darwin.h    14 Sep 2002 13:12:53 -0000      1.27
--- darwin.h    31 Oct 2002 01:30:18 -0000
*************** Boston, MA 02111-1307, USA.  */
*** 136,141 ****
--- 136,154 ----
   #define       RESTORE_FP_PREFIX "._restf"
   #define RESTORE_FP_SUFFIX ""

+ /* This is how to output an assembler line that says to advance
+    the location counter to a multiple of 2**LOG bytes using the
+    "nop" instruction as padding.  */
+
+ #define ASM_OUTPUT_ALIGN_WITH_NOP(FILE,LOG)                    \
+   do {                                                         \
+     if ((LOG) < 3) {                                           \
+       ASM_OUTPUT_ALIGN (FILE,LOG);                             \
+     }                                                          \
+     else /* nop == ori r0,r0,0 */                              \
+       fprintf (FILE, "\t.align32 %d,0x60000000\n", (LOG));     \
+   } while (0);
+
   /* Generate insns to call the profiler.  */

   #define PROFILE_HOOK(LABEL)   output_profile_hook (LABEL)



More information about the Gcc-patches mailing list