From: "Martin Liška" <mliska@suse.cz>
To: gcc-patches@gcc.gnu.org
Subject: [PATCH] Remove another bunch of dead assignment.
Date: Thu, 27 Jun 2019 14:03:00 -0000 [thread overview]
Message-ID: <92cf2998-1daa-879d-47f9-8e1a4dd5391d@suse.cz> (raw)
[-- Attachment #1: Type: text/plain, Size: 2754 bytes --]
Hi.
The patch continues to remove quite obvious dead assignments
that are not used.
Patch can bootstrap on x86_64-linux-gnu and survives regression tests.
Ready to be installed?
Thanks,
Martin
gcc/ChangeLog:
2019-06-27 Martin Liska <mliska@suse.cz>
* config/i386/i386-expand.c (ix86_expand_sse2_mulvxdi3): Remove
dead assignemts.
* lra-eliminations.c (eliminate_regs_in_insn): Likewise.
* reg-stack.c (check_asm_stack_operands): Likewise.
* tree-ssa-structalias.c (create_function_info_for): Likewise.
* tree-vect-generic.c (expand_vector_operations_1): Likewise.
gcc/c-family/ChangeLog:
2019-06-27 Martin Liska <mliska@suse.cz>
* c-common.c (try_to_locate_new_include_insertion_point): Remove
dead assignemts.
gcc/cp/ChangeLog:
2019-06-27 Martin Liska <mliska@suse.cz>
* call.c (build_new_op_1): Remove
dead assignemts.
* typeck.c (cp_build_binary_op): Likewise.
gcc/fortran/ChangeLog:
2019-06-27 Martin Liska <mliska@suse.cz>
* check.c (gfc_check_c_funloc): Remove
dead assignemts.
* decl.c (variable_decl): Likewise.
* resolve.c (resolve_typebound_function): Likewise.
* simplify.c (gfc_simplify_matmul): Likewise.
(gfc_simplify_scan): Likewise.
* trans-array.c (gfc_could_be_alias): Likewise.
* trans-common.c (add_equivalences): Likewise.
* trans-expr.c (trans_class_vptr_len_assignment): Likewise.
(gfc_trans_array_constructor_copy): Likewise.
(gfc_trans_assignment_1): Likewise.
* trans-intrinsic.c (conv_intrinsic_atomic_op): Likewise.
* trans-openmp.c (gfc_omp_finish_clause): Likewise.
* trans-types.c (gfc_get_array_descriptor_base): Likewise.
* trans.c (gfc_build_final_call): Likewise.
libcpp/ChangeLog:
2019-06-27 Martin Liska <mliska@suse.cz>
* line-map.c (linemap_get_expansion_filename): Remove
dead assignemts.
* mkdeps.c (make_write): Likewise.
---
gcc/c-family/c-common.c | 4 ++--
gcc/config/i386/i386-expand.c | 3 +--
gcc/cp/call.c | 2 +-
gcc/cp/typeck.c | 1 -
gcc/fortran/check.c | 18 +++++++-----------
gcc/fortran/decl.c | 1 -
gcc/fortran/resolve.c | 1 -
gcc/fortran/simplify.c | 27 ++++++++++++---------------
gcc/fortran/trans-array.c | 2 --
gcc/fortran/trans-common.c | 6 ++----
gcc/fortran/trans-expr.c | 6 ------
gcc/fortran/trans-intrinsic.c | 1 -
gcc/fortran/trans-openmp.c | 1 -
gcc/fortran/trans-types.c | 10 +++++-----
gcc/fortran/trans.c | 3 ---
gcc/lra-eliminations.c | 2 +-
gcc/reg-stack.c | 1 -
gcc/tree-ssa-structalias.c | 1 -
gcc/tree-vect-generic.c | 2 --
libcpp/line-map.c | 3 +--
libcpp/mkdeps.c | 2 +-
21 files changed, 33 insertions(+), 64 deletions(-)
[-- Attachment #2: 0001-Remove-another-bunch-of-dead-assignment.patch --]
[-- Type: text/x-patch, Size: 12696 bytes --]
diff --git a/gcc/c-family/c-common.c b/gcc/c-family/c-common.c
index da4aadbc590..cb92710f2bc 100644
--- a/gcc/c-family/c-common.c
+++ b/gcc/c-family/c-common.c
@@ -8601,8 +8601,8 @@ try_to_locate_new_include_insertion_point (const char *file, location_t loc)
/* Get ordinary map containing LOC (or its expansion). */
const line_map_ordinary *ord_map_for_loc = NULL;
- loc = linemap_resolve_location (line_table, loc, LRK_MACRO_EXPANSION_POINT,
- &ord_map_for_loc);
+ linemap_resolve_location (line_table, loc, LRK_MACRO_EXPANSION_POINT,
+ &ord_map_for_loc);
gcc_assert (ord_map_for_loc);
for (unsigned int i = 0; i < LINEMAPS_ORDINARY_USED (line_table); i++)
diff --git a/gcc/config/i386/i386-expand.c b/gcc/config/i386/i386-expand.c
index d50b811d863..1bd251ea8e2 100644
--- a/gcc/config/i386/i386-expand.c
+++ b/gcc/config/i386/i386-expand.c
@@ -19780,8 +19780,7 @@ ix86_expand_sse2_mulvxdi3 (rtx op0, rtx op1, rtx op2)
emit_insn (gen_vec_widen_umult_even_v4si (t5,
gen_lowpart (V4SImode, op1),
gen_lowpart (V4SImode, op2)));
- op0 = expand_binop (mode, add_optab, t5, t4, op0, 1, OPTAB_DIRECT);
-
+ expand_binop (mode, add_optab, t5, t4, op0, 1, OPTAB_DIRECT);
}
else
{
diff --git a/gcc/cp/call.c b/gcc/cp/call.c
index e4923f4ccbf..07093255505 100644
--- a/gcc/cp/call.c
+++ b/gcc/cp/call.c
@@ -6167,7 +6167,7 @@ build_new_op_1 (const op_location_t &loc, enum tree_code code, int flags,
conv = cand->convs[2];
if (conv->kind == ck_ref_bind)
conv = next_conversion (conv);
- arg3 = convert_like (conv, arg3, complain);
+ convert_like (conv, arg3, complain);
}
}
diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c
index dd76ebe3dbf..77095953134 100644
--- a/gcc/cp/typeck.c
+++ b/gcc/cp/typeck.c
@@ -5218,7 +5218,6 @@ cp_build_binary_op (const op_location_t &location,
}
result_type = build_opaque_vector_type (intt,
TYPE_VECTOR_SUBPARTS (type0));
- converted = 1;
return build_vec_cmp (resultcode, result_type, op0, op1);
}
build_type = boolean_type_node;
diff --git a/gcc/fortran/check.c b/gcc/fortran/check.c
index a04f0d66655..95801804022 100644
--- a/gcc/fortran/check.c
+++ b/gcc/fortran/check.c
@@ -4884,17 +4884,13 @@ gfc_check_c_funloc (gfc_expr *x)
if (attr.function && !attr.proc_pointer && x->expr_type == EXPR_VARIABLE
&& x->symtree->n.sym == x->symtree->n.sym->result)
- {
- gfc_namespace *ns = gfc_current_ns;
-
- for (ns = gfc_current_ns; ns; ns = ns->parent)
- if (x->symtree->n.sym == ns->proc_name)
- {
- gfc_error ("Function result %qs at %L is invalid as X argument "
- "to C_FUNLOC", x->symtree->n.sym->name, &x->where);
- return false;
- }
- }
+ for (gfc_namespace *ns = gfc_current_ns; ns; ns = ns->parent)
+ if (x->symtree->n.sym == ns->proc_name)
+ {
+ gfc_error ("Function result %qs at %L is invalid as X argument "
+ "to C_FUNLOC", x->symtree->n.sym->name, &x->where);
+ return false;
+ }
if (attr.flavor != FL_PROCEDURE)
{
diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c
index 7e4e8a29984..3d29091282e 100644
--- a/gcc/fortran/decl.c
+++ b/gcc/fortran/decl.c
@@ -2455,7 +2455,6 @@ variable_decl (int elem)
/* %FILL components are given invalid fortran names. */
snprintf (name, GFC_MAX_SYMBOL_LEN + 1, "%%FILL%u", fill_id++);
- m = MATCH_YES;
}
var_locus = gfc_current_locus;
diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c
index af7078a46d9..c82e8f21341 100644
--- a/gcc/fortran/resolve.c
+++ b/gcc/fortran/resolve.c
@@ -6573,7 +6573,6 @@ resolve_typebound_function (gfc_expr* e)
}
c = gfc_find_component (declared, "_data", true, true, NULL);
- declared = c->ts.u.derived;
/* Treat the call as if it is a typebound procedure, in order to roll
out the correct name for the specific function. */
diff --git a/gcc/fortran/simplify.c b/gcc/fortran/simplify.c
index 6c1f4bd4fce..2d20913ca56 100644
--- a/gcc/fortran/simplify.c
+++ b/gcc/fortran/simplify.c
@@ -4714,7 +4714,7 @@ gfc_simplify_matmul (gfc_expr *matrix_a, gfc_expr *matrix_b)
else
gcc_unreachable();
- offset_a = offset_b = 0;
+ offset_b = 0;
for (col = 0; col < result_columns; ++col)
{
offset_a = 0;
@@ -6999,20 +6999,17 @@ gfc_simplify_scan (gfc_expr *e, gfc_expr *c, gfc_expr *b, gfc_expr *kind)
indx = 0;
}
else
- {
- i = 0;
- for (indx = len; indx > 0; indx--)
- {
- for (i = 0; i < lenc; i++)
- {
- if (c->value.character.string[i]
- == e->value.character.string[indx - 1])
- break;
- }
- if (i < lenc)
- break;
- }
- }
+ for (indx = len; indx > 0; indx--)
+ {
+ for (i = 0; i < lenc; i++)
+ {
+ if (c->value.character.string[i]
+ == e->value.character.string[indx - 1])
+ break;
+ }
+ if (i < lenc)
+ break;
+ }
}
result = gfc_get_int_expr (k, &e->where, indx);
diff --git a/gcc/fortran/trans-array.c b/gcc/fortran/trans-array.c
index 56d534d0444..1ab03615fda 100644
--- a/gcc/fortran/trans-array.c
+++ b/gcc/fortran/trans-array.c
@@ -4794,8 +4794,6 @@ gfc_could_be_alias (gfc_ss * lss, gfc_ss * rss)
lsym_pointer = lsym->attr.pointer;
lsym_target = lsym->attr.target;
- lsym_pointer = lsym->attr.pointer;
- lsym_target = lsym->attr.target;
for (rref = rexpr->ref; rref != rss->info->data.array.ref; rref = rref->next)
{
diff --git a/gcc/fortran/trans-common.c b/gcc/fortran/trans-common.c
index debdbd98ac0..9fc23ff5e7c 100644
--- a/gcc/fortran/trans-common.c
+++ b/gcc/fortran/trans-common.c
@@ -1007,10 +1007,8 @@ static void
add_equivalences (bool *saw_equiv)
{
segment_info *f;
- bool seen_one, more;
+ bool more = TRUE;
- seen_one = false;
- more = TRUE;
while (more)
{
more = FALSE;
@@ -1019,7 +1017,7 @@ add_equivalences (bool *saw_equiv)
if (!f->sym->equiv_built)
{
f->sym->equiv_built = 1;
- seen_one = find_equivalence (f);
+ bool seen_one = find_equivalence (f);
if (seen_one)
{
*saw_equiv = true;
diff --git a/gcc/fortran/trans-expr.c b/gcc/fortran/trans-expr.c
index 074568ab596..a4e8351110a 100644
--- a/gcc/fortran/trans-expr.c
+++ b/gcc/fortran/trans-expr.c
@@ -8912,7 +8912,6 @@ trans_class_vptr_len_assignment (stmtblock_t *block, gfc_expr * le,
from_len = rse->string_length;
else if (re->ts.type == BT_CHARACTER && re->ts.u.cl->length)
{
- from_len = gfc_get_expr_charlen (re);
gfc_init_se (&se, NULL);
gfc_conv_expr (&se, re->ts.u.cl->length);
gfc_add_block_to_block (block, &se.pre);
@@ -10171,10 +10170,6 @@ gfc_trans_array_constructor_copy (gfc_expr * expr1, gfc_expr * expr2)
stype = gfc_typenode_for_spec (&expr2->ts);
src = gfc_build_constant_array_constructor (expr2, stype);
- stype = TREE_TYPE (src);
- if (POINTER_TYPE_P (stype))
- stype = TREE_TYPE (stype);
-
return gfc_build_memcpy_call (dst, src, len);
}
@@ -10924,7 +10919,6 @@ gfc_trans_assignment_1 (gfc_expr * expr1, gfc_expr * expr2, bool init_flag,
&& (gfc_is_class_array_function (expr2)
|| gfc_is_alloc_class_scalar_function (expr2)))
{
- tmp = rse.expr;
tmp = gfc_nullify_alloc_comp (expr1->ts.u.derived, rse.expr, 0);
gfc_prepend_expr_to_block (&rse.post, tmp);
if (lss != gfc_ss_terminator && rss == gfc_ss_terminator)
diff --git a/gcc/fortran/trans-intrinsic.c b/gcc/fortran/trans-intrinsic.c
index cc041f9eea7..a7ebc413d6e 100644
--- a/gcc/fortran/trans-intrinsic.c
+++ b/gcc/fortran/trans-intrinsic.c
@@ -10971,7 +10971,6 @@ conv_intrinsic_atomic_op (gfc_code *code)
fn = (built_in_function) ((int) fn
+ exact_log2 (tree_to_uhwi (TYPE_SIZE_UNIT (tmp)))
+ 1);
- tmp = builtin_decl_explicit (fn);
tree itype = TREE_TYPE (TREE_TYPE (atom));
tmp = builtin_decl_explicit (fn);
diff --git a/gcc/fortran/trans-openmp.c b/gcc/fortran/trans-openmp.c
index 394cbc2a929..8eae7bc0a52 100644
--- a/gcc/fortran/trans-openmp.c
+++ b/gcc/fortran/trans-openmp.c
@@ -1199,7 +1199,6 @@ gfc_omp_finish_clause (tree c, gimple_seq *pre_p)
{
OMP_CLAUSE_CHAIN (c4) = OMP_CLAUSE_CHAIN (last);
OMP_CLAUSE_CHAIN (last) = c4;
- last = c4;
}
}
diff --git a/gcc/fortran/trans-types.c b/gcc/fortran/trans-types.c
index 1dbb842a1c4..e1033b3b223 100644
--- a/gcc/fortran/trans-types.c
+++ b/gcc/fortran/trans-types.c
@@ -1817,11 +1817,11 @@ gfc_get_array_descriptor_base (int dimen, int codimen, bool restricted)
TYPE_NAMELESS (fat_type) = 1;
/* Add the data member as the first element of the descriptor. */
- decl = gfc_add_field_to_struct_1 (fat_type,
- get_identifier ("data"),
- (restricted
- ? prvoid_type_node
- : ptr_type_node), &chain);
+ gfc_add_field_to_struct_1 (fat_type,
+ get_identifier ("data"),
+ (restricted
+ ? prvoid_type_node
+ : ptr_type_node), &chain);
/* Add the base component. */
decl = gfc_add_field_to_struct_1 (fat_type,
diff --git a/gcc/fortran/trans.c b/gcc/fortran/trans.c
index 0d786d9cf99..303abd994c5 100644
--- a/gcc/fortran/trans.c
+++ b/gcc/fortran/trans.c
@@ -1014,9 +1014,6 @@ gfc_build_final_call (gfc_typespec ts, gfc_expr *final_wrapper, gfc_expr *var,
gfc_add_block_to_block (&block, &se.pre);
gcc_assert (se.post.head == NULL_TREE);
array = se.expr;
- if (TREE_CODE (array) == ADDR_EXPR
- && POINTER_TYPE_P (TREE_TYPE (TREE_OPERAND (array, 0))))
- tmp = TREE_OPERAND (array, 0);
if (!gfc_is_coarray (array_expr))
{
diff --git a/gcc/lra-eliminations.c b/gcc/lra-eliminations.c
index f344e127cfe..051839a2717 100644
--- a/gcc/lra-eliminations.c
+++ b/gcc/lra-eliminations.c
@@ -1053,7 +1053,7 @@ eliminate_regs_in_insn (rtx_insn *insn, bool replace_p, bool first_p,
PARALLEL since the new one still will, but we can't call
single_set without having put new body into the insn and the
re-recognition won't hurt in this rare case. */
- id = lra_update_insn_recog_data (insn);
+ lra_update_insn_recog_data (insn);
}
/* Spill pseudos which are assigned to hard registers in SET. Add
diff --git a/gcc/reg-stack.c b/gcc/reg-stack.c
index 8c934aaf936..5576630c8f2 100644
--- a/gcc/reg-stack.c
+++ b/gcc/reg-stack.c
@@ -484,7 +484,6 @@ check_asm_stack_operands (rtx_insn *insn)
if (which_alternative < 0)
{
- malformed_asm = 1;
/* Avoid further trouble with this insn. */
PATTERN (insn) = gen_rtx_USE (VOIDmode, const0_rtx);
return 0;
diff --git a/gcc/tree-ssa-structalias.c b/gcc/tree-ssa-structalias.c
index 07791519c6c..29688d2618d 100644
--- a/gcc/tree-ssa-structalias.c
+++ b/gcc/tree-ssa-structalias.c
@@ -5955,7 +5955,6 @@ create_function_info_for (tree decl, const char *name, bool add_id,
gcc_assert (prev_vi->offset < argvi->offset);
prev_vi->next = argvi->id;
- prev_vi = argvi;
}
return vi;
diff --git a/gcc/tree-vect-generic.c b/gcc/tree-vect-generic.c
index 4a53fc44584..8389f5555e8 100644
--- a/gcc/tree-vect-generic.c
+++ b/gcc/tree-vect-generic.c
@@ -1981,7 +1981,6 @@ expand_vector_operations_1 (gimple_stmt_iterator *gsi)
|| code == VEC_UNPACK_FLOAT_LO_EXPR
|| code == VEC_PACK_FLOAT_EXPR)
{
- type = TREE_TYPE (rhs1);
/* We do not know how to scalarize those. */
return;
}
@@ -2004,7 +2003,6 @@ expand_vector_operations_1 (gimple_stmt_iterator *gsi)
|| code == VEC_WIDEN_LSHIFT_HI_EXPR
|| code == VEC_WIDEN_LSHIFT_LO_EXPR)
{
- type = TREE_TYPE (rhs1);
/* We do not know how to scalarize those. */
return;
}
diff --git a/libcpp/line-map.c b/libcpp/line-map.c
index 31439f4aba3..8ab873b4e18 100644
--- a/libcpp/line-map.c
+++ b/libcpp/line-map.c
@@ -1160,8 +1160,7 @@ linemap_get_expansion_filename (struct line_maps *set,
if (location < RESERVED_LOCATION_COUNT)
return NULL;
- location =
- linemap_macro_loc_to_exp_point (set, location, &map);
+ linemap_macro_loc_to_exp_point (set, location, &map);
return LINEMAP_FILE (map);
}
diff --git a/libcpp/mkdeps.c b/libcpp/mkdeps.c
index 676ae122bde..50f0fb2a80d 100644
--- a/libcpp/mkdeps.c
+++ b/libcpp/mkdeps.c
@@ -378,7 +378,7 @@ make_write (const struct mkdeps *d, FILE *fp, bool phony, unsigned int colmax)
column = make_write_vec (d->targets, fp, 0, colmax, d->quote_lwm);
fputs (":", fp);
column++;
- column = make_write_vec (d->deps, fp, column, colmax);
+ make_write_vec (d->deps, fp, column, colmax);
fputs ("\n", fp);
if (phony)
for (unsigned i = 1; i < d->deps.size (); i++)
next reply other threads:[~2019-06-27 14:03 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-27 14:03 Martin Liška [this message]
2019-06-27 17:24 ` Richard Sandiford
2019-07-01 10:28 ` Martin Liška
2019-07-02 23:06 ` Jeff Law
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=92cf2998-1daa-879d-47f9-8e1a4dd5391d@suse.cz \
--to=mliska@suse.cz \
--cc=gcc-patches@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).