Commit c7148991 by Jakub Jelinek Committed by Jakub Jelinek

re PR debug/47991 (Var-tracking ICE on s390x *setmem_long insn)

	PR debug/47991
	* var-tracking.c (find_use_val): Return NULL for
	cui->sets && cui->store_p BLKmode MEMs.

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

From-SVN: r170759
parent 691a924b
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):
......
2011-03-07 Jakub Jelinek <jakub@redhat.com>
PR debug/47991
* gcc.dg/pr47991.c: New test.
2011-03-07 Jason Merrill <jason@redhat.com>
* g++.dg/abi/mangle46.C: New.
......
/* 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.
......@@ -4784,12 +4784,19 @@ find_use_val (rtx x, enum machine_mode mode, struct count_use_info *cui)
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;
......
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