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

            Bug ID: 123014
           Summary: [16 Regression] Recent change causes SSA graph
                    inconsistency
           Product: gcc
           Version: 16.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: law at gcc dot gnu.org
  Target Milestone: ---

This change:

commit 4a1247a3b070cdb02910826a5effb505457a6e73
Author: Tamar Christina <[email protected]>
Date:   Wed Dec 3 10:55:40 2025 +0000

    vect: delay identification of update_e until after skip_epilog [PR122959]

    The testcase attached in the PR shows that for some reason
    the test openmp_vv.sum when doing OpenMP offloading creates
    an intermediate empty block after the skip_epilog split.

    This means we should just simply delay setting update_e for
    the non-early break case.  For early break we have to do it
    early still otherwise the skip_epilog edge would make us find
    the wrong edge.

    I haven't been able to replicate this on a C testcase and the
    attached reduction works fine on AArch64 and x86_64 but have
    been able to verify the fixed code with

    ./gcc/f951 -fopenmp test2.f90 -O3 -o - -march=sm_30 on an

     --target=nvptx-none --enable-as-accelerator-for=x86_64-pc-linux-gnu

    configured cc1.

    If I manage to create a testcase will push it too.

    gcc/ChangeLog:

            PR middle-end/122959
            * tree-vect-loop-manip.cc (vect_do_peeling): Delay setting
update_e.

Causes an ICE for gcc.dg/pr95854.c on arc-elf.  Given it's an ICE you shouldn't
need a full cross environment to trigger.

root@276ff1154e08:/home/jlaw/jenkins/workspace/arc-elf/arc-elf-obj/gcc/gcc#
./cc1 -O3 pr95854.c -fno-vect-cost-model -fno-tree-scev-cprop  -quiet
pr95854.c: In function 'main':
pr95854.c:7:5: error: definition in block 18 does not dominate use in block 15
    7 | int main()
      |     ^~~~
for SSA_NAME: tmp.25_17 in statement:
_49 = PHI <_36(16), tmp.25_17(15)>
PHI argument
tmp.25_17
for PHI node
_49 = PHI <_36(16), tmp.25_17(15)>
during GIMPLE pass: vect
pr95854.c:7:5: internal compiler error: verify_ssa failed
0x26770dd internal_error(char const*, ...)
        ../../..//gcc/gcc/diagnostic-global-context.cc:787
0x17a2340 verify_ssa(bool, bool)
        ../../..//gcc/gcc/tree-ssa.cc:1203

Reply via email to