https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103192

--- Comment #15 from Andrew Macleod <amacleod at redhat dot com> ---
I added a series of vrp passes to see when things go amok.

immediately before DOM3, we see:

 <bb 1416> [local count: 22683134]:
  if (outer_ctx_1389 != 0B)
    goto <bb 1417>; [70.00%]
  else
    goto <bb 1420>; [30.00%]

  <bb 1417> [local count: 37567381]:
  _784 = omp_clause_range_check (c_3171, 5, 7,
"/home/aldyh/src/gcc/gcc/gimplify.c", 10070, "gimplify_scan_omp_clauses");
  _785 = omp_clause_elt_check (_784, 3, "/home/aldyh/src/gcc/gcc/gimplify.c",
10070, "gimplify_scan_omp_clauses");
  _786 = *_785;
  omp_add_variable (iftmp.2373_1515, _786, 129);

and outer_ctx_1389 is varying, so we cannot fold anything,and we know:
iftmp.2373_1515  : struct gimplify_omp_ctx * [1B, +INF]

then DOM3 runs, and transforms this into:
  <bb 1415> [local count: 22683134]:
  if (iftmp.2373_1515 != 0B)
    goto <bb 1416>; [70.00%]
  else
    goto <bb 1419>; [30.00%]

  <bb 1416> [local count: 37567381]:
  _784 = omp_clause_range_check (c_3171, 5, 7,
"/home/aldyh/src/gcc/gcc/gimplify.c", 10070, "gimplify_scan_omp_clauses");
  _785 = omp_clause_elt_check (_784, 3, "/home/aldyh/src/gcc/gcc/gimplify.c",
10070, "gimplify_scan_omp_clauses");
  _786 = *_785;
  omp_add_variable (iftmp.2373_1515, _786, 129);


which is going to clearly cause problems when VRP knows that iftmp.2373_151 is
non-null...  

So it looks like this transformation is the problematic one for sure.

Reply via email to