This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH 2/3] [ARC] Do not emit ZOL in the presence of text jump tables.
- From: Claudiu Zissulescu <claziss at gmail dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: fbedard at synopsys dot com, andrew dot burgess at embecosm dot com, claziss at synopsys dot com
- Date: Mon, 12 Nov 2018 13:25:12 +0200
- Subject: [PATCH 2/3] [ARC] Do not emit ZOL in the presence of text jump tables.
- References: <20181112112513.4369-1-claziss@gmail.com>
Avoid emitting lp instruction when in its ZOL body we find a jump table data
in text section.
gcc/
xxxx-xx-xx Claudiu Zissulescu <claziss@synopsys.com>
* config/arc/arc.c (hwloop_optimize): Bailout when detecting a
jump table data in the text section.
---
gcc/config/arc/arc.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/gcc/config/arc/arc.c b/gcc/config/arc/arc.c
index a92456b457d..9eab4c27284 100644
--- a/gcc/config/arc/arc.c
+++ b/gcc/config/arc/arc.c
@@ -7791,7 +7791,17 @@ hwloop_optimize (hwloop_info loop)
for (insn = loop->start_label;
insn && insn != loop->loop_end;
insn = NEXT_INSN (insn))
- length += NONDEBUG_INSN_P (insn) ? get_attr_length (insn) : 0;
+ {
+ length += NONDEBUG_INSN_P (insn) ? get_attr_length (insn) : 0;
+ if (JUMP_TABLES_IN_TEXT_SECTION
+ && JUMP_TABLE_DATA_P (insn))
+ {
+ if (dump_file)
+ fprintf (dump_file, ";; loop %d has a jump table\n",
+ loop->loop_no);
+ return false;
+ }
+ }
if (!insn)
{
--
2.19.1