This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Remove dead code from fold_stmt_1
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Richard Biener <rguenther at suse dot de>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Tue, 27 Nov 2012 13:07:53 +0100
- Subject: Re: [PATCH] Remove dead code from fold_stmt_1
- References: <alpine.LNX.2.00.1211271259340.8142@zhemvz.fhfr.qr>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Tue, Nov 27, 2012 at 01:00:05PM +0100, Richard Biener wrote:
>
> This removes dead code as suggested by Jakub.
>
> Bootstrapped and tested on x86_64-unknown-linux-gnu.
Looks as partial removal only. IMHO
gimple_stmt_iterator gsinext = *gsi;
gimple next_stmt;
gsi_next (&gsinext);
next_stmt = gsi_end_p (gsinext) ? NULL : gsi_stmt (gsinext);
can go too and
/* Fold *& on the lhs. Don't do this if stmt folded into nothing,
as we'd changing the next stmt. */
if (gimple_has_lhs (stmt) && stmt != next_stmt)
should be:
/* Fold *& on the lhs. */
if (gimple_has_lhs (stmt))
> 2012-11-27 Richard Biener <rguenther@suse.de>
>
> * gimple-fold.c (fold_stmt_1): Remove unnecessary code.
>
> Index: gcc/gimple-fold.c
> ===================================================================
> --- gcc/gimple-fold.c (revision 193839)
> +++ gcc/gimple-fold.c (working copy)
> @@ -1282,14 +1282,6 @@ fold_stmt_1 (gimple_stmt_iterator *gsi,
> default:;
> }
>
> - /* If stmt folds into nothing and it was the last stmt in a bb,
> - don't call gsi_stmt. */
> - if (gsi_end_p (*gsi))
> - {
> - gcc_assert (next_stmt == NULL);
> - return changed;
> - }
> -
> stmt = gsi_stmt (*gsi);
>
> /* Fold *& on the lhs. Don't do this if stmt folded into nothing,
Jakub