This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [RFC] Fix PR c/5250
- From: Jan Hubicka <jh at suse dot cz>
- To: Gwenole Beauchesne <gbeauchesne at mandrakesoft dot com>
- Cc: gcc-patches at gcc dot gnu dot org, rodrigc at mediaone dot net, mark at codesourcery dot com, jh at suse dot cz, rth at redhat dot com
- Date: Sat, 9 Feb 2002 18:20:45 +0100
- Subject: Re: [RFC] Fix PR c/5250
- References: <Pine.LNX.4.33L2.0202082045070.7552-100000@thalys.mandrakesoft.com>
> Hi,
>
> This is PR c/4257, PR c/5049, PR c/5250 which apparently occur with
> regrename optimization. Those problems exist in 3.0-branch but was fixed
> in MAIN when Jan Hubicka killed jump_optimize:
> <http://gcc.gnu.org/ml/gcc-patches/2001-07/msg01430.html>
>
> The following patch disable jump_optimization for NOOP_MOVES prior to the
> regrename pass. Bootstrapped, regtested on i586-mandrake-linux-gnu. No
> regressions.
>
> I am not sure to get it right so comments are welcome.
It should be always correct to remove noop moves, so it looks like just
hidding the bug
(fact is that my new code does not care removing noop moves, perhaps we should
call delete_noop_moves explicitly in mainline in case they still happen - I
will check).
Anyway do you have any insight what noop moves gets removed and what effect
does it have on regrename pass?
Honza
>
> Thanks,
> Gwenole.
>
> 2002-02-08 Gwenole Beauchesne <gbeauchesne@mandrakesoft.com>
>
> PR c/4257, PR c/5049, PR c/5250
> * toplev.c (rest_of_compilation): Don't perform NOOP_MOVES
> jump_optimization prior to register renaming. However, tidy the
> CFG by deleting unreachable code.
> * gcc.c-torture/compile/20020208-1.c: New test.
>
> --- gcc-3.0.4/gcc/testsuite/gcc.c-torture/compile/20020208-1.c.no-noop_moves Fri Feb 8 20:28:37 2002
> +++ gcc-3.0.4/gcc/testsuite/gcc.c-torture/compile/20020208-1.c Fri Feb 8 20:28:37 2002
> @@ -0,0 +1,11 @@
> +/* Origin: PR c/4257 from Volker Reichelt <reichelt@igpm.rwth-aachen.de>.
> */
> +/* This testcase caused gcc-3.0.1 to ICE if compiled with -O1
> + -frename-registers. */
> +
> +void f ()
> +{
> + unsigned int *p;
> + p++;
> + *p += *p / (*p < 2);
> +}
> +
> --- gcc-3.0.4/gcc/toplev.c.no-noop_moves Fri Feb 8 20:01:51 2002
> +++ gcc-3.0.4/gcc/toplev.c Fri Feb 8 20:01:51 2002
> @@ -3546,9 +3546,8 @@
> timevar_push (TV_FLOW2);
> open_dump_file (DFI_flow2, decl);
>
> - jump_optimize (insns, !JUMP_CROSS_JUMP,
> - JUMP_NOOP_MOVES, !JUMP_AFTER_REGSCAN);
> find_basic_blocks (insns, max_reg_num (), rtl_dump_file);
> + cleanup_cfg ();
>
> /* On some machines, the prologue and epilogue code, or parts thereof,
> can be represented as RTL. Doing so lets us schedule insns between
>