This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/10567] -fno-delayed-branch no honored when -mflat
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 24 Aug 2003 02:54:47 -0000
- Subject: [Bug target/10567] -fno-delayed-branch no honored when -mflat
- References: <20030430161600.10567.davem@redhat.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=10567
------- Additional Comments From pinskia at gcc dot gnu dot org 2003-08-24 02:54 -------
David could you test a patch for me as I do not have access to a sparc?
Index: sparc.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/sparc/sparc.c,v
retrieving revision 1.256
diff -u -p -r1.256 sparc.c
--- sparc.c 16 Aug 2003 23:59:56 -0000 1.256
+++ sparc.c 24 Aug 2003 02:51:18 -0000
@@ -7223,11 +7223,13 @@ sparc_flat_function_epilogue (FILE *file
fprintf (file, "\tset\t" HOST_WIDE_INT_PRINT_DEC ", %s\n",
size, t1_str);
}
-
- if (current_function_returns_struct)
- fprintf (file, "\tjmp\t%%o7+12\n");
- else
- fprintf (file, "\tretl\n");
+ if (flag_delayed_branch)
+ {
+ if (current_function_returns_struct)
+ fprintf (file, "\tjmp\t%%o7+12\n");
+ else
+ fprintf (file, "\tretl\n");
+ }
/* If the only register saved is the return address, we need a
nop, unless we have an instruction to put into it. Otherwise
@@ -7247,8 +7249,16 @@ sparc_flat_function_epilogue (FILE *file
else if (size > 0)
fprintf (file, "\tadd\t%s, %d, %s\n", sp_str, (int) size, sp_str);
- else
+ else if (flag_delayed_branch)
fprintf (file, "\tnop\n");
+
+ if (!flag_delayed_branch)
+ {
+ if (current_function_returns_struct)
+ fprintf (file, "\tjmp\t%%o7+12\n\tnop\n");
+ else
+ fprintf (file, "\tretl\n\tnop\n");
+ }
}
/* Reset state info for each function. */