aboutsummaryrefslogtreecommitdiff
path: root/gcc/c
diff options
context:
space:
mode:
authorMartin Liska <mliska@suse.cz>2022-09-20 13:53:30 +0200
committerMartin Liska <mliska@suse.cz>2022-09-20 13:53:30 +0200
commit6df29b782e87c6c800be0425023d8438fdc67b92 (patch)
tree48eebe497e384d66a7f5cf861b4b1b963785a2cd /gcc/c
parentfdb97cd0b7d15efa39ba79dca44be93debb0ef12 (diff)
parent63e3cc294d835b43701eeef9410d1b8fc8922869 (diff)
downloadgcc-6df29b782e87c6c800be0425023d8438fdc67b92.zip
gcc-6df29b782e87c6c800be0425023d8438fdc67b92.tar.gz
gcc-6df29b782e87c6c800be0425023d8438fdc67b92.tar.bz2
Merge branch 'master' into devel/sphinx
Diffstat (limited to 'gcc/c')
-rw-r--r--gcc/c/ChangeLog15
-rw-r--r--gcc/c/c-decl.cc8
-rw-r--r--gcc/c/c-typeck.cc43
3 files changed, 48 insertions, 18 deletions
diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog
index 41dc86b..b7fe1a4 100644
--- a/gcc/c/ChangeLog
+++ b/gcc/c/ChangeLog
@@ -1,3 +1,18 @@
+2022-09-19 Marek Polacek <polacek@redhat.com>
+
+ PR c/106947
+ * c-typeck.cc (maybe_warn_for_null_address): Don't emit stray
+ notes.
+
+2022-09-15 Richard Biener <rguenther@suse.de>
+
+ * c-decl.cc (build_void_list_node): Remove.
+
+2022-09-14 Julian Brown <julian@codesourcery.com>
+
+ * c-typeck.cc (c_finish_omp_clauses): Remove whole mapping node group
+ on error.
+
2022-09-07 Joseph Myers <joseph@codesourcery.com>
* c-parser.cc (c_parser_static_assert_declaration_no_semi)
diff --git a/gcc/c/c-decl.cc b/gcc/c/c-decl.cc
index 34f8fed..b09c639 100644
--- a/gcc/c/c-decl.cc
+++ b/gcc/c/c-decl.cc
@@ -10676,14 +10676,6 @@ record_builtin_type (enum rid rid_index, const char *name, tree type)
debug_hooks->type_decl (decl, false);
}
-/* Build the void_list_node (void_type_node having been created). */
-tree
-build_void_list_node (void)
-{
- tree t = build_tree_list (NULL_TREE, void_type_node);
- return t;
-}
-
/* Return a c_parm structure with the given SPECS, ATTRS and DECLARATOR. */
struct c_parm *
diff --git a/gcc/c/c-typeck.cc b/gcc/c/c-typeck.cc
index 9ada5d2..33d1e84 100644
--- a/gcc/c/c-typeck.cc
+++ b/gcc/c/c-typeck.cc
@@ -11738,18 +11738,19 @@ maybe_warn_for_null_address (location_t loc, tree op, tree_code code)
|| from_macro_expansion_at (loc))
return;
+ bool w;
if (code == EQ_EXPR)
- warning_at (loc, OPT_Waddress,
- "the comparison will always evaluate as %<false%> "
- "for the address of %qE will never be NULL",
- op);
+ w = warning_at (loc, OPT_Waddress,
+ "the comparison will always evaluate as %<false%> "
+ "for the address of %qE will never be NULL",
+ op);
else
- warning_at (loc, OPT_Waddress,
- "the comparison will always evaluate as %<true%> "
- "for the address of %qE will never be NULL",
- op);
+ w = warning_at (loc, OPT_Waddress,
+ "the comparison will always evaluate as %<true%> "
+ "for the address of %qE will never be NULL",
+ op);
- if (DECL_P (op))
+ if (w && DECL_P (op))
inform (DECL_SOURCE_LOCATION (op), "%qD declared here", op);
}
@@ -14238,12 +14239,19 @@ c_finish_omp_clauses (tree clauses, enum c_omp_region_type ort)
break;
}
+ tree *grp_start_p = NULL, grp_sentinel = NULL_TREE;
+
for (pc = &clauses, c = clauses; c ; c = *pc)
{
bool remove = false;
bool need_complete = false;
bool need_implicitly_determined = false;
+ /* We've reached the end of a list of expanded nodes. Reset the group
+ start pointer. */
+ if (c == grp_sentinel)
+ grp_start_p = NULL;
+
switch (OMP_CLAUSE_CODE (c))
{
case OMP_CLAUSE_SHARED:
@@ -15001,6 +15009,9 @@ c_finish_omp_clauses (tree clauses, enum c_omp_region_type ort)
t = OMP_CLAUSE_DECL (c);
if (TREE_CODE (t) == TREE_LIST)
{
+ grp_start_p = pc;
+ grp_sentinel = OMP_CLAUSE_CHAIN (c);
+
if (handle_omp_array_sections (c, ort))
remove = true;
else
@@ -15644,7 +15655,19 @@ c_finish_omp_clauses (tree clauses, enum c_omp_region_type ort)
}
if (remove)
- *pc = OMP_CLAUSE_CHAIN (c);
+ {
+ if (grp_start_p)
+ {
+ /* If we found a clause to remove, we want to remove the whole
+ expanded group, otherwise gimplify
+ (omp_resolve_clause_dependencies) can get confused. */
+ *grp_start_p = grp_sentinel;
+ pc = grp_start_p;
+ grp_start_p = NULL;
+ }
+ else
+ *pc = OMP_CLAUSE_CHAIN (c);
+ }
else
pc = &OMP_CLAUSE_CHAIN (c);
}