[Bug middle-end/21474] missed optimizations when comparing address to NULL

2023-06-25 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=21474 Andrew Pinski changed: What|Removed |Added Known to work||10.1.0, 9.1.0 Status|NEW

[Bug middle-end/21474] missed optimizations when comparing address to NULL

2007-11-15 Thread manu at gcc dot gnu dot org
--- Comment #3 from manu at gcc dot gnu dot org 2007-11-15 17:03 --- I think it is odd that if you call subr(i,0), it doesn't crash, that is &(p->a) does not actually dereferences p. Nonetheless, I agree that the behaviour seems inconsistent. A nice little project for someone. As they sa

[Bug middle-end/21474] missed optimizations when comparing address to NULL

2005-05-12 Thread trt at acm dot org
--- Additional Comments From trt at acm dot org 2005-05-12 15:08 --- I think it is reasonable to assume the address of an auto variable is non-NULL, and so the address of anything in the local "int x[10];" is non-NULL. So gcc can (and does) fold "if (x) ..." and "if (&x[0]) ..." gcc doe

[Bug middle-end/21474] missed optimizations when comparing address to NULL

2005-05-09 Thread pinskia at gcc dot gnu dot org
--- Additional Comments From pinskia at gcc dot gnu dot org 2005-05-09 17:26 --- Actually I don't think it is safe to fold any of these. -- What|Removed |Added Comp