This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: SH: PR target/22553
Joern RENNECKE <joern.rennecke@st.com> wrote:
> Yes, we can use this as a release workaround. OVERRIDE_OPTIONS should
> probably also issue a
> warning about switching sched1 off because of bugs in exception
> handling, so that users are
> alerted to the fact that they have to turn off exception handling if
> they want the first scheduling pass
> to be run.
How does look the attached patch? Without the hunk in OPTIMIZATION_OPTIONS,
I've got many failures in c++ test failures because of the warning and
I was unable to find an appropriate OPT_W-flag to avoid it.
> Note, however, that this workaround is not guaranteed to cover all the
> related issues.
Indeed. I'm worried that someone may hit the issue in the large and
complex c++ program.
Regards,
kaz
--
:ADDPATCH target:
2005-10-15 Kaz Kojima <kkojima@gcc.gnu.org>
* config/sh/sh.h (OPTIMIZATION_OPTIONS): Set flag_schedule_insns
to 2 if it's already non-zero.
(OVERRIDE_OPTIONS): Clear flag_schedule_insns if flag_exceptions
is set and warn about it if flag_schedule_insns is 1.
diff -uprN ORIG/gcc/gcc/config/sh/sh.h LOCAL/gcc/gcc/config/sh/sh.h
--- ORIG/gcc/gcc/config/sh/sh.h 2005-09-13 05:56:10.000000000 +0900
+++ LOCAL/gcc/gcc/config/sh/sh.h 2005-10-15 07:31:14.000000000 +0900
@@ -486,6 +486,10 @@ do { \
flag_finite_math_only. We set it to 2 here so we know if the user \
explicitly requested this to be on or off. */ \
flag_finite_math_only = 2; \
+ /* If flag_schedule_insns is 1, we set it to 2 here so we know if \
+ the user explicitly requested this to be on or off. */ \
+ if (flag_schedule_insns > 0) \
+ flag_schedule_insns = 2; \
} while (0)
#define ASSEMBLER_DIALECT assembler_dialect
@@ -661,6 +665,17 @@ do { \
SH3 and lower as they give spill failures for R0. */ \
if (!TARGET_HARD_SH4) \
flag_schedule_insns = 0; \
+ /* ??? Current exception handling places basic block boundaries \
+ after call_insns. It causes the high pressure on R0 and gives \
+ spill failures for R0 in reload. See PR 22552 and the thread \
+ on gcc-patches \
+ <http://gcc.gnu.org/ml/gcc-patches/2005-10/msg00816.html>. */ \
+ else if (flag_exceptions) \
+ { \
+ if (flag_schedule_insns == 1) \
+ warning (0, "ignoring -fschedule-insns because of exception handling bug"); \
+ flag_schedule_insns = 0; \
+ } \
} \
\
if (align_loops == 0) \