From ab669042dc81955b888dd05ab9ff23a4b7e8c8ba Mon Sep 17 00:00:00 2001 From: Uros Bizjak Date: Tue, 11 Mar 2008 13:47:29 +0100 Subject: [PATCH] re PR c/35526 (ICE on memcpy) PR middle-end/35526 * expr.c (store_expr): Call emit_block_move if the mode of "temp" RTX is BLKmode. testsuite/ChangeLog: PR middle-end/35526 * g++.dg/torture/pr35526.C: New test. From-SVN: r133106 --- gcc/ChangeLog | 12 +++++++++--- gcc/expr.c | 3 ++- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/g++.dg/torture/pr35526.C | 18 ++++++++++++++++++ 4 files changed, 34 insertions(+), 4 deletions(-) create mode 100644 gcc/testsuite/g++.dg/torture/pr35526.C diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 3dae5cd52d8..a2e4e20450d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,11 @@ +2008-03-11 Uros Bizjak + + PR middle-end/35526 + * expr.c (store_expr): Call emit_block_move if the mode + of "temp" RTX is BLKmode. + 2008-03-11 Andrew Pinski - Richard Guenther + Richard Guenther PR tree-optimization/31358 * tree-ssa-loop-manip.c (create_iv): Call force_gimple_operand for @@ -63,7 +69,7 @@ to avoid conflicts. 2008-03-10 Paul Brook - Mark Shinwell + Mark Shinwell * config/arm/cortex-r4.md: New. * config/arm/thumb2.md (divsi3, udivsi3): Annotate with @@ -578,7 +584,7 @@ __absvsi2, __absvDI2): Use unsigned arithmetic. 2008-03-02 Andi Kleen - Richard Guenther + Richard Guenther * struct-equiv.c: Remove file. * cfg_cleanup.c (condjump_equiv_p): Remove. diff --git a/gcc/expr.c b/gcc/expr.c index 2cd6e627843..300b63d8816 100644 --- a/gcc/expr.c +++ b/gcc/expr.c @@ -4654,7 +4654,8 @@ store_expr (tree exp, rtx target, int call_param_p, bool nontemporal) temp = convert_to_mode (GET_MODE (target), temp, unsignedp); emit_move_insn (target, temp); } - else if (GET_MODE (target) == BLKmode) + else if (GET_MODE (target) == BLKmode + || GET_MODE (temp) == BLKmode) emit_block_move (target, temp, expr_size (exp), (call_param_p ? BLOCK_OP_CALL_PARM diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index ad3523e5ecf..9d17b5b5569 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2008-03-11 Uros Bizjak + + PR middle-end/35526 + * g++.dg/torture/pr35526.C: New test. + 2008-03-10 Jakub Jelinek PR c++/35328 diff --git a/gcc/testsuite/g++.dg/torture/pr35526.C b/gcc/testsuite/g++.dg/torture/pr35526.C new file mode 100644 index 00000000000..d0a8e6d2c2f --- /dev/null +++ b/gcc/testsuite/g++.dg/torture/pr35526.C @@ -0,0 +1,18 @@ +/* { dg-do compile } */ + +extern void *memcpy (void *__dest, __const void *__src, __SIZE_TYPE__ __n); + +char internal_crash_read_ip[] = { 0xb8 }; + +struct u_internal_crash_read_t +{ + char ip[sizeof (internal_crash_read_ip)]; +} +u_internal_crash_read; + +void +gSignalHandler (int psignalNr, int pinfo, int pctx) +{ + memcpy (u_internal_crash_read.ip, internal_crash_read_ip, + sizeof (internal_crash_read_ip)); +} -- 2.30.2