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

            Bug ID: 116139
           Summary: [15 Regression] ICE with --param fully-pipelined-fma=1
           Product: gcc
           Version: 15.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ktkachov at gcc dot gnu.org
  Target Milestone: ---
            Target: aarch64

The testcase gcc.dg/pr110279-2.c ICEs when compiled with -Ofast
-mcpu=neoverse-v2 --param fully-pipelined-fma=1

during GIMPLE pass: reassoc
ice.c: In function ‘foo’:
ice.c:10:1: internal compiler error: in get_reassociation_width, at
tree-ssa-reassoc.cc:5520
   10 | foo (data_e in)
      | ^~~
0x20eab57 internal_error(char const*, ...)
        $SRC/gcc/diagnostic-global-context.cc:491
0x7b014f fancy_abort(char const*, int, char const*)
        $SRC/gcc/diagnostic.cc:1725
0x118eefb get_reassociation_width
        $SRC/gcc/tree-ssa-reassoc.cc:5520
0x11a047b reassociate_bb
        $SRC/gcc/tree-ssa-reassoc.cc:7223
0x119fda7 reassociate_bb
        $SRC/gcc/tree-ssa-reassoc.cc:7277
0x119fda7 reassociate_bb
        $SRC/gcc/tree-ssa-reassoc.cc:7277
0x11a2b27 do_reassoc
        $SRC/gcc/tree-ssa-reassoc.cc:7389
0x11a2b27 execute_reassoc
        $SRC/gcc/tree-ssa-reassoc.cc:7479
0x11a2b27 execute
        $SRC/gcc/tree-ssa-reassoc.cc:7520
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

It hits the assert at:
5512      Find out if we can get a smaller width considering FMA.  */
5513   if (width > 1 && mult_num && param_fully_pipelined_fma)
5514     {
5515       /* When param_fully_pipelined_fma is set, assume FMUL and FMA use
the
5516          same units that can also do FADD.  For other scenarios, such as
when
5517          FMUL and FADD are using separated units, the following code may
not
5518          appy.  */
5519       int width_mult = targetm.sched.reassociation_width (MULT_EXPR,
mode);
5520       gcc_checking_assert (width_mult <= width);

I think this shouldn't be an assert but rather a condition in the if statement
on line 5513?

Reply via email to