diff options
author | Richard Sandiford <rdsandiford@googlemail.com> | 2011-06-06 18:16:18 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@gcc.gnu.org> | 2011-06-06 18:16:18 +0000 |
commit | 4de4b0f267380846df53edeea0afdcb383fd4d8f (patch) | |
tree | afceeeb67948e24f1ee59b3dc64fc6ff7a851eb5 /gcc/combine.c | |
parent | f9b41b6c80b0d54eacd9a0101e1f230e0faa5554 (diff) | |
download | gcc-4de4b0f267380846df53edeea0afdcb383fd4d8f.zip gcc-4de4b0f267380846df53edeea0afdcb383fd4d8f.tar.gz gcc-4de4b0f267380846df53edeea0afdcb383fd4d8f.tar.bz2 |
re PR rtl-optimization/49145 (ICE in simplify_const_unary_operation, at simplify-rtx.c:1322)
gcc/
PR rtl-optimization/49145
* combine.c (make_compound_operation): Handle ZERO_EXTEND specially.
gcc/testsuite/
PR rtl-optimization/49145
From Ryan Mansfield
* gcc.c-torture/compile/pr49145.c: New test.
From-SVN: r174718
Diffstat (limited to 'gcc/combine.c')
-rw-r--r-- | gcc/combine.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/gcc/combine.c b/gcc/combine.c index 8af86f2..5b68bab 100644 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -7881,7 +7881,20 @@ make_compound_operation (rtx x, enum rtx_code in_code) code = GET_CODE (x); } - /* Now recursively process each operand of this operation. */ + /* Now recursively process each operand of this operation. We need to + handle ZERO_EXTEND specially so that we don't lose track of the + inner mode. */ + if (GET_CODE (x) == ZERO_EXTEND) + { + new_rtx = make_compound_operation (XEXP (x, 0), next_code); + tem = simplify_const_unary_operation (ZERO_EXTEND, GET_MODE (x), + new_rtx, GET_MODE (XEXP (x, 0))); + if (tem) + return tem; + SUBST (XEXP (x, 0), new_rtx); + return x; + } + fmt = GET_RTX_FORMAT (code); for (i = 0; i < GET_RTX_LENGTH (code); i++) if (fmt[i] == 'e') |