aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/mips/mips.h
diff options
context:
space:
mode:
authorJunxian Zhu <zhujunxian@oss.cipunited.com>2023-02-17 16:24:55 +0800
committerYunQiang Su <yunqiang.su@cipunited.com>2023-02-24 11:19:55 +0800
commita3a45f0b145ae9381ce3daa75db17c43a76ec7fd (patch)
tree15f48ce9632a858176598a39e125ff1c5c8468b8 /gcc/config/mips/mips.h
parente2b20ed3efd22acaabfa87fd07869045747bd7f9 (diff)
downloadgcc-a3a45f0b145ae9381ce3daa75db17c43a76ec7fd.zip
gcc-a3a45f0b145ae9381ce3daa75db17c43a76ec7fd.tar.gz
gcc-a3a45f0b145ae9381ce3daa75db17c43a76ec7fd.tar.bz2
Hazard barrier return support
This patch allows a function to request clearing of all instruction and execution hazards upon normal return via __attribute__ ((use_hazard_barrier_return)). 2017-04-25 Prachi Godbole <prachi.godbole@imgtec.com> gcc/ChangeLog: * config/mips/mips.h (machine_function): New variable use_hazard_barrier_return_p. * config/mips/mips.md (UNSPEC_JRHB): New unspec. (mips_hb_return_internal): New insn pattern. * config/mips/mips.cc (mips_attribute_table): Add attribute use_hazard_barrier_return. (mips_use_hazard_barrier_return_p): New static function. (mips_function_attr_inlinable_p): Likewise. (mips_compute_frame_info): Set use_hazard_barrier_return_p. Emit error for unsupported architecture choice. (mips_function_ok_for_sibcall, mips_can_use_return_insn): Return false for use_hazard_barrier_return. (mips_expand_epilogue): Emit hazard barrier return. * doc/extend.texi: Document use_hazard_barrier_return. gcc/testsuite/ChangeLog: * gcc.target/mips/hazard-barrier-return-attribute.c: New test. Signed-off-by: Junxian Zhu <zhujunxian@oss.cipunited.com>
Diffstat (limited to 'gcc/config/mips/mips.h')
-rw-r--r--gcc/config/mips/mips.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/gcc/config/mips/mips.h b/gcc/config/mips/mips.h
index fbb4372..f664d30 100644
--- a/gcc/config/mips/mips.h
+++ b/gcc/config/mips/mips.h
@@ -3386,6 +3386,9 @@ struct GTY(()) machine_function {
/* True if GCC stored callee saved registers in the frame header. */
bool use_frame_header_for_callee_saved_regs;
+
+ /* True if the function should generate hazard barrier return. */
+ bool use_hazard_barrier_return_p;
};
#endif