/* { 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); } ICEs on s390x-linux in var-tracking, because (insn 56 71 57 5 (parallel [ (clobber (reg:TI 6 %r6)) (set (mem:BLK (subreg:DI (reg:TI 6 %r6) 0) [0 A8]) (reg:DI 10 %r10 [95])) (use (reg:TI 6 %r6)) (use (reg:TI 2 %r2)) (clobber (reg:CC 33 %cc)) ]) pr47372.i:9 115 {*setmem_long} (expr_list:REG_DEAD (reg:DI 10 %r10 [95]) (expr_list:REG_DEAD (reg:DI 7 %r7) (expr_list:REG_UNUSED (reg:CC 33 %cc) (expr_list:REG_UNUSED (reg:TI 6 %r6) (nil)))))) is really weird. But we already allow (set (mem:BLK ...) (const_int ...)) for memset, and while this one is much worse than that, let's workaround it in var-tracking too. Not sure if this is a problem in 4.5 too, certainly not in 4.4 which didn't have VTA.
Created attachment 23545 [details] gcc46-pr47991.patch Untested fix.
Author: jakub Date: Mon Mar 7 22:11:55 2011 New Revision: 170759 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=170759 Log: 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. Added: trunk/gcc/testsuite/gcc.dg/pr47991.c Modified: trunk/gcc/ChangeLog trunk/gcc/testsuite/ChangeLog trunk/gcc/var-tracking.c
Fixed.