[gcc(refs/users/mikael/heads/refactor_descriptor_v08)] Interdiction non-lvalue as lhs
Mikael Morin
mikael@gcc.gnu.org
Wed Sep 10 19:53:34 GMT 2025
https://gcc.gnu.org/g:4e739e5b36e56a8c8e6ce39b941dad9c809a4ff9
commit 4e739e5b36e56a8c8e6ce39b941dad9c809a4ff9
Author: Mikael Morin <mikael@gcc.gnu.org>
Date: Tue Feb 11 21:34:11 2025 +0100
Interdiction non-lvalue as lhs
git commit correction erreur gimplify
Diff:
---
gcc/gimplify.cc | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/gcc/gimplify.cc b/gcc/gimplify.cc
index ca1fa2189cb9..2baf07dddb4f 100644
--- a/gcc/gimplify.cc
+++ b/gcc/gimplify.cc
@@ -7248,6 +7248,12 @@ gimplify_modify_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p,
gcc_assert (TREE_CODE (*expr_p) == MODIFY_EXPR
|| TREE_CODE (*expr_p) == INIT_EXPR);
+ if (TREE_CODE (*to_p) == NON_LVALUE_EXPR)
+ {
+ error ("non-lvalue used as lhs in %qD", *expr_p);
+ return GS_ERROR;
+ }
+
/* Trying to simplify a clobber using normal logic doesn't work,
so handle it here. */
if (TREE_CLOBBER_P (*from_p))
More information about the Gcc-cvs
mailing list