View | Details | Return to bug 108166
Collapse All | Expand All

(-)gcc/tree-ssa-phiopt.cc.jj (+6 lines)
Lines 1491-1496 value_replacement (basic_block cond_bb, Link Here
1491
		  default:
1491
		  default:
1492
		    break;
1492
		    break;
1493
		  }
1493
		  }
1494
	      if (equal_p)
1495
		/* After the optimization PHI result can have value
1496
		   which it couldn't have previously.
1497
		   We could instead of resetting it union the range
1498
		   info with oarg.  */
1499
		reset_flow_sensitive_info (gimple_phi_result (phi));
1494
	      if (equal_p && MAY_HAVE_DEBUG_BIND_STMTS)
1500
	      if (equal_p && MAY_HAVE_DEBUG_BIND_STMTS)
1495
		{
1501
		{
1496
		  imm_use_iterator imm_iter;
1502
		  imm_use_iterator imm_iter;
(-)gcc/testsuite/g++.dg/torture/pr108166.C.jj (+26 lines)
Line 0 Link Here
1
// PR tree-optimization/108166
2
// { dg-do run }
3
4
bool a, b;
5
int d, c;
6
7
const int &
8
foo (const int &f, const int &g)
9
{
10
  return !f ? f : g;
11
}
12
13
__attribute__((noipa)) void
14
bar (int)
15
{
16
}
17
18
int
19
main ()
20
{
21
  c = foo (b, 0) > ((b ? d : b) ?: 8);
22
  a = b ? d : b;
23
  bar (a);
24
  if (a != 0)
25
    __builtin_abort ();
26
}

Return to bug 108166