pr103523: Check for PLUS/MINUS support
authorJoel Hutton <joel.hutton@arm.com>
Fri, 10 Dec 2021 10:26:42 +0000 (10:26 +0000)
committerJoel Hutton <joel.hutton@arm.com>
Fri, 10 Dec 2021 10:28:01 +0000 (10:28 +0000)
commita5f65cf7ad640ae398eba7a45c712322ce841809
treeab066b3b66409b732938c03d21ac6c918132246e
parentdb184a3453b6fe810e2d9765ef8ed9028f96e968
pr103523: Check for PLUS/MINUS support

Check for PLUS_EXPR/MINUS_EXPR support in vectorizable_induction.
PR103523 is an ICE on valid code:

void d(float *a, float b, int c) {
    float e;
    for (; c; c--, e += b)
      a[c] = e;
}

This is due to not checking for PLUS_EXPR support, which is missing in
VNx2sf mode. This causes an ICE at expand time. This patch adds a check
for support in vectorizable_induction.

gcc/ChangeLog:

PR tree-optimization/103523
* tree-vect-loop.c (vectorizable_induction): Check for
PLUS_EXPR/MINUS_EXPR support.

gcc/testsuite/ChangeLog:

* gcc.target/aarch64/pr103523.c: New test.
gcc/testsuite/gcc.target/aarch64/pr103523.c [new file with mode: 0644]
gcc/tree-vect-loop.c