This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
ifcvt buglet
- To: gcc-patches at gcc dot gnu dot org
- Subject: ifcvt buglet
- From: Jeffrey A Law <law at cygnus dot com>
- Date: Wed, 31 May 2000 01:23:13 -0600
- Reply-To: law at cygnus dot com
The PA was failing to bootstrap because it mis-compiled
file_name_nondirectory in the C++ front-end. This mis-compilation
showed up as a compile-time failure when building the C++ runtime
libraries.
Basically we had a conditional jump in parallel with a reg->reg copy.
if-conversion removed the conditional jump & reg->reg copy. This
resulted in an uninitialized pseudo and ultimately incorrect code.
if/condexec conversion doesn't know how to deal with jumps which have
additional side effects. This patch (suggested by Richard) fixes the
problem.
* ifcvt.c (cond_exec_process_if_block): Do nothing if the last insn
in the block is more than just a simple conditional branch.
(noce_process_if_block): Similarly.
Index: ifcvt.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/ifcvt.c,v
retrieving revision 1.24
diff -c -3 -p -r1.24 ifcvt.c
*** ifcvt.c 2000/05/26 09:51:00 1.24
--- ifcvt.c 2000/05/31 07:28:04
*************** cond_exec_process_if_block (test_bb, the
*** 313,318 ****
--- 313,323 ----
if (! test_expr)
return FALSE;
+ /* If the conditional jump is more than just a conditional jump,
+ then we can not do conditional execution conversion on this block. */
+ if (!onlyjump_p (test_bb->end))
+ return FALSE;
+
/* Collect the bounds of where we're to search. */
then_start = then_bb->head;
*************** noce_process_if_block (test_bb, then_bb,
*** 1104,1109 ****
--- 1109,1119 ----
jump = test_bb->end;
cond = noce_get_condition (jump, &if_info.cond_earliest);
if (! cond)
+ return FALSE;
+
+ /* If the conditional jump is more than just a conditional jump,
+ then we can not do if-conversion on this block. */
+ if (! onlyjump_p (jump))
return FALSE;
/* We must be comparing objects whose modes imply the size. */