PR tree-optimization/77901
* tree-ssa-reassoc.c (optimize_range_tests_var_bound): Only optimize
if ranges[i].exp is SSA_NAME when looking for >= and only when
ranges[i].exp is NULL or SSA_NAME when looking for the other
comparison.
* gcc.c-torture/compile/pr77901.c: New test.
From-SVN: r240899
+2016-10-09 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/77901
+ * tree-ssa-reassoc.c (optimize_range_tests_var_bound): Only optimize
+ if ranges[i].exp is SSA_NAME when looking for >= and only when
+ ranges[i].exp is NULL or SSA_NAME when looking for the other
+ comparison.
+
2016-10-09 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org>
* ipa-cp.c (ipcp_alignment_lattice): Remove.
+2016-10-09 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/77901
+ * gcc.c-torture/compile/pr77901.c: New test.
+
2016-10-09 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org>
* gcc.dg/ipa/propalign-1.c: Adjust scan-ipa-dump.
--- /dev/null
+/* PR tree-optimization/77901 */
+
+void bar (void);
+
+void
+foo (int *x, long *y)
+{
+ if (*y && *x != 10 && *x != 12 && *y >= 0)
+ bar ();
+}
for (i = first; i < length; i++)
{
- if (ranges[i].exp == NULL_TREE || !ranges[i].in_p)
+ if (ranges[i].exp == NULL_TREE
+ || TREE_CODE (ranges[i].exp) != SSA_NAME
+ || !ranges[i].in_p)
continue;
tree type = TREE_TYPE (ranges[i].exp);
tree rhs1, rhs2;
if (ranges[i].exp)
{
+ if (TREE_CODE (ranges[i].exp) != SSA_NAME)
+ continue;
stmt = SSA_NAME_DEF_STMT (ranges[i].exp);
if (!is_gimple_assign (stmt))
continue;