From: Jason Merrill Date: Wed, 21 Dec 2022 02:06:09 +0000 (-0500) Subject: fold: fix use of protected_set_expr_location_unshare X-Git-Tag: basepoints/gcc-14~2394 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ef0abcbc400e0ecb8ed1ddf61d96f8f3f88fe63b;p=thirdparty%2Fgcc.git fold: fix use of protected_set_expr_location_unshare Unlike protected_set_expr_location, this variant can return a different tree. gcc/ChangeLog: * fold-const.cc (fold_convert_loc): Check return value of protected_set_expr_location_unshare. --- diff --git a/gcc/fold-const.cc b/gcc/fold-const.cc index 42547f433ed9..00e2af0680cf 100644 --- a/gcc/fold-const.cc +++ b/gcc/fold-const.cc @@ -2618,7 +2618,7 @@ fold_convert_loc (location_t loc, tree type, tree arg) gcc_unreachable (); } fold_convert_exit: - protected_set_expr_location_unshare (tem, loc); + tem = protected_set_expr_location_unshare (tem, loc); return tem; }