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

Tamar Christina <tnfchris at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2025-10-01
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1
                 CC|                            |tnfchris at gcc dot gnu.org

--- Comment #2 from Tamar Christina <tnfchris at gcc dot gnu.org> ---
Started with

g:5596572b6bf72031de888301ebfe8e984df04dc9 is the first bad commit
commit 5596572b6bf72031de888301ebfe8e984df04dc9
Author: Andrew Pinski <[email protected]>
Date:   Sat Oct 26 02:14:18 2024 -0700

    tree: Mark PAREN_EXPR and VEC_DUPLICATE_EXPR as non-trapping [PR117234]

    While looking to fix a possible trapping issue in PHI-OPT's factor,
    I noticed that some tree codes could be marked as trapping even
    though they don't have a possibility to trap. In the case of PAREN_EXPR,
    it is basically a nop except when it comes to association across it so
    it can't trap.
    In the case of VEC_DUPLICATE_EXPR, it is similar to a CONSTRUCTOR, so it
    can't trap.

    This fixes those 2 issues and adds 4 testcases, 2 which are specific to
aarch64
    since the only way to get a VEC_DUPLICATE_EXPR is to use intrinsics
currently.

Note that __builtin_sqrt is correctly marked as trapping. So this doesn't
vectorize.

void f (float *c, int n)
{
    for (int i = 0; i < n; i++)
      c[i] = __builtin_sqrt (c[i]);
}

unless at -Ofast.

clearly something is confusing gimple_could_trap_p as it didn't mask the
operation.

Reply via email to