------- Comment #5 from rguenth at gcc dot gnu dot org 2006-02-22 12:47 ------- Of course we have the other case where we _have_ to propagate to optimize away the test (gcc.dg/tree-ssa/20030807-2.c):
foo(int n) { int *space = (int *)__builtin_alloca (n); if (space == 0) abort (); else bar (space); } where there is a 2nd use of space: foo (n) { int * space; void * D.1899; long unsigned int D.1898; <bb 2>: D.1898_2 = (long unsigned int) n_1; D.1899_3 = __builtin_alloca (D.1898_2); space_4 = (int *) D.1899_3; if (space_4 == 0B) goto <L0>; else goto <L1>; <L0>:; abort (); <L1>:; bar (space_4); return; } So I think extending VRP is the only way to get both testcases optimized. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26406