This patch puts profiling code before the prologue, to avoid
clobbering used registers.  Backported to 4.7 and 4.8.

        * config/tilegx/tilegx.h (PROFILE_BEFORE_PROLOGUE): Define.
        * config/tilegx/tilepro.h (PROFILE_BEFORE_PROLOGUE): Define.

Index: gcc/config/tilegx/tilegx.h
===================================================================
--- gcc/config/tilegx/tilegx.h  (revision 197083)
+++ gcc/config/tilegx/tilegx.h  (working copy)
@@ -287,6 +287,8 @@ enum reg_class
 #define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET) \
   ((OFFSET) = tilegx_initial_elimination_offset((FROM),(TO)))
 
+#define PROFILE_BEFORE_PROLOGUE 1
+
 #define FUNCTION_PROFILER(FILE, LABELNO) \
   tilegx_function_profiler (FILE, LABELNO)
 
Index: gcc/config/tilepro/tilepro.h
===================================================================
--- gcc/config/tilepro/tilepro.h        (revision 197083)
+++ gcc/config/tilepro/tilepro.h        (working copy)
@@ -268,6 +268,8 @@ enum reg_class
 #define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET) \
   ((OFFSET) = tilepro_initial_elimination_offset((FROM),(TO)))
 
+#define PROFILE_BEFORE_PROLOGUE 1
+
 #define FUNCTION_PROFILER(FILE, LABELNO) \
   tilepro_function_profiler (FILE, LABELNO)
 

Reply via email to