From: Richard Guenther Date: Tue, 24 Jan 2012 10:23:14 +0000 (+0000) Subject: [multiple changes] X-Git-Tag: releases/gcc-4.6.3~151 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=069c2f0ad3df4318fda6667c0a557cef7ea7a96d;p=thirdparty%2Fgcc.git [multiple changes] 2012-01-24 Richard Guenther Forward-port to branch 2010-09-21 Jakub Jelinek PR middle-end/45678 * expr.c (expand_expr_real_1) : If op0 isn't sufficiently aligned and there is movmisalignM insn for mode, use it to load op0 into a temporary register. From-SVN: r183471 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 2c3ff92db7d3..c63ae26518b7 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,13 @@ +2012-01-24 Richard Guenther + + Forward-port to branch + 2010-09-21 Jakub Jelinek + + PR middle-end/45678 + * expr.c (expand_expr_real_1) : If + op0 isn't sufficiently aligned and there is movmisalignM + insn for mode, use it to load op0 into a temporary register. + 2012-01-20 Eric Botcazou * cfgrtl.c (rtl_dump_bb): Do not dump insns for {ENTRY|EXIT}_BLOCK. diff --git a/gcc/expr.c b/gcc/expr.c index f20d745ea439..d813e21ea05f 100644 --- a/gcc/expr.c +++ b/gcc/expr.c @@ -9609,10 +9609,32 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode, results. */ if (MEM_P (op0)) { + enum insn_code icode; + op0 = copy_rtx (op0); if (TYPE_ALIGN_OK (type)) set_mem_align (op0, MAX (MEM_ALIGN (op0), TYPE_ALIGN (type))); + else if (mode != BLKmode + && MEM_ALIGN (op0) < GET_MODE_ALIGNMENT (mode) + /* If the target does have special handling for unaligned + loads of mode then use them. */ + && ((icode = optab_handler (movmisalign_optab, mode)) + != CODE_FOR_nothing)) + { + rtx reg, insn; + + op0 = adjust_address (op0, mode, 0); + /* We've already validated the memory, and we're creating a + new pseudo destination. The predicates really can't + fail. */ + reg = gen_reg_rtx (mode); + + /* Nor can the insn generator. */ + insn = GEN_FCN (icode) (reg, op0); + emit_insn (insn); + return reg; + } else if (STRICT_ALIGNMENT && mode != BLKmode && MEM_ALIGN (op0) < GET_MODE_ALIGNMENT (mode))