Patchwork MeP build fixes

login
register
mail settings
Submitter Joseph S. Myers
Date Sept. 8, 2010, 2:08 p.m.
Message ID <Pine.LNX.4.64.1009081407390.21128@digraph.polyomino.org.uk>
Download mbox | patch
Permalink /patch/64139/
State New
Headers show

Comments

Joseph S. Myers - Sept. 8, 2010, 2:08 p.m.
In the course of testing an option-handling patch I picked mep-elf as
a target using TARGET_OPTION_TRANSLATE_TABLE to test the functionality
of that macro after my patch.

Unfortunately the mep-elf target has been broken for some time.  There
are three causes of brokenness, of which this patch fixes two:

* t-mep redefines GTM_H but doesn't include insn-constants.h (which
  got added to the generic definition at some point) in its
  definition, so depending on build ordering some generator program
  may fail to build with missing insn-constants.h.  This is the
  failure shown in PR 44749.  Fixed in this patch in the obvious way.

* fixed_regs and call_used_regs are now macros, so using them as
  parameter names for mep_conditional_register_usage breaks.  Fixed by
  making that function take no parameters and just use the global
  macros, like similar functions for other targets do.

* mep-pragma.c gets a series of errors starting with

  rtl.h:22:9: error: attempt to use poisoned "GCC_RTL_H"

  because it is being treated as a front-end file but uses rtl.h and
  uses various RTL-related functionality.  I don't know the right fix
  for this issue - for my testing I worked around it with "#undef
  IN_GCC_FRONTEND" but the right fix is more likely to be moving the
  RTL functionality into mep.c while keeping the code using front-end
  pragma interfaces in mep-pragma.c.  Thus, this patch does not fix
  this issue.

Apart from that there are various warnings that would likely break the
build with --enable-werror-always (PR 44756).

Tested building a cross cc1 and xgcc for mep-elf, which worked with
the patch plus mep-pragma.c workaround and failed without it.  OK to
commit?

2010-09-08  Joseph Myers  <joseph@codesourcery.com>

	PR target/44749
	* config/mep/t-mep (GTM_H): Add insn-constants.h.
	* config/mep/mep.c (mep_conditional_register_usage): Take no
	parameters.
	* config/mep/mep-protos.h (mep_conditional_register_usage): Update
	prototype.
	* config/mep/mep-pragma.c (CONDITIONAL_REGISTER_USAGE): Update
	call to mep_conditional_register_usage.
DJ Delorie - Sept. 13, 2010, 10:19 p.m.
> Tested building a cross cc1 and xgcc for mep-elf, which worked with
> the patch plus mep-pragma.c workaround and failed without it.  OK to
> commit?

Sorry for the delay.  Yes, please.

> 2010-09-08  Joseph Myers  <joseph@codesourcery.com>
> 
> 	PR target/44749
> 	* config/mep/t-mep (GTM_H): Add insn-constants.h.
> 	* config/mep/mep.c (mep_conditional_register_usage): Take no
> 	parameters.
> 	* config/mep/mep-protos.h (mep_conditional_register_usage): Update
> 	prototype.
> 	* config/mep/mep-pragma.c (CONDITIONAL_REGISTER_USAGE): Update
> 	call to mep_conditional_register_usage.

Patch

Index: config/mep/t-mep
===================================================================
--- config/mep/t-mep	(revision 163844)
+++ config/mep/t-mep	(working copy)
@@ -1,6 +1,6 @@ 
 # -*- makefile -*-
 # GCC makefile fragment for MeP
-# Copyright (C) 2001, 2002, 2003, 2005, 2007, 2009
+# Copyright (C) 2001, 2002, 2003, 2005, 2007, 2009, 2010
 # Free Software Foundation, Inc.
 # Contributed by Red Hat Inc
 #
@@ -22,7 +22,7 @@ 
 
 # Force genpreds to be rebuilt in case MeP-Integrator changed the predicates
 
-GTM_H = tm.h $(tm_file_list) $(srcdir)/config/mep/mep-intrin.h
+GTM_H = tm.h $(tm_file_list) $(srcdir)/config/mep/mep-intrin.h insn-constants.h
 
 # Use -O0 instead of -O2 so we don't get complex relocations
 
Index: config/mep/mep-protos.h
===================================================================
--- config/mep/mep-protos.h	(revision 163844)
+++ config/mep/mep-protos.h	(working copy)
@@ -1,5 +1,5 @@ 
 /* Prototypes for exported functions defined in mep.c
-   Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009 Free
+   Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009, 2010 Free
    Software Foundation, Inc.
    Contributed by Red Hat Inc (dj@redhat.com)
 
@@ -19,7 +19,7 @@ 
 along with GCC; see the file COPYING3.  If not see
 <http://www.gnu.org/licenses/>.  */
 
-extern void mep_conditional_register_usage (char *, char *);
+extern void mep_conditional_register_usage (void);
 extern void mep_optimization_options (void);
 extern void mep_override_options (void);
 extern int mep_regno_reg_class (int);
Index: config/mep/mep.c
===================================================================
--- config/mep/mep.c	(revision 163844)
+++ config/mep/mep.c	(working copy)
@@ -354,7 +354,7 @@ 
 }
 
 void
-mep_conditional_register_usage (char *fixed_regs, char *call_used_regs)
+mep_conditional_register_usage (void)
 {
   int i;
 
Index: config/mep/mep.h
===================================================================
--- config/mep/mep.h	(revision 163844)
+++ config/mep/mep.h	(working copy)
@@ -1,5 +1,5 @@ 
 /* Definitions for Toshiba Media Processor
-   Copyright (C) 2001, 2003, 2004, 2005, 2007, 2008, 2009
+   Copyright (C) 2001, 2003, 2004, 2005, 2007, 2008, 2009, 2010
    Free Software Foundation, Inc.
    Contributed by Red Hat, Inc.
 
@@ -276,7 +276,7 @@ 
   }
 
 #define CONDITIONAL_REGISTER_USAGE \
-	mep_conditional_register_usage (fixed_regs, call_used_regs);
+	mep_conditional_register_usage ();
 
 #define REG_ALLOC_ORDER {						\
   /* core registers */							\