On 6/25/24 12:52, Tamar Christina wrote:
The 06/25/2024 17:10, Jason Merrill wrote:
On 6/25/24 04:01, Tamar Christina wrote:
Hi All,
It looks like I forgot to check in the C++ frontend if a condition exist for the
loop being adorned with novector. This causes a segfault because cond isn't
expected to be null.
This fixes it by issuing the same kind of diagnostics we issue for the other
pragmas.
Bootstrapped Regtested on aarch64-none-linux-gnu and no issues.
Ok for master? and backport to GCC-14?
Hmm, I'm not sure we want to error in this case; it's pointless, but
indeed we aren't going to vectorize a loop that always loops. I'd think
we should treat it the same as an explicit "true" condition. And
perhaps the same for unroll/ivdep.
Does the C front-end treat the null condition different from a constant
true condition?
No, in the C front-end we error for ivdep and unroll, but for novector we
explicitly
suppress it by checking for novector && cond && cond != error_mark_node instead
of
just novector && cond != error_mark_node in the use site.
Do you want to handle it that way to be consistent?
Please.
Jason