Patchwork Fix breakage for m68k-linux introduced by 4a020a8 / r189359

login
register
mail settings
Submitter Jan-Benedict Glaw
Date July 11, 2012, 5:49 a.m.
Message ID <20120711054945.GE25491@lug-owl.de>
Download mbox | patch
Permalink /patch/170361/
State New
Headers show

Comments

Jan-Benedict Glaw - July 11, 2012, 5:49 a.m.
Hi!

Git revision 4a020a8 [aka. SVN 189359], the large header reordering patch,
broke m68k-linux (.../configure --target=m68k-linux --prefix=...
--enable-languages=c --disable-threads) for me:

[...]
gcc -c   -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE  -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wmissing-format-attribute -pedantic -Wno
-long-long -Wno-variadic-macros -Wno-overlength-strings -Wold-style-definition -Wc++-compat -fno-common  -DHAVE_CONFIG_H -I. -I. -I../../../../gcc/gcc -I../../../../gcc/gcc/. -I../../../../gcc/gcc/../include -I../../../../gcc/gcc/../libcpp/include  -I../../../../gcc/gcc/../libdecnumber -I../../../../gcc/gcc/../libdecnumber/dpd -I../libdecnumber    ../../../../gcc/gcc/resource.c -o resource.o
../../../../gcc/gcc/resource.c: In function ‘init_resource_info’:
../../../../gcc/gcc/resource.c:1179:5: error: ‘current_function_decl’ undeclared (first use in this function)
../../../../gcc/gcc/resource.c:1179:5: note: each undeclared identifier is reported only once for each function it appears in
make[2]: *** [resource.o] Error 1

I suggest the following patch, which is only compile-tested.

MfG, JBG


2012-07-11  Jan-Benedict Glaw  <jbglaw@lug-owl.de>

        * config/m68k/m68k.c (m68k_epilogue_uses): New.
	* config/m68k/m68k.h (m68k_epilogue_uses): Use new function
	instead of former macro.
	* config/m68k/m68k-protos.h (m68k_epilogue_uses): Declare.
Steven Bosscher - July 11, 2012, 6:44 a.m.
On Wed, Jul 11, 2012 at 7:49 AM, Jan-Benedict Glaw <jbglaw@lug-owl.de> wrote:
> Hi!
>
> Git revision 4a020a8 [aka. SVN 189359], the large header reordering patch,
> broke m68k-linux (.../configure --target=m68k-linux --prefix=...
> --enable-languages=c --disable-threads) for me:
>
> [...]
> gcc -c   -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE  -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wmissing-format-attribute -pedantic -Wno
> -long-long -Wno-variadic-macros -Wno-overlength-strings -Wold-style-definition -Wc++-compat -fno-common  -DHAVE_CONFIG_H -I. -I. -I../../../../gcc/gcc -I../../../../gcc/gcc/. -I../../../../gcc/gcc/../include -I../../../../gcc/gcc/../libcpp/include  -I../../../../gcc/gcc/../libdecnumber -I../../../../gcc/gcc/../libdecnumber/dpd -I../libdecnumber    ../../../../gcc/gcc/resource.c -o resource.o
> ../../../../gcc/gcc/resource.c: In function ‘init_resource_info’:
> ../../../../gcc/gcc/resource.c:1179:5: error: ‘current_function_decl’ undeclared (first use in this function)
> ../../../../gcc/gcc/resource.c:1179:5: note: each undeclared identifier is reported only once for each function it appears in
> make[2]: *** [resource.o] Error 1
>
> I suggest the following patch, which is only compile-tested.
>
> MfG, JBG
>
>
> 2012-07-11  Jan-Benedict Glaw  <jbglaw@lug-owl.de>
>
>         * config/m68k/m68k.c (m68k_epilogue_uses): New.
>         * config/m68k/m68k.h (m68k_epilogue_uses): Use new function
>         instead of former macro.
>         * config/m68k/m68k-protos.h (m68k_epilogue_uses): Declare.

Did your build already include
http://gcc.gnu.org/ml/gcc-patches/2012-07/msg00378.html ?

Ciao!
Steven
Andreas Schwab - July 11, 2012, 7:44 a.m.
This is already fixed.

Andreas.
Jan-Benedict Glaw - July 11, 2012, 10:44 a.m.
On Wed, 2012-07-11 08:44:33 +0200, Steven Bosscher <stevenb.gcc@gmail.com> wrote:
> On Wed, Jul 11, 2012 at 7:49 AM, Jan-Benedict Glaw <jbglaw@lug-owl.de> wrote:
> > Hi!
> >
> > Git revision 4a020a8 [aka. SVN 189359], the large header reordering patch,
> > broke m68k-linux (.../configure --target=m68k-linux --prefix=...
> > --enable-languages=c --disable-threads) for me:
> >
> > [...]
> > gcc -c   -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE  -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wmissing-format-attribute -pedantic -Wno
> > -long-long -Wno-variadic-macros -Wno-overlength-strings -Wold-style-definition -Wc++-compat -fno-common  -DHAVE_CONFIG_H -I. -I. -I../../../../gcc/gcc -I../../../../gcc/gcc/. -I../../../../gcc/gcc/../include -I../../../../gcc/gcc/../libcpp/include  -I../../../../gcc/gcc/../libdecnumber -I../../../../gcc/gcc/../libdecnumber/dpd -I../libdecnumber    ../../../../gcc/gcc/resource.c -o resource.o
> > ../../../../gcc/gcc/resource.c: In function ‘init_resource_info’:
> > ../../../../gcc/gcc/resource.c:1179:5: error: ‘current_function_decl’ undeclared (first use in this function)
> > ../../../../gcc/gcc/resource.c:1179:5: note: each undeclared identifier is reported only once for each function it appears in
> > make[2]: *** [resource.o] Error 1
[...]
> Did your build already include
> http://gcc.gnu.org/ml/gcc-patches/2012-07/msg00378.html ?

No, this was fixed parallel to my observation. With an almost
identical patch:)

Thanks for the work!

MfG, JBG

Patch

diff --git a/gcc/config/m68k/m68k-protos.h b/gcc/config/m68k/m68k-protos.h
index c779588..16ad157 100644
--- a/gcc/config/m68k/m68k-protos.h
+++ b/gcc/config/m68k/m68k-protos.h
@@ -99,3 +99,4 @@  extern void init_68881_table (void);
 extern rtx m68k_legitimize_call_address (rtx);
 extern rtx m68k_legitimize_sibcall_address (rtx);
 extern int m68k_hard_regno_rename_ok(unsigned int, unsigned int);
+extern bool m68k_epilogue_uses (unsigned int regno);
diff --git a/gcc/config/m68k/m68k.c b/gcc/config/m68k/m68k.c
index df70560..d07ee18 100644
--- a/gcc/config/m68k/m68k.c
+++ b/gcc/config/m68k/m68k.c
@@ -6506,4 +6506,14 @@  m68k_init_sync_libfuncs (void)
   init_sync_libfuncs (UNITS_PER_WORD);
 }
 
+/* Implement EPILOGUE_USES.  */
+
+bool
+m68k_epilogue_uses (unsigned int regno ATTRIBUTE_UNUSED)
+{
+  return (reload_completed
+	  && (m68k_get_function_kind (current_function_decl)
+	      == m68k_fk_interrupt_handler));
+}
+
 #include "gt-m68k.h"
diff --git a/gcc/config/m68k/m68k.h b/gcc/config/m68k/m68k.h
index b8d8d9c..4c3bb1b 100644
--- a/gcc/config/m68k/m68k.h
+++ b/gcc/config/m68k/m68k.h
@@ -803,10 +803,7 @@  do { if (cc_prev_status.flags & CC_IN_68881)			\
 #define INCOMING_FRAME_SP_OFFSET 4
 
 /* All registers are live on exit from an interrupt routine.  */
-#define EPILOGUE_USES(REGNO)					\
-  (reload_completed						\
-   && (m68k_get_function_kind (current_function_decl)	\
-       == m68k_fk_interrupt_handler))
+#define EPILOGUE_USES(REGNO)	m68k_epilogue_uses (REGNO)
 
 /* Describe how we implement __builtin_eh_return.  */
 #define EH_RETURN_DATA_REGNO(N) \