rs6000: Fix an assertion in update_target_cost_per_stmt [PR103702]
authorKewen Lin <linkw@linux.ibm.com>
Thu, 27 Jan 2022 09:46:28 +0000 (03:46 -0600)
committerKewen Lin <linkw@linux.ibm.com>
Thu, 27 Jan 2022 10:36:27 +0000 (04:36 -0600)
commit2022be54daf638885e1e685afd36619cb4b01a93
treec4e7172d651aaed7eeefbf1d330048eed4ebb7f3
parent1c91b014923f418e0aab789c5cf57facf04bf266
rs6000: Fix an assertion in update_target_cost_per_stmt [PR103702]

This patch is to fix one wrong assertion which is too aggressive.
Vectorizer can do vec_construct costing for the vector type which
only has one unit.  For the failed case, the passed in vector type
is "vector(1) int", though it doesn't end up with any construction
eventually, we have to handle this kind of possibility.

gcc/ChangeLog:

PR target/103702
* config/rs6000/rs6000.cc
(rs6000_cost_data::update_target_cost_per_stmt): Fix one wrong
assertion with early return.

gcc/testsuite/ChangeLog:

PR target/103702
* gcc.target/powerpc/pr103702.c: New test.
gcc/config/rs6000/rs6000.cc
gcc/testsuite/gcc.target/powerpc/pr103702.c [new file with mode: 0644]