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>,
	Alexandre Oliva <aoliva@redhat.com>
Cc: gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] Fix ICE in reset_unmarked_insns_debug_uses (PR middle-end/49308)
Date: Thu, 09 Jun 2011 08:04:00 -0000	[thread overview]
Message-ID: <20110609074759.GM17079@tyan-ft48-01.lab.bos.redhat.com> (raw)
In-Reply-To: <20110607122448.GA17079@tyan-ft48-01.lab.bos.redhat.com>

On Tue, Jun 07, 2011 at 02:24:49PM +0200, Jakub Jelinek wrote:
> Fixed thusly.  Additionally I've renamed a variable that was shadowing
> a variable of the same name, which confused me quite a bit when debugging
> it - I was expecting insn to be a DEBUG_INSN, while it was something
> completely different.
> Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?

Alex said on IRC this looks obvious to him and I agree, so I've installed
it to trunk as such.

> 2011-06-07  Jakub Jelinek  <jakub@redhat.com>
> 
> 	PR middle-end/49308
> 	* dce.c (reset_unmarked_insns_debug_uses): Avoid shadowing insn
> 	variable.  After resetting and rescanning insn continue with previous
> 	statement.
> 
> 	* gfortran.dg/pr49308.f90: New test.
> 
> --- gcc/dce.c.jj	2011-06-06 19:07:08.000000000 +0200
> +++ gcc/dce.c	2011-06-07 11:08:12.000000000 +0200
> @@ -514,11 +514,11 @@ reset_unmarked_insns_debug_uses (void)
>  	      struct df_link *defs;
>  	      for (defs = DF_REF_CHAIN (use); defs; defs = defs->next)
>  		{
> -		  rtx insn;
> +		  rtx ref_insn;
>  		  if (DF_REF_IS_ARTIFICIAL (defs->ref))
>  		    continue;
> -		  insn = DF_REF_INSN (defs->ref);
> -		  if (!marked_insn_p (insn))
> +		  ref_insn = DF_REF_INSN (defs->ref);
> +		  if (!marked_insn_p (ref_insn))
>  		    break;
>  		}
>  	      if (!defs)
> @@ -527,6 +527,7 @@ reset_unmarked_insns_debug_uses (void)
>  		 each of the DEFs?  */
>  	      INSN_VAR_LOCATION_LOC (insn) = gen_rtx_UNKNOWN_VAR_LOC ();
>  	      df_insn_rescan_debug_internal (insn);
> +	      break;
>  	    }
>  	}
>  }
> --- gcc/testsuite/gfortran.dg/pr49308.f90.jj	2011-06-07 11:39:39.000000000 +0200
> +++ gcc/testsuite/gfortran.dg/pr49308.f90	2011-06-07 11:30:25.000000000 +0200
> @@ -0,0 +1,28 @@
> +! PR middle-end/49308
> +! { dg-do compile }
> +! { dg-options "-O2 -funroll-loops -g" }
> +
> +subroutine foo(n, b, d, e)
> +  type t
> +    integer :: f
> +  end type t
> +  type s
> +    type(t), pointer :: g
> +  end type s
> +  type u
> +    type(s), dimension(:), pointer :: h
> +  end type
> +  integer :: i, k, n
> +  type(u), pointer :: a, e
> +  character(len=250) :: b, c, d
> +  logical :: l
> +  do i = 1, n
> +    j = i - 1
> +    if (j/=0) c = trim(b) // adjustl(d(j))
> +  end do
> +  a => e
> +  do k = 1, size(a%h)
> +     l = (a%h(k)%g%f == a%h(1)%g%f)
> +     if (.not.(l)) call bar()
> +  enddo
> +end subroutine foo

	Jakub

  reply	other threads:[~2011-06-09  7:48 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-30 12:15 fix left-over debug insns in DCE Alexandre Oliva
2011-06-02 15:26 ` Eric Botcazou
2011-06-03  1:16   ` Alexandre Oliva
2011-06-03 11:06     ` Eric Botcazou
2011-06-06  5:38       ` Alexandre Oliva
2011-06-06  6:05         ` Jakub Jelinek
2011-06-06  8:00         ` Eric Botcazou
2011-06-06 10:07           ` Alexandre Oliva
2011-06-06 13:28           ` Alexandre Oliva
2011-06-07 12:25             ` [PATCH] Fix ICE in reset_unmarked_insns_debug_uses (PR middle-end/49308) Jakub Jelinek
2011-06-09  8:04               ` Jakub Jelinek [this message]
2012-04-09  6:14             ` fix left-over debug insns in DCE Alexandre Oliva
2012-04-09 13:42               ` Eric Botcazou
2012-04-13 15:59                 ` Alexandre Oliva
2012-04-13 16:45                   ` Paolo Bonzini
2012-05-03 18:27                     ` [PR52983] eliminate autoinc from debug_insn locs (was: Re: fix left-over debug insns in DCE) Alexandre Oliva
2012-05-03 22:40                       ` [PR52983] eliminate autoinc from debug_insn locs Alexandre Oliva
2012-06-13  8:01                         ` Alexandre Oliva
2012-07-02 12:29                           ` Alexandre Oliva
2012-05-03 22:46                       ` [PR52983, PR48866] " Alexandre Oliva
2012-06-13  8:56                         ` Alexandre Oliva
2012-06-13  9:15                           ` Jakub Jelinek
2011-06-06  7:11       ` fix left-over debug insns in DCE Alexandre Oliva

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=20110609074759.GM17079@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).