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
* 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
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. */
- if (GET_CODE (to_rtx) == CONCAT)
+ else if (GET_CODE (to_rtx) == CONCAT)
{
if (COMPLEX_MODE_P (TYPE_MODE (TREE_TYPE (from))))
{
2010-05-31 Jakub Jelinek <jakub@redhat.com>
+ PR middle-end/44337
+ * gcc.dg/pr44337.c: New test.
+
PR tree-optimization/44182
* g++.dg/debug/pr44182.C: New test.
--- /dev/null
+/* 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;
+}