diff --git a/gcc_component_ref_v2.patch b/gcc_component_ref_v2.patch index f2aa799..07bfe18 100644 --- a/gcc_component_ref_v2.patch +++ b/gcc_component_ref_v2.patch @@ -1,6 +1,6 @@ -From 0d2945f8e3c1b89b122fef0ded3973dfae2eb904 Mon Sep 17 00:00:00 2001 +From 5b6e53085b50bd8b7c9f4cbfd77297c1134f9014 Mon Sep 17 00:00:00 2001 From: York Jasper Niebuhr -Date: Thu, 30 Oct 2025 13:12:24 +0100 +Date: Thu, 30 Oct 2025 21:30:06 +0100 Subject: [PATCH] c, plugin: Add c_parse_component_ref callback This patch supersedes my earlier submission: @@ -46,17 +46,23 @@ guarantees. Signed-off-by: York Jasper Niebuhr --- - gcc/c-family/c-common.cc | 48 +++++++++++++++++++++------ + gcc/c-family/c-common.cc | 52 ++++++++++++++++++++++------- gcc/c-family/c-common.h | 3 +- gcc/c/c-parser.cc | 72 +++++++++++++++++++++++++++++++++++++++- - 3 files changed, 110 insertions(+), 13 deletions(-) + 3 files changed, 113 insertions(+), 14 deletions(-) diff --git a/gcc/c-family/c-common.cc b/gcc/c-family/c-common.cc -index 587d76461e9..d34edfaa688 100644 +index 587d76461e9..a1c76642b12 100644 --- a/gcc/c-family/c-common.cc +++ b/gcc/c-family/c-common.cc -@@ -7076,43 +7076,48 @@ c_common_to_target_charset (HOST_WIDE_INT c) - the whole expression. Return the folded result. */ +@@ -7073,46 +7073,53 @@ c_common_to_target_charset (HOST_WIDE_INT c) + /* Fold an offsetof-like expression. EXPR is a nested sequence of component + references with an INDIRECT_REF of a constant at the bottom; much like the + traditional rendering of offsetof as a macro. TYPE is the desired type of +- the whole expression. Return the folded result. */ ++ the whole expression. On error, error_mark_node is returned. Compiler ++ errors are only produced if MAY_FAIL is set to false. Otherwise, the folded ++ result is returned. */ tree -fold_offsetof (tree expr, tree type, enum tree_code ctx) @@ -111,7 +117,7 @@ index 587d76461e9..d34edfaa688 100644 return error_mark_node; } off = size_binop_loc (input_location, PLUS_EXPR, DECL_FIELD_OFFSET (t), -@@ -7121,7 +7126,7 @@ fold_offsetof (tree expr, tree type, enum tree_code ctx) +@@ -7121,7 +7128,7 @@ fold_offsetof (tree expr, tree type, enum tree_code ctx) break; case ARRAY_REF: @@ -120,7 +126,7 @@ index 587d76461e9..d34edfaa688 100644 if (base == error_mark_node) return base; -@@ -7178,17 +7183,38 @@ fold_offsetof (tree expr, tree type, enum tree_code ctx) +@@ -7178,17 +7185,38 @@ fold_offsetof (tree expr, tree type, enum tree_code ctx) case COMPOUND_EXPR: /* Handle static members of volatile structs. */ t = TREE_OPERAND (expr, 1);