--- Comment #6 from matz at gcc dot gnu dot org 2010-02-04 15:03 ---
Re comment #4, there are two possibilities to fix this:
1) as you say, don't regard MEM addresses (i.e. used in double indirection)
as const_or_frame_p, because that would put different (but runtime-same)
bases in
--- Comment #5 from zadeck at naturalbridge dot com 2010-02-04 14:57
---
Richi, you are, of course, correct.
kenny
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42952
--- Comment #4 from rguenth at gcc dot gnu dot org 2010-02-04 10:36 ---
The only addresses treated as the dse "constant" kind should be symbol-refs.
Or we need to lookup the constant initializer the constant mem refers to
and use that (but I have no idea if that's easily possible on RTL)
--- Comment #3 from rguenth at gcc dot gnu dot org 2010-02-04 10:33 ---
Well, dse puts
(mem/u/f/c/i:DI (symbol_ref:DI ("q") [flags 0x2] )
[0 q+0 S8 A64])
(mem/u/f/c/i:DI (symbol_ref:DI ("p") [flags 0x2] )
[0 p+0 S8 A64])
into different groups:
**scanning insn=9
cselib value 2 0x10f
--- Comment #2 from rguenth at gcc dot gnu dot org 2010-02-04 10:11 ---
dse1 deletes insn 7 in
(insn 7 6 8 2 t.c:11 (set (mem:SI (reg/f:DI 58 [ p.0 ]) [0 S4 A32])
(const_int 0 [0x0])) 47 {*movsi_1} (nil))
(insn 8 7 9 2 t.c:12 (set (reg/f:DI 63 [ q ])
(mem/u/f/c/i:DI (sy
--- Comment #1 from rguenth at gcc dot gnu dot org 2010-02-04 10:03 ---
Confirmed. Fails with -O -fno-tree-pta as well.
extern void abort (void);
static int g[1];
static int *p = &g[0];
static int *q = &g[0];
int main(void)
{
g[0] = 1;
*p = 0;
*p = *q;
if (g[0] != 0)
abo