aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClaudiu Zissulescu <claziss@synopsys.com>2018-11-13 13:51:30 +0100
committerClaudiu Zissulescu <claziss@gcc.gnu.org>2018-11-13 13:51:30 +0100
commitdddc18157283e3ab2a3a4c32ededae2386a54bb3 (patch)
tree330a73d9015fedd81c8b5b5cb213f5e54490177a
parent3fd6ae8a2541dad32b03c4c039127f0651dbdf1f (diff)
downloadgcc-dddc18157283e3ab2a3a4c32ededae2386a54bb3.zip
gcc-dddc18157283e3ab2a3a4c32ededae2386a54bb3.tar.gz
gcc-dddc18157283e3ab2a3a4c32ededae2386a54bb3.tar.bz2
[ARC] Do not emit ZOL in the presence of text jump tables.
Avoid emitting lp instruction when in its ZOL body we find a jump table data in text section. One of the reason is the jump tables size can be changed latter on, hence the total ZOL length may be wrongly computed. 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. From-SVN: r266067
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/config/arc/arc.c12
2 files changed, 16 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 5683289..7ba3fd3f 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,10 @@
2018-11-13 Claudiu Zissulescu <claziss@synopsys.com>
+ * config/arc/arc.c (hwloop_optimize): Bailout when detecting a
+ jump table data in the text section.
+
+2018-11-13 Claudiu Zissulescu <claziss@synopsys.com>
+
* config/arc/arc.c (arc_eh_return_address_location): Repurpose it
to fit the eh_return pattern.
* config/arc/arc.md (eh_return): Define.
diff --git a/gcc/config/arc/arc.c b/gcc/config/arc/arc.c
index dbe6ff5..6bf8e85 100644
--- a/gcc/config/arc/arc.c
+++ b/gcc/config/arc/arc.c
@@ -7861,7 +7861,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)
{