This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[RFC] Fix PR c/5250
- From: Gwenole Beauchesne <gbeauchesne at mandrakesoft dot com>
- To: <gcc-patches at gcc dot gnu dot org>
- Cc: <rodrigc at mediaone dot net>, <mark at codesourcery dot com>, <jh at suse dot cz>, <rth at redhat dot com>
- Date: Fri, 8 Feb 2002 21:45:00 +0100 (CET)
- Subject: [RFC] Fix PR c/5250
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.
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