On 03/05/2012 01:49 PM, Richard Henderson wrote:
> On 03/05/2012 01:44 PM, Oleg Endo wrote:
>> Yeah, however, I'm also using the value behind
>> TARGET_ATOMIC_TEST_AND_SET_TRUEVAL in sync.md. If it's in sh.c it
>> doesn't work. That's why I left it in sh.h.
>
> That value should be available via targetm.atomic_test_and_set_trueval.
Fixed thus.
r~
diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index 9a35295..0b7e635 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -3495,8 +3495,8 @@ insn-automata.o : insn-automata.c $(CONFIG_H) $(SYSTEM_H)
coretypes.h \
insn-emit.o : insn-emit.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(RTL_H) $(TM_P_H) $(FUNCTION_H) $(EXPR_H) $(OPTABS_H) \
dfp.h $(FLAGS_H) output.h insn-config.h hard-reg-set.h $(RECOG_H) \
- $(RESOURCE_H) reload.h $(DIAGNOSTIC_CORE_H) $(REGS_H) tm-constrs.h $(GGC_H)
\
- $(BASIC_BLOCK_H) $(INTEGRATE_H)
+ $(RESOURCE_H) reload.h $(DIAGNOSTIC_CORE_H) $(REGS_H) tm-constrs.h \
+ $(GGC_H) $(BASIC_BLOCK_H) $(INTEGRATE_H) $(TARGET_H)
insn-enums.o : insn-enums.c $(CONFIG_H) $(SYSTEM_H) insn-constants.h
insn-extract.o : insn-extract.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
$(TM_H) $(RTL_H) $(DIAGNOSTIC_CORE_H) insn-config.h $(RECOG_H)
diff --git a/gcc/config/sh/sync.md b/gcc/config/sh/sync.md
index 113288c..258e048 100644
--- a/gcc/config/sh/sync.md
+++ b/gcc/config/sh/sync.md
@@ -417,9 +417,10 @@
emit_insn (gen_tasb (addr));
else
{
- rtx val = force_reg (QImode,
- gen_int_mode (TARGET_ATOMIC_TEST_AND_SET_TRUEVAL,
- QImode));
+ rtx val;
+
+ val = gen_int_mode (targetm.atomic_test_and_set_trueval, QImode);
+ val = force_reg (QImode, val);
emit_insn (gen_atomic_test_and_set_soft (addr, val));
}
diff --git a/gcc/genemit.c b/gcc/genemit.c
index 662d8ca..173e4d3 100644
--- a/gcc/genemit.c
+++ b/gcc/genemit.c
@@ -812,7 +812,8 @@ from the machine description file `md'. */\n\n");
printf ("#include \"tm-constrs.h\"\n");
printf ("#include \"ggc.h\"\n");
printf ("#include \"basic-block.h\"\n");
- printf ("#include \"integrate.h\"\n\n");
+ printf ("#include \"integrate.h\"\n");
+ printf ("#include \"target.h\"\n\n");
printf ("#define FAIL return (end_sequence (), _val)\n");
printf ("#define DONE return (_val = get_insns (), end_sequence (),
_val)\n\n");