case BRS_FALSE:
// If the result is false, the only time we know anything is
// if OP2 is a constant.
- if (wi::eq_p (op2.lower_bound(), op2.upper_bound()))
+ if (!op2.undefined_p ()
+ && wi::eq_p (op2.lower_bound(), op2.upper_bound()))
{
r = op2;
r.invert ();
case BRS_TRUE:
// If the result is true, the only time we know anything is if
// OP2 is a constant.
- if (wi::eq_p (op2.lower_bound(), op2.upper_bound()))
+ if (!op2.undefined_p ()
+ && wi::eq_p (op2.lower_bound(), op2.upper_bound()))
{
r = op2;
r.invert ();
const irange &op2,
relation_trio) const
{
+ if (op2.undefined_p ())
+ return false;
+
switch (get_bool_state (r, lhs, type))
{
case BRS_TRUE:
const irange &op1,
relation_trio) const
{
+ if (op1.undefined_p ())
+ return false;
+
switch (get_bool_state (r, lhs, type))
{
case BRS_TRUE:
const irange &op2,
relation_trio) const
{
+ if (op2.undefined_p ())
+ return false;
+
switch (get_bool_state (r, lhs, type))
{
case BRS_TRUE:
const irange &op1,
relation_trio) const
{
+ if (op1.undefined_p ())
+ return false;
+
switch (get_bool_state (r, lhs, type))
{
case BRS_TRUE:
const irange &lhs, const irange &op2,
relation_trio) const
{
+ if (op2.undefined_p ())
+ return false;
+
switch (get_bool_state (r, lhs, type))
{
case BRS_TRUE:
const irange &op1,
relation_trio) const
{
+ if (op1.undefined_p ())
+ return false;
+
switch (get_bool_state (r, lhs, type))
{
case BRS_TRUE:
const irange &op2,
relation_trio) const
{
+ if (op2.undefined_p ())
+ return false;
+
switch (get_bool_state (r, lhs, type))
{
case BRS_TRUE:
const irange &op1,
relation_trio) const
{
+ if (op1.undefined_p ())
+ return false;
+
switch (get_bool_state (r, lhs, type))
{
case BRS_TRUE:
--- /dev/null
+// PR tree-optimization/108647
+// { dg-do compile }
+
+bool a;
+int b, c;
+
+inline const bool &
+foo (bool &e, const bool &f)
+{
+ return f < e ? f : e;
+}
+
+void
+bar (signed char e, bool *f, bool *h, bool *g)
+{
+ for (;;)
+ if (g)
+ for (signed char j = 0; j < 6;
+ j += ((f[0] & c ? g[0] : int(0 >= e))
+ ? 0 : foo (g[0], g[0] > h[0]) + 1))
+ {
+ a = 0;
+ b = 0;
+ }
+}