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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
           Keywords|                            |missed-optimization
   Last reconfirmed|                            |2024-08-19
     Ever confirmed|0                           |1
                 CC|                            |hubicka at gcc dot gnu.org

--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> ---
The issue is that get_val() might not return so that function can be called
three times without a->a[2] then invoking undefined behavior.  The unroller
lacks placing of gcc_unreachable () before such references.  That's a
missed optimization that in turn causes these kind of issues.

I think we have plenty of duplicates of this underlying issue.

Honza might know if it is possible to place additional unreachables for the
recorded bounds in the last copied iteration.

Reply via email to