diff options
Diffstat (limited to 'gcc-4.9/gcc/simplify-rtx.c')
-rw-r--r-- | gcc-4.9/gcc/simplify-rtx.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/simplify-rtx.c b/gcc-4.9/gcc/simplify-rtx.c index c64de3178..b98e50762 100644 --- a/gcc-4.9/gcc/simplify-rtx.c +++ b/gcc-4.9/gcc/simplify-rtx.c @@ -503,6 +503,12 @@ simplify_replace_fn_rtx (rtx x, const_rtx old_rtx, if (GET_CODE (op0) == HIGH && rtx_equal_p (XEXP (op0, 0), op1)) return op1; + /* (lo_sum (high x) (const (plus x ofs))) -> (const (plus x ofs)) */ + if (GET_CODE (op0) == HIGH && GET_CODE (op1) == CONST + && GET_CODE(XEXP (op1, 0)) == PLUS + && rtx_equal_p (XEXP (XEXP (op1, 0), 0), XEXP (op0, 0))) + return op1; + if (op0 == XEXP (x, 0) && op1 == XEXP (x, 1)) return x; return gen_rtx_LO_SUM (mode, op0, op1); |