diff options
author | Jeff Law <law@redhat.com> | 2014-03-28 16:02:32 -0600 |
---|---|---|
committer | Jeff Law <law@gcc.gnu.org> | 2014-03-28 16:02:32 -0600 |
commit | e7f317893469434eeb833e29fa888ee33a488f3e (patch) | |
tree | 3c054d8b3672d6ff1f01c490ff6c443f86c08e5c /gcc/expr.c | |
parent | 5294e4c32d617f2a52e47fb08d9b83b83885f469 (diff) | |
download | gcc-e7f317893469434eeb833e29fa888ee33a488f3e.zip gcc-e7f317893469434eeb833e29fa888ee33a488f3e.tar.gz gcc-e7f317893469434eeb833e29fa888ee33a488f3e.tar.bz2 |
re PR target/60648 (ICE (segmentation fault) in expand_binop)
PR target/60648
* expr.c (do_tablejump): Use simplify_gen_binary rather than
gen_rtx_{PLUS,MULT} to build up the address expression.
* i386/i386.c (ix86_legitimize_address): Use copy_addr_to_reg to avoid
creating non-canonical RTL.
PR target/60648
* g++.dg/pr60648.C: New test.
Co-Authored-By: Jakub Jelinek <jakub@redhat.com>
From-SVN: r208924
Diffstat (limited to 'gcc/expr.c')
-rw-r--r-- | gcc/expr.c | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -11134,11 +11134,12 @@ do_tablejump (rtx index, enum machine_mode mode, rtx range, rtx table_label, GET_MODE_SIZE, because this indicates how large insns are. The other uses should all be Pmode, because they are addresses. This code could fail if addresses and insns are not the same size. */ - index = gen_rtx_PLUS - (Pmode, - gen_rtx_MULT (Pmode, index, - gen_int_mode (GET_MODE_SIZE (CASE_VECTOR_MODE), Pmode)), - gen_rtx_LABEL_REF (Pmode, table_label)); + index = simplify_gen_binary (MULT, Pmode, index, + gen_int_mode (GET_MODE_SIZE (CASE_VECTOR_MODE), + Pmode)); + index = simplify_gen_binary (PLUS, Pmode, index, + gen_rtx_LABEL_REF (Pmode, table_label)); + #ifdef PIC_CASE_VECTOR_ADDRESS if (flag_pic) index = PIC_CASE_VECTOR_ADDRESS (index); |