]> git.ipfire.org Git - thirdparty/gcc.git/commit
fold: Change comparison of error_mark_node to use error_operand_p in tree_expr_nonneg...
authorAndrew Pinski <quic_apinski@quicinc.com>
Thu, 3 Jul 2025 18:58:50 +0000 (11:58 -0700)
committerAndrew Pinski <quic_apinski@quicinc.com>
Fri, 4 Jul 2025 15:28:31 +0000 (08:28 -0700)
commitf24015a4c2ca6d6fbbf7090004b3a83081f18f03
treef154ea8d7e47cc86533f611a3ed52d06da6aaaa3
parent36d33ce0f9febdfbed3fbb8802905a51ea897954
fold: Change comparison of error_mark_node to use error_operand_p in tree_expr_nonnegative_warnv_p [PR118948]

This is an obvious fix for this small regression. Basically after r15-328-g5726de79e2154a,
there is a call to tree_expr_nonnegative_warnv_p where the type of the expression is now
error_mark_node. Though there was only a check if the expression was error_mark_node.

Bootstrapped and tested on x86_64-linux-gnu.

PR c/118948

gcc/ChangeLog:

* fold-const.cc (tree_expr_nonnegative_warnv_p): Use
error_operand_p instead of checking for error_mark_node directly.

gcc/testsuite/ChangeLog:

* gcc.dg/pr118948-1.c: New test.

Signed-off-by: Andrew Pinski <quic_apinski@quicinc.com>
gcc/fold-const.cc
gcc/testsuite/gcc.dg/pr118948-1.c [new file with mode: 0644]