#include "calls.h"
#include "value-query.h"
#include "cfganal.h"
+#include "tree-eh.h"
#include "gimple-predicate-analysis.h"
}
/* Get the conditional controlling the bb exit edge. */
gimple *cond_stmt = gsi_stmt (gsi);
- if (is_gimple_call (cond_stmt) && EDGE_COUNT (e->src->succs) >= 2)
- /* Ignore EH edge. Can add assertion on the other edge's flag. */
- continue;
/* Skip this edge if it is bypassing an abort - when the
condition is not satisfied we are neither reaching the
definition nor the use so it isn't meaningful. Note if
has_valid_pred = true;
}
}
+ else if (stmt_can_throw_internal (cfun, cond_stmt)
+ && !(e->flags & EDGE_EH))
+ /* Ignore the exceptional control flow and proceed as if
+ E were a fallthru without a controlling predicate for
+ both the USE (valid) and DEF (questionable) case. */
+ has_valid_pred = true;
else
{
- /* Disabled. See PR 90994.
- has_valid_pred = false; */
+ has_valid_pred = false;
break;
}
}
--- /dev/null
+// { dg-do compile }
+// { dg-additional-options "-fnon-call-exceptions -Wuninitialized" }
+
+extern void printval(unsigned char v);
+
+inline int readbyte(unsigned char *__restrict presult,
+ unsigned char volatile *ptr)
+{
+ unsigned char v;
+ try {
+ v = *ptr;
+ } catch (...) {
+ return -1;
+ }
+ *presult = v;
+ return 0;
+}
+
+int incorrectWarning(unsigned char volatile *ptr)
+{
+ int error;
+ unsigned char first;
+ unsigned char second;
+
+ error = readbyte(&first, ptr);
+ asm("\n\n\n\n\n" : : "X" (error != 0));
+ if (error != 0)
+ goto err;
+
+ error = readbyte(&second, ptr);
+ if (error != 0)
+ goto err;
+
+ printval(first); // { dg-bogus "uninitialized" }
+ printval(second);
+ return 0;
+
+err:
+ return error;
+}