public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@redhat.com>
To: Eric Botcazou <ebotcazou@adacore.com>
Cc: gcc-patches@gcc.gnu.org, Alexandre Oliva <aoliva@redhat.com>
Subject: Re: [PATCH] Fix -fcompare-debug issue in reload1 (PR debug/46252)
Date: Wed, 03 Nov 2010 00:03:00 -0000	[thread overview]
Message-ID: <20101102234327.GN29412@tyan-ft48-01.lab.bos.redhat.com> (raw)
In-Reply-To: <201011022146.54997.ebotcazou@adacore.com>

On Tue, Nov 02, 2010 at 09:46:54PM +0100, Eric Botcazou wrote:
> > Yes, but after reload it also skips USE/CLOBBERs.  I'm not sure we want to
> > do that in cfgcleanup, in reload1.c it should be fine, as reload_completed
> > there is still 0, and in gcse.c it is fine too.
> 
> There is another flavor of *_active_insn in ifcvt.c. :-)  Would it work to:
>  - export last_active_insn from ifcvt.c,
>  - call it in cfgcleanup.c,
>  - replace the other uses of prev_real_insn by prev_active_insn,
>  - delete prev_real_insn,
>  - document that next_real_insn can return DEBUG_INSNs (and that its uses may 
> need to be audited wrt DEBUG_INSNs in a ??? note)?

So far I have done 3) from the above list, bootstrapped/regtested on
x86_64-linux and i686-linux, getting tired so I've postponed the rest for
later on, will try to get to it soon.  Ok?

2010-11-01  Jakub Jelinek  <jakub@redhat.com>

	PR debug/46252
	* reload1.c (delete_dead_insn): Use prev_active_insn instead of
	prev_real_insn.
	* gcse.c (insert_insn_end_basic_block): Likewise.

	* gcc.dg/pr46252.c: New test.

--- gcc/reload1.c.jj	2010-11-01 09:07:24.000000000 +0100
+++ gcc/reload1.c	2010-11-01 15:39:21.000000000 +0100
@@ -2112,7 +2112,7 @@ spill_failure (rtx insn, enum reg_class 
 static void
 delete_dead_insn (rtx insn)
 {
-  rtx prev = prev_real_insn (insn);
+  rtx prev = prev_active_insn (insn);
   rtx prev_dest;
 
   /* If the previous insn sets a register that dies in our insn, delete it
--- gcc/gcse.c.jj	2010-09-13 20:54:20.000000000 +0200
+++ gcc/gcse.c	2010-11-02 22:37:14.022260983 +0100
@@ -3574,7 +3574,7 @@ insert_insn_end_basic_block (struct expr
 	 the new instruction just before the tablejump.  */
       if (GET_CODE (PATTERN (insn)) == ADDR_VEC
 	  || GET_CODE (PATTERN (insn)) == ADDR_DIFF_VEC)
-	insn = prev_real_insn (insn);
+	insn = prev_active_insn (insn);
 
 #ifdef HAVE_cc0
       /* FIXME: 'twould be nice to call prev_cc0_setter here but it aborts
--- gcc/testsuite/gcc.dg/pr46252.c.jj	2010-11-01 16:12:22.000000000 +0100
+++ gcc/testsuite/gcc.dg/pr46252.c	2010-11-01 16:12:07.000000000 +0100
@@ -0,0 +1,15 @@
+/* PR debug/46252 */
+/* { dg-do compile } */
+/* { dg-options "-O -frerun-cse-after-loop -fno-tree-loop-optimize -funroll-loops -fcompare-debug" } */
+
+void
+foo (float *f)
+{
+  int i;
+  for (i = 0; i < 4; i++)
+    f[i] = i;
+  bar ();
+  for (i = 0; i < 4; i++)
+    if (f[i] != i)
+      __builtin_abort ();
+}


	Jakub

  reply	other threads:[~2010-11-02 23:43 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-01 19:31 Jakub Jelinek
2010-11-02 18:46 ` Eric Botcazou
2010-11-02 18:58   ` Jakub Jelinek
2010-11-02 19:51     ` Eric Botcazou
2010-11-02 20:09       ` Jakub Jelinek
2010-11-02 20:48         ` Eric Botcazou
2010-11-03  0:03           ` Jakub Jelinek [this message]
2010-11-03  8:32             ` Eric Botcazou
2010-11-04 16:16             ` Eric Botcazou

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20101102234327.GN29412@tyan-ft48-01.lab.bos.redhat.com \
    --to=jakub@redhat.com \
    --cc=aoliva@redhat.com \
    --cc=ebotcazou@adacore.com \
    --cc=gcc-patches@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).