]> git.ipfire.org Git - thirdparty/gcc.git/commit
Fix ICE in vectorizable_nonlinear_induction with bitfield.
authorliuhongt <hongtao.liu@intel.com>
Mon, 13 Nov 2023 09:56:49 +0000 (17:56 +0800)
committerliuhongt <hongtao.liu@intel.com>
Tue, 14 Nov 2023 23:52:57 +0000 (07:52 +0800)
commited73ad337739a4244e8040d19b6e567c4101b58a
tree5847475fcf7911249b05d8424dc50108b7f2f995
parent16635b89f36c07b9e06c48a93d1bfafa93178328
Fix ICE in vectorizable_nonlinear_induction with bitfield.

 if (TREE_CODE (init_expr) == INTEGER_CST)
    init_expr = fold_convert (TREE_TYPE (vectype), init_expr);
  else
    gcc_assert (tree_nop_conversion_p (TREE_TYPE (vectype),
                                       TREE_TYPE (init_expr)));

and init_expr is a 24 bit integer type while vectype has 32bit components.

The "fix" is to bail out instead of asserting.

gcc/ChangeLog:

PR tree-optimization/112496
* tree-vect-loop.cc (vectorizable_nonlinear_induction): Return
false when !tree_nop_conversion_p (TREE_TYPE (vectype),
TREE_TYPE (init_expr)).

gcc/testsuite/ChangeLog:

* gcc.target/i386/pr112496.c: New test.

(cherry picked from commit f28306b4fd309b579c8a4a5bf2f1b24fa40f8f7f)
gcc/testsuite/gcc.target/i386/pr112496.c [new file with mode: 0644]
gcc/tree-vect-loop.cc