Commit 6a866023 by Jakub Jelinek Committed by Jakub Jelinek

re PR middle-end/44337 (ICE: in expand_assignment, at expr.c:4276)

	PR middle-end/44337
	* expr.c (expand_assignment): Don't store anything for out-of-bounds
	array accesses with non-MEM.

	* gcc.dg/pr44337.c: New test.

From-SVN: r160076
parent 90a7788b
2010-05-31 Jakub Jelinek <jakub@redhat.com> 2010-05-31 Jakub Jelinek <jakub@redhat.com>
PR middle-end/44337
* expr.c (expand_assignment): Don't store anything for out-of-bounds
array accesses with non-MEM.
PR tree-optimization/44182 PR tree-optimization/44182
* tree-inline.c (copy_edges_for_bb): Don't split bb if a stmt that * tree-inline.c (copy_edges_for_bb): Don't split bb if a stmt that
newly needs to end a bb is followed by debug stmts, instead return newly needs to end a bb is followed by debug stmts, instead return
......
...@@ -4268,8 +4268,19 @@ expand_assignment (tree to, tree from, bool nontemporal) ...@@ -4268,8 +4268,19 @@ expand_assignment (tree to, tree from, bool nontemporal)
offset)); offset));
} }
/* No action is needed if the target is not a memory and the field
lies completely outside that target. This can occur if the source
code contains an out-of-bounds access to a small array. */
if (!MEM_P (to_rtx)
&& GET_MODE (to_rtx) != BLKmode
&& (unsigned HOST_WIDE_INT) bitpos
>= GET_MODE_BITSIZE (GET_MODE (to_rtx)))
{
expand_normal (from);
result = NULL;
}
/* Handle expand_expr of a complex value returning a CONCAT. */ /* Handle expand_expr of a complex value returning a CONCAT. */
if (GET_CODE (to_rtx) == CONCAT) else if (GET_CODE (to_rtx) == CONCAT)
{ {
if (COMPLEX_MODE_P (TYPE_MODE (TREE_TYPE (from)))) if (COMPLEX_MODE_P (TYPE_MODE (TREE_TYPE (from))))
{ {
......
2010-05-31 Jakub Jelinek <jakub@redhat.com> 2010-05-31 Jakub Jelinek <jakub@redhat.com>
PR middle-end/44337
* gcc.dg/pr44337.c: New test.
PR tree-optimization/44182 PR tree-optimization/44182
* g++.dg/debug/pr44182.C: New test. * g++.dg/debug/pr44182.C: New test.
......
/* PR middle-end/44337 */
/* { dg-do compile } */
/* { dg-options "-O -fno-tree-dce -fno-tree-dse -w" } */
void
foo (void)
{
_Complex float v[1];
v[1] = 0;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment