public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/104321] New: Dead code since r12-4467-g64f9623765da33
@ 2022-02-01  9:27 marxin at gcc dot gnu.org
  2022-02-01  9:27 ` [Bug fortran/104321] " marxin at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: marxin at gcc dot gnu.org @ 2022-02-01  9:27 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104321

            Bug ID: 104321
           Summary: Dead code since r12-4467-g64f9623765da33
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: marxin at gcc dot gnu.org
                CC: burnus at gcc dot gnu.org
  Target Milestone: ---

The following assignment is dead:

gcc/fortran/trans-decl.cc:7108

      /* if (cond) { block2 }  */
      tmp = fold_build2_loc (input_location, MODIFY_EXPR, void_type_node,
                             data, fold_convert (TREE_TYPE (data),
                                                 null_pointer_node));
      tmp = build3_v (COND_EXPR, cond_var, gfc_finish_block (&block2),
                      build_empty_stmt (input_location));

It's likely a bug?

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug fortran/104321] Dead code since r12-4467-g64f9623765da33
  2022-02-01  9:27 [Bug fortran/104321] New: Dead code since r12-4467-g64f9623765da33 marxin at gcc dot gnu.org
@ 2022-02-01  9:27 ` marxin at gcc dot gnu.org
  2022-02-01  9:49 ` burnus at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: marxin at gcc dot gnu.org @ 2022-02-01  9:27 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104321

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2022-02-01
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug fortran/104321] Dead code since r12-4467-g64f9623765da33
  2022-02-01  9:27 [Bug fortran/104321] New: Dead code since r12-4467-g64f9623765da33 marxin at gcc dot gnu.org
  2022-02-01  9:27 ` [Bug fortran/104321] " marxin at gcc dot gnu.org
@ 2022-02-01  9:49 ` burnus at gcc dot gnu.org
  2023-02-15 19:34 ` anlauf at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: burnus at gcc dot gnu.org @ 2022-02-01  9:49 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104321

--- Comment #1 from Tobias Burnus <burnus at gcc dot gnu.org> ---
I think it is not only dead code but it should be also removed:

Glancing at the code, the 'data = NULL;' does not make sense (cf. 'memcpy(lhs,
rhs)' above, lhs is data+offset) – and also does not match the comment.
Besides, all testcases seem to be happy with that line being dead code

Thus, I think the following is the right solution:

diff --git a/gcc/fortran/trans-decl.cc b/gcc/fortran/trans-decl.cc
index 6493cc2f6b1..45ba440c1db 100644
--- a/gcc/fortran/trans-decl.cc
+++ b/gcc/fortran/trans-decl.cc
@@ -7107,5 +7107,2 @@ gfc_conv_cfi_to_gfc (stmtblock_t *init, stmtblock_t
*finally,
       /* if (cond) { block2 }  */
-      tmp = fold_build2_loc (input_location, MODIFY_EXPR, void_type_node,
-                            data, fold_convert (TREE_TYPE (data),
-                                                null_pointer_node));
       tmp = build3_v (COND_EXPR, cond_var, gfc_finish_block (&block2),

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug fortran/104321] Dead code since r12-4467-g64f9623765da33
  2022-02-01  9:27 [Bug fortran/104321] New: Dead code since r12-4467-g64f9623765da33 marxin at gcc dot gnu.org
  2022-02-01  9:27 ` [Bug fortran/104321] " marxin at gcc dot gnu.org
  2022-02-01  9:49 ` burnus at gcc dot gnu.org
@ 2023-02-15 19:34 ` anlauf at gcc dot gnu.org
  2023-03-25 19:04 ` cvs-commit at gcc dot gnu.org
  2023-03-25 19:06 ` anlauf at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: anlauf at gcc dot gnu.org @ 2023-02-15 19:34 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104321

--- Comment #2 from anlauf at gcc dot gnu.org ---
(In reply to Tobias Burnus from comment #1)
> I think it is not only dead code but it should be also removed:
> 
> Glancing at the code, the 'data = NULL;' does not make sense (cf.
> 'memcpy(lhs, rhs)' above, lhs is data+offset) – and also does not match the
> comment.
> Besides, all testcases seem to be happy with that line being dead code

So we can just remove this dead code as obvious and finally close the PR?

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug fortran/104321] Dead code since r12-4467-g64f9623765da33
  2022-02-01  9:27 [Bug fortran/104321] New: Dead code since r12-4467-g64f9623765da33 marxin at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2023-02-15 19:34 ` anlauf at gcc dot gnu.org
@ 2023-03-25 19:04 ` cvs-commit at gcc dot gnu.org
  2023-03-25 19:06 ` anlauf at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-03-25 19:04 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104321

--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Harald Anlauf <anlauf@gcc.gnu.org>:

https://gcc.gnu.org/g:b5fce899dbbd7246d003209b2fe3b04f8738dddd

commit r13-6862-gb5fce899dbbd7246d003209b2fe3b04f8738dddd
Author: Harald Anlauf <anlauf@gmx.de>
Date:   Sat Mar 25 19:59:45 2023 +0100

    Fortran: remove dead code [PR104321]

    gcc/fortran/ChangeLog:

            PR fortran/104321
            * trans-decl.cc (gfc_conv_cfi_to_gfc): Remove dead code.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug fortran/104321] Dead code since r12-4467-g64f9623765da33
  2022-02-01  9:27 [Bug fortran/104321] New: Dead code since r12-4467-g64f9623765da33 marxin at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2023-03-25 19:04 ` cvs-commit at gcc dot gnu.org
@ 2023-03-25 19:06 ` anlauf at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: anlauf at gcc dot gnu.org @ 2023-03-25 19:06 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104321

anlauf at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
                 CC|                            |anlauf at gcc dot gnu.org
             Status|NEW                         |RESOLVED

--- Comment #4 from anlauf at gcc dot gnu.org ---
Fixed.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-03-25 19:06 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-01  9:27 [Bug fortran/104321] New: Dead code since r12-4467-g64f9623765da33 marxin at gcc dot gnu.org
2022-02-01  9:27 ` [Bug fortran/104321] " marxin at gcc dot gnu.org
2022-02-01  9:49 ` burnus at gcc dot gnu.org
2023-02-15 19:34 ` anlauf at gcc dot gnu.org
2023-03-25 19:04 ` cvs-commit at gcc dot gnu.org
2023-03-25 19:06 ` anlauf at gcc dot gnu.org

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).