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

            Bug ID: 125953
           Summary: [13/14/15/16/17 Regression] vect_recog_divmod_pattern
                    uses ranger on pattern stmts
           Product: gcc
           Version: 15.3.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: rguenth at gcc dot gnu.org
                CC: amacleod at redhat dot com
  Target Milestone: ---
            Target: aarch64

Building firefox on aarch64 with -march=armv9-a results in

during GIMPLE pass: vect
In file included from Unified_cpp_image_decoders0.cpp:65:
../../../firefox-152.0.1/image/decoders/nsJXLDecoder.cpp: In member function
‘bool mozilla::image::nsJXLDecoder::WritePixelRowsToPipe()’:
../../../firefox-152.0.1/image/decoders/nsJXLDecoder.cpp:578:6: internal
compiler error: Segmentation fault
0x3403d7e internal_error(char const*, ...)
        /space/rguenther/src/gcc-15-branch/gcc/diagnostic-global-context.cc:517
0x1a2a777 crash_signal
        /space/rguenther/src/gcc-15-branch/gcc/toplev.cc:322
0x14476fd get_immediate_dominator(cdi_direction, basic_block_def*)
        /space/rguenther/src/gcc-15-branch/gcc/dominance.cc:859
0x2ff4dfc ranger_cache::range_from_dom(vrange&, tree_node*, basic_block_def*,
ranger_cache::rfd_mode)
        /space/rguenther/src/gcc-15-branch/gcc/gimple-range-cache.cc:1730
0x2ff3faa ranger_cache::fill_block_cache(tree_node*, basic_block_def*,
basic_block_def*)
        /space/rguenther/src/gcc-15-branch/gcc/gimple-range-cache.cc:1486
...
0x2ff95fe fold_using_range::fold_stmt(vrange&, gimple*, fur_source&,
tree_node*)
        /space/rguenther/src/gcc-15-branch/gcc/gimple-range-fold.cc:648
0x2fed54b gimple_ranger::fold_range_internal(vrange&, gimple*, tree_node*)
        /space/rguenther/src/gcc-15-branch/gcc/gimple-range.cc:277
0x2fed871 gimple_ranger::range_of_stmt(vrange&, gimple*, tree_node*)
        /space/rguenther/src/gcc-15-branch/gcc/gimple-range.cc:338

because we do

#32 0x00000000031abb4f in vect_recog_divmod_pattern (vinfo=0x69a0e50, 
    stmt_vinfo=0x52f73f0, type_out=0x7fffffffc1e8)
    at /space/rguenther/src/gcc-15-branch/gcc/tree-vect-patterns.cc:4993
4993              if (ranger.range_of_expr (r, oprnd0, stmt) && !r.undefined_p
())
(gdb) p debug_tree (oprnd0)
 <ssa_name 0x7fffb1bd8900
    type <integer_type 0x7fffdd806000 public unsigned HI
        size <integer_cst 0x7ffff681b3f0 constant 16>
        unit-size <integer_cst 0x7ffff681b408 constant 2>
        align:16 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
0x7fffdd806000 precision:16 min <integer_cst 0x7fffddbf1900 0> max <integer_cst
0x7fffddb84c90 65535>
        pointer_to_this <pointer_type 0x7fffbd356e70>>

    def_stmt patt_356 = patt_353 * patt_355;
    version:356>


The above happens with the testcase I have only on the 15 branch.  I'm
currently reducing it.  I didn't try the 13 or 14 branches but we do the
same there.  I'm not sure if we put any mitigation into ranger for stmts
not in the IL, did we?

Reply via email to