+2011-03-07 Jakub Jelinek <jakub@redhat.com>
+
+ PR debug/47991
+ * var-tracking.c (find_use_val): Return NULL for
+ cui->sets && cui->store_p BLKmode MEMs.
+
2011-03-07 Anatoly Sokolov <aesok@post.ru>
* config/stormy16/stormy16.h (PRINT_OPERAND, PRINT_OPERAND_ADDRESS):
--- /dev/null
+/* PR debug/47991 */
+/* { dg-do compile } */
+/* { dg-options "-g -Os" } */
+
+typedef __SIZE_TYPE__ size_t;
+extern inline __attribute__ ((__always_inline__))
+void *
+memset (void *x, int y, size_t z)
+{
+ return __builtin___memset_chk (x, y, z, __builtin_object_size (x, 0));
+}
+
+void
+foo (unsigned char *x, unsigned char *y, unsigned char *z,
+ unsigned char *w, unsigned int v, int u, int t)
+{
+ int i;
+ for (i = 0; i < t; i++)
+ {
+ memset (z, x[0], v);
+ memset (w, y[0], v);
+ x += u;
+ }
+ __builtin_memcpy (z, x, u);
+}
/* Variable tracking routines for the GNU compiler.
- Copyright (C) 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010
+ Copyright (C) 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010, 2011
Free Software Foundation, Inc.
This file is part of GCC.
if (cui->sets)
{
/* This is called after uses are set up and before stores are
- processed bycselib, so it's safe to look up srcs, but not
+ processed by cselib, so it's safe to look up srcs, but not
dsts. So we look up expressions that appear in srcs or in
dest expressions, but we search the sets array for dests of
stores. */
if (cui->store_p)
{
+ /* Some targets represent memset and memcpy patterns
+ by (set (mem:BLK ...) (reg:[QHSD]I ...)) or
+ (set (mem:BLK ...) (const_int ...)) or
+ (set (mem:BLK ...) (mem:BLK ...)). Don't return anything
+ in that case, otherwise we end up with mode mismatches. */
+ if (mode == BLKmode && MEM_P (x))
+ return NULL;
for (i = 0; i < cui->n_sets; i++)
if (cui->sets[i].dest == x)
return cui->sets[i].src_elt;