[gcc r16-5827] a68: remove superfluous code detected by cppcheck [PR algol68/122954]
Jose E. Marchesi
jemarch@gcc.gnu.org
Tue Dec 2 10:09:26 GMT 2025
https://gcc.gnu.org/g:f76e54a7cff14bfbbb1d83c45e042b18c325ce67
commit r16-5827-gf76e54a7cff14bfbbb1d83c45e042b18c325ce67
Author: Jose E. Marchesi <jose.marchesi@oracle.com>
Date: Tue Dec 2 11:06:45 2025 +0100
a68: remove superfluous code detected by cppcheck [PR algol68/122954]
This commits fixes three instances of harmless but redundant code,
detected by cppcheck.
gcc/algol68/ChangeLog
PR algol68/122954
* a68-low-clauses.cc (serial_clause_dsa): Avoid redundant
initialization.
* a68-parser-modes.cc (compute_derived_modes): Likewise.
* a68-low.cc (a68_lower_tree): Remove redundant break.
Diff:
---
gcc/algol68/a68-low-clauses.cc | 4 +---
gcc/algol68/a68-low.cc | 1 -
gcc/algol68/a68-parser-modes.cc | 3 +--
3 files changed, 2 insertions(+), 6 deletions(-)
diff --git a/gcc/algol68/a68-low-clauses.cc b/gcc/algol68/a68-low-clauses.cc
index 77e07b1121b1..8cc81500b237 100644
--- a/gcc/algol68/a68-low-clauses.cc
+++ b/gcc/algol68/a68-low-clauses.cc
@@ -58,9 +58,7 @@
static bool
serial_clause_dsa (NODE_T *p)
{
- NODE_T *s = NEXT (SUB (p));
-
- for (s = p; SUB (s) && IS (s, SERIAL_CLAUSE); s = SUB (s))
+ for (NODE_T *s = p; SUB (s) && IS (s, SERIAL_CLAUSE); s = SUB (s))
{
if (DYNAMIC_STACK_ALLOCS (s))
return true;
diff --git a/gcc/algol68/a68-low.cc b/gcc/algol68/a68-low.cc
index 109620248fb1..ac603ef13e79 100644
--- a/gcc/algol68/a68-low.cc
+++ b/gcc/algol68/a68-low.cc
@@ -1479,7 +1479,6 @@ a68_lower_tree (NODE_T *p, LOW_CTX_T ctx)
case PACKET:
res = lower_packet (p, ctx);
break;
- break;
case PRELUDE_PACKET:
res = lower_prelude_packet (p, ctx);
break;
diff --git a/gcc/algol68/a68-parser-modes.cc b/gcc/algol68/a68-parser-modes.cc
index 4a0128667ca0..83f40a0615a7 100644
--- a/gcc/algol68/a68-parser-modes.cc
+++ b/gcc/algol68/a68-parser-modes.cc
@@ -1202,10 +1202,9 @@ compute_derived_modes (MODULE_T *mod)
for (; s != NO_PACK; FORWARD (s))
{
- PACK_T *t = NEXT (s);
bool x = true;
- for (t = NEXT (s); t != NO_PACK && x; FORWARD (t))
+ for (PACK_T *t = NEXT (s); t != NO_PACK && x; FORWARD (t))
{
if (TEXT (s) == TEXT (t))
{
More information about the Gcc-cvs
mailing list