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

--- Comment #2 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jakub Jelinek <ja...@gcc.gnu.org>:

https://gcc.gnu.org/g:df1cd90e32bb17d34f5fdce99bd0377fe1b8e5c6

commit r14-8277-gdf1cd90e32bb17d34f5fdce99bd0377fe1b8e5c6
Author: Jakub Jelinek <ja...@redhat.com>
Date:   Fri Jan 19 10:00:51 2024 +0100

    gimple-ssa-warn-restrict: Only use type range from NOP_EXPR for
non-narrowing conversions [PR113463]

    builtin_memref::extend_offset_range when it sees a NOP_EXPR from
    INTEGRAL_TYPE (to INTEGRAL_TYPE of sizetype/ptrdifftype precision
    given the callers) uses wi::to_offset on TYPE_{MIN,MAX}_VALUE
    of the rhs1 type.  This ICEs with large BITINT_TYPEs - to_offset
    is only supported for precisions up to the offset_int precision
    - but it even doesn't make any sense to do such thing for narrowing
    conversions, their range means the whole sizetype/ptrdifftype range
    and so the normal handling done later on (largest sized supported object)
    is the way to go in that case.

    So, the following patch just restrict this to non-narrowing conversions.

    2024-01-19  Jakub Jelinek  <ja...@redhat.com>

            PR tree-optimization/113463
            * gimple-ssa-warn-restrict.cc
(builtin_memref::extend_offset_range):
            Only look through NOP_EXPRs if rhs1 doesn't have wider type than
            lhs.

            * gcc.dg/bitint-74.c: New test.

Reply via email to