[Bug c/93348] [8/9 Regression] ICE in gimplify_expr, at gimplify.c:14378

cvs-commit at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Jan 22 20:51:00 GMT 2020


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

--- Comment #7 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-8 branch has been updated by Joseph Myers <jsm28@gcc.gnu.org>:

https://gcc.gnu.org/g:7ec6673ada331b9eed0771875e58881049ec6915

commit r8-9948-g7ec6673ada331b9eed0771875e58881049ec6915
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Wed Jan 22 20:49:41 2020 +0000

    Fix ICE with cast of division by zero (PR c/93348).

    Bug 93348 reports an ICE on certain cases of casts of expressions that
    may appear only in unevaluated parts of integer constant expressions,
    arising from the generation of nested C_MAYBE_CONST_EXPRs.  This patch
    fixes it by adding a call to remove_c_maybe_const_expr in the
    integer-operands case, as is done in other similar cases.

    Bootstrapped with no regressions for x86_64-pc-linux-gnu.

        PR c/93348
    gcc/c:
        * c-typeck.c (build_c_cast): Call remove_c_maybe_const_expr on
        argument with integer operands.

    gcc/testsuite:
        * gcc.c-torture/compile/pr93348-1.c: New test.

    (cherry picked from commit ac68e287fc2e939ae6b45ba7ff04e493982b7f62)


More information about the Gcc-bugs mailing list