[patch i386]: Add support of "hotfix" -feature for x64

Jack Howarth howarth@bromo.med.uc.edu
Tue Jul 6 23:27:00 GMT 2010


On Tue, Jul 06, 2010 at 08:28:48PM +0200, Kai Tietz wrote:
> 2010/7/6 Uros Bizjak <ubizjak@gmail.com>:
> > Hello!
> >
> >> Better, but honestly I'd been thinking just to bring one
> >> directive per line, rather than trying to block the output
> >> onto several lines.  I.e.
> >>
> >>   for (i = 0; i < filler_count; i += 4)
> >>    fprintf (asm_out_file, ASM_LONG " 0x%x\n", filler_cc);
> >>
> >>
> >> Ok with that change.
> >
> > Please also use %#x instead of 0x%x.
> >
> > Thanks,
> > Uros.
> >
> 
> 
> Ok, changed it to a simple loop without formatting and I use %#x.
> Committed at revision 161875 & 161876
> 
> Thanks,
> Kai

This patch breaks the bootstrap on i386-apple-darwin* and
x86_64-apple-darwin* since gcc/config/darwin.h defines
ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL). Simply changing...

Index: gcc/config/darwin.h
===================================================================
--- gcc/config/darwin.h (revision 161889)
+++ gcc/config/darwin.h (working copy)
@@ -635,7 +635,8 @@
       assemble_zeros (1);                                              \
   } while (0)
 
-#define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL)                    \
+#undef SUBTARGET_ASM_DECLARE_FUNCTION_NAME
+#define SUBTARGET_ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL)                  \
   do {                                                                 \
     const char *xname = NAME;                                          \
     if (GET_CODE (XEXP (DECL_RTL (DECL), 0)) != SYMBOL_REF)            \
@@ -649,7 +650,6 @@
         && (!DECL_COMMON (DECL) || !TREE_PUBLIC (DECL)))               \
         || DECL_INITIAL (DECL))                                                \
       (* targetm.encode_section_info) (DECL, DECL_RTL (DECL), false);  \
-    ASM_OUTPUT_LABEL (FILE, xname);                                    \
   } while (0)
 
 #undef TARGET_ASM_DECLARE_CONSTANT_NAME

is insufficient since it results in a bootstrap failure of...

/sw/src/fink.build/gcc46-4.6.0-1000/darwin_objdir/./prev-gcc/xgcc -B/sw/src/fink.build/gcc46-4.6.0-1000/darwin_objdir/./prev-gcc/ -B/sw/lib/gcc4.6/x86_64-apple-darwin10.4.0/bin/ -B/sw/lib/gcc4.6/x86_64-apple-darwin10.4.0/bin/ -B/sw/lib/gcc4.6/x86_64-apple-darwin10.4.0/lib/ -isystem /sw/lib/gcc4.6/x86_64-apple-darwin10.4.0/include -isystem /sw/lib/gcc4.6/x86_64-apple-darwin10.4.0/sys-include    -c   -g -O2 -gtoggle -DIN_GCC   -W -Wall -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wmissing-format-attribute -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -Werror -Wold-style-definition -Wc++-compat   -DHAVE_CONFIG_H -I. -I. -I../../gcc-4.6-20100706/gcc -I../../gcc-4.6-20100706/gcc/. -I../../gcc-4.6-20100706/gcc/../include -I../../gcc-4.6-20100706/gcc/../libcpp/include -I/sw/include -I/sw/include  -I../../gcc-4.6-20100706/gcc/../libdecnumber -I../../gcc-4.6-20100706/gcc/../libdecnumber/dpd -I../libdecnumber -I/sw/include  -I/sw/include -DCLOOG_PPL_BACKEND   -I/sw/include -I. -I. -I../../gcc-4.6-20100706/gcc -I../../gcc-4.6-20100706/gcc/. -I../../gcc-4.6-20100706/gcc/../include -I../../gcc-4.6-20100706/gcc/../libcpp/include -I/sw/include -I/sw/include  -I../../gcc-4.6-20100706/gcc/../libdecnumber -I../../gcc-4.6-20100706/gcc/../libdecnumber/dpd -I../libdecnumber -I/sw/include  -I/sw/include -DCLOOG_PPL_BACKEND   ../../gcc-4.6-20100706/gcc/config/host-darwin.c
../../gcc-4.6-20100706/gcc/config/i386/i386.c: In function 'ix86_asm_declare_function_name':
../../gcc-4.6-20100706/gcc/config/i386/i386.c:5121:3: error: variable 'xname' set but not used [-Werror=unused-but-set-variable]

Also any fix will have to take in account that darwin.h is shared
between powerpc-apple-darwin* and *86-apple-darwin* so the hot-fix
will either have to be extended to rs6000 or the macro definition
moved out of gcc/config/darwin.h and into gcc/config/rs6000/darwin.h
as ASM_DECLARE_FUNCTION_NAME() and into gcc/config/i386/darwin.h as
SUBTARGET_ASM_DECLARE_FUNCTION_NAME(). A mechanism to handle the use
of xname in SUBTARGET_ASM_DECLARE_FUNCTION_NAME() on darwin still is
required.
          Jack
> 
> -- 
> |  (\_/) This is Bunny. Copy and paste
> | (='.'=) Bunny into your signature to help
> | (")_(") him gain world domination



More information about the Gcc-patches mailing list