public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: PATCH: Check all insns in fallthru to see if label is mentioned
@ 2001-12-09 15:35 Richard Kenner
  2001-12-09 17:37 ` John David Anglin
  0 siblings, 1 reply; 9+ messages in thread
From: Richard Kenner @ 2001-12-09 15:35 UTC (permalink / raw)
  To: dave; +Cc: gcc-patches

    > FAIL: gcc.c-torture/execute/strct-pack-1.c execution,  -O2
    > FAIL: gcc.c-torture/execute/strct-pack-1.c execution,  -Os

    It is my guess that these failures are due to the "enhanced structure
    offset tracking" patch.

Reworking that code is pretty high on my list, so I'll take responsibility
for this one.  I hope to get to it by Tuesday.

^ permalink raw reply	[flat|nested] 9+ messages in thread
* Re: PATCH: Check all insns in fallthru to see if label is mentioned
@ 2001-12-09 17:43 Richard Kenner
  0 siblings, 0 replies; 9+ messages in thread
From: Richard Kenner @ 2001-12-09 17:43 UTC (permalink / raw)
  To: dave; +Cc: gcc-patches

    In looking at the rtl, I also noticed virtual-stack-vars are being
    referenced before they are initialized.  For example, I see the
    following rtl in main:

This is to preserve the original value of the other bits in the byte
containing the field.  Yes, they are undefined here, but the bitfield
code can't know that.

^ permalink raw reply	[flat|nested] 9+ messages in thread
[parent not found: <no.id>]
* PATCH: Check all insns in fallthru to see if label is mentioned
@ 2001-10-01  9:19 John David Anglin
  0 siblings, 0 replies; 9+ messages in thread
From: John David Anglin @ 2001-10-01  9:19 UTC (permalink / raw)
  To: gcc-patches

On the vax, a label in an addr_diff_vec can be inadvertantly deleted by
try_optimize_cfg.  Currently, try_optimize_cfg just checks the insn at
the end of the previous block for a condjump which mentions the label.
This patch extends the check to look at all insns from the end of the
previous block up to but not including the label.

Bootstrap checked with no regressions on hppa1.1-hp-hpux10.20.  On the
vax, it has been confirmed that it resolves the problem in question.
Unfortunately, there are still more bugs to stomp.

OK?

Dave
-- 
J. David Anglin                                  dave.anglin@nrc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6605)

2001-10-01  John David Anglin  <dave@hiauly1.hia.nrc.ca>

	* cfgcleanup.c (label_mentioned_p): New function.
	(try_optimize_cfg): Use it.

--- cfgcleanup.c.orig	Fri Sep 21 18:29:23 2001
+++ cfgcleanup.c	Fri Sep 28 16:09:38 2001
@@ -52,6 +52,7 @@
 						 rtx *, rtx *));
 
 static bool delete_unreachable_blocks	PARAMS ((void));
+static bool label_mentioned_p		PARAMS ((rtx, rtx));
 static bool tail_recursion_label_p	PARAMS ((rtx));
 static void merge_blocks_move_predecessor_nojumps PARAMS ((basic_block,
 							  basic_block));
@@ -248,6 +249,22 @@
   return changed;
 }
 \f
+/* Return true if LABEL is mentioned in any insn from INSN up to
+   but not including the label.  */
+
+static bool
+label_mentioned_p (label, insn)
+     rtx label, insn;
+{
+  rtx x;
+
+  for (x = insn; x != label; x = NEXT_INSN (x))
+    if (reg_mentioned_p (label, x))
+      return true;
+
+  return false;
+}
+
 /* Return true if LABEL is used for tail recursion.  */
 
 static bool
@@ -1096,7 +1113,7 @@
 	      /* If previous block ends with condjump jumping to next BB,
 	         we can't delete the label.  */
 	      && (b->pred->src == ENTRY_BLOCK_PTR
-		  || !reg_mentioned_p (b->head, b->pred->src->end)))
+		  || !label_mentioned_p (b->head, b->pred->src->end)))
 	    {
 	      rtx label = b->head;
 	      b->head = NEXT_INSN (b->head);

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

end of thread, other threads:[~2001-12-10  1:43 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-12-09 15:35 PATCH: Check all insns in fallthru to see if label is mentioned Richard Kenner
2001-12-09 17:37 ` John David Anglin
  -- strict thread matches above, loose matches on Subject: below --
2001-12-09 17:43 Richard Kenner
     [not found] <no.id>
2001-10-03 12:08 ` John David Anglin
2001-12-04 17:46   ` Richard Henderson
2001-12-08  9:23     ` John David Anglin
2001-12-09 16:12       ` Richard Henderson
2001-12-09 14:55 ` John David Anglin
2001-10-01  9:19 John David Anglin

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