This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug target/71331] target-tilegx: nested-function-4.c: r10 is conflict which is both in function frame and in parameter.


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71331

--- Comment #1 from Chen Gang <gang.chen.5i5j at gmail dot com> ---

Oh, lucky enough! The diff below should be OK for this issue.

diff --git a/gcc/config/tilegx/tilegx.c b/gcc/config/tilegx/tilegx.c
index 06c832c..bc41105 100644
--- a/gcc/config/tilegx/tilegx.c
+++ b/gcc/config/tilegx/tilegx.c
@@ -5510,18 +5510,28 @@ tilegx_function_profiler (FILE *file, int labelno
ATTRIBUTE_UNUSED)
   if (flag_pic)
     {
       fprintf (file,
+              "\tst\tsp, r10\n"
+              "\taddi\tsp, sp, -8\n"
               "\t{\n"
               "\tmove\tr10, lr\n"
               "\tjal\tplt(%s)\n"
-              "\t}\n", MCOUNT_NAME);
+              "\t}\n"
+              "\taddi\tsp, sp, 8\n"
+              "\tld\tr10, sp\n",
+              MCOUNT_NAME);
     }
   else
     {
       fprintf (file,
+              "\tst\tsp, r10\n"
+              "\taddi\tsp, sp, -8\n"
               "\t{\n"
               "\tmove\tr10, lr\n"
               "\tjal\t%s\n"
-              "\t}\n", MCOUNT_NAME);
+              "\t}\n"
+              "\taddi\tsp, sp, 8\n"
+              "\tld\tr10, sp\n",
+              MCOUNT_NAME);
     }

   tilegx_in_bundle = false;

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]