aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRamana Radhakrishnan <ramana.radhakrishnan@linaro.org>2012-01-25 08:52:39 +0000
committerRamana Radhakrishnan <ramana@gcc.gnu.org>2012-01-25 08:52:39 +0000
commit2630025d1414327d9ee5d08df1cc63a83127f19b (patch)
tree6c1e06598cc0f7bf20d95ec9a1bfaf7e70b9d06f
parent083dd940dcb2169786fbd523059e8c7f41093812 (diff)
downloadgcc-2630025d1414327d9ee5d08df1cc63a83127f19b.zip
gcc-2630025d1414327d9ee5d08df1cc63a83127f19b.tar.gz
gcc-2630025d1414327d9ee5d08df1cc63a83127f19b.tar.bz2
re PR target/48308 (crosscompiling to arm fails with assembler: can't resolve '.LC4' {.rodata.str1.1 section} - '.LPIC4' {*UND* section})
2012-01-25 Ramana Radhakrishnan <ramana.radhakrishnan@linaro.org> PR rtl-optimization/48308 * combine.c (enum undo_kind): Add UNDO_LINKS. (struct undo): Add member l to other_contents and where. (do_SUBST_LINK): New. (SUBST_LINK): New. (try_combine): Handle LOG_LINKS for the dummy i1 case. (undo_all): Handle UNDO_LINKS. From-SVN: r183512
-rw-r--r--gcc/ChangeLog10
-rw-r--r--gcc/combine.c37
2 files changed, 44 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 3581f4b..fd5acdb 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,13 @@
+2012-01-25 Ramana Radhakrishnan <ramana.radhakrishnan@linaro.org>
+
+ PR rtl-optimization/48308
+ * combine.c (enum undo_kind): Add UNDO_LINKS.
+ (struct undo): Add member l to other_contents and where.
+ (do_SUBST_LINK): New.
+ (SUBST_LINK): New.
+ (try_combine): Handle LOG_LINKS for the dummy i1 case.
+ (undo_all): Handle UNDO_LINKS.
+
2012-01-25 Richard Henderson <rth@redhat.com>
* optabs.c (maybe_emit_atomic_test_and_set): Allow non-QImode
diff --git a/gcc/combine.c b/gcc/combine.c
index 4178870..1e01c87 100644
--- a/gcc/combine.c
+++ b/gcc/combine.c
@@ -367,14 +367,14 @@ static int nonzero_sign_valid;
/* Record one modification to rtl structure
to be undone by storing old_contents into *where. */
-enum undo_kind { UNDO_RTX, UNDO_INT, UNDO_MODE };
+enum undo_kind { UNDO_RTX, UNDO_INT, UNDO_MODE, UNDO_LINKS };
struct undo
{
struct undo *next;
enum undo_kind kind;
- union { rtx r; int i; enum machine_mode m; } old_contents;
- union { rtx *r; int *i; } where;
+ union { rtx r; int i; enum machine_mode m; struct insn_link *l; } old_contents;
+ union { rtx *r; int *i; struct insn_link **l; } where;
};
/* Record a bunch of changes to be undone, up to MAX_UNDO of them.
@@ -789,6 +789,33 @@ do_SUBST_MODE (rtx *into, enum machine_mode newval)
}
#define SUBST_MODE(INTO, NEWVAL) do_SUBST_MODE(&(INTO), (NEWVAL))
+
+/* Similar to SUBST, but NEWVAL is a LOG_LINKS expression. */
+
+static void
+do_SUBST_LINK (struct insn_link **into, struct insn_link *newval)
+{
+ struct undo *buf;
+ struct insn_link * oldval = *into;
+
+ if (oldval == newval)
+ return;
+
+ if (undobuf.frees)
+ buf = undobuf.frees, undobuf.frees = buf->next;
+ else
+ buf = XNEW (struct undo);
+
+ buf->kind = UNDO_LINKS;
+ buf->where.l = into;
+ buf->old_contents.l = oldval;
+ *into = newval;
+
+ buf->next = undobuf.undos, undobuf.undos = buf;
+}
+
+#define SUBST_LINK(oldval, newval) do_SUBST_LINK (&oldval, newval)
+
/* Subroutine of try_combine. Determine whether the replacement patterns
NEWPAT, NEWI2PAT and NEWOTHERPAT are cheaper according to insn_rtx_cost
@@ -2865,6 +2892,7 @@ try_combine (rtx i3, rtx i2, rtx i1, rtx i0, int *new_direct_jump_p,
SUBST (PATTERN (i2), XVECEXP (PATTERN (i2), 0, 0));
SUBST (XEXP (SET_SRC (PATTERN (i2)), 0),
SET_DEST (PATTERN (i1)));
+ SUBST_LINK (LOG_LINKS (i2), alloc_insn_link (i1, LOG_LINKS (i2)));
}
}
#endif
@@ -4494,6 +4522,9 @@ undo_all (void)
case UNDO_MODE:
adjust_reg_mode (*undo->where.r, undo->old_contents.m);
break;
+ case UNDO_LINKS:
+ *undo->where.l = undo->old_contents.l;
+ break;
default:
gcc_unreachable ();
}