]> gcc.gnu.org Git - gcc.git/commit
Fix ICE with cast of division by zero (PR c/93348).
authorJoseph Myers <joseph@codesourcery.com>
Wed, 22 Jan 2020 20:49:41 +0000 (20:49 +0000)
committerJakub Jelinek <jakub@redhat.com>
Thu, 17 Sep 2020 15:14:51 +0000 (17:14 +0200)
commitcd15f22c73a21f002c8d379b6d7613810fd94e8c
tree1272afd388cff5cc40c2f55f87dd9cf8a8abf921
parente35d467b59bceac2ba626f2262e3dc32009583c3
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)
gcc/c/ChangeLog
gcc/c/c-typeck.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/compile/pr93348-1.c [new file with mode: 0644]
This page took 0.066185 seconds and 6 git commands to generate.