This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[jh@suse.cz: [patches] Re: [Daniel Berlin <dan@cgsoftware.com>] Invalid memory access in loop_p]
- To: gcc-patches at gcc dot gnu dot org, rth at cygnus dot com
- Subject: [jh@suse.cz: [patches] Re: [Daniel Berlin <dan@cgsoftware.com>] Invalid memory access in loop_p]
- From: Jan Hubicka <jh at suse dot cz>
- Date: Thu, 26 Jul 2001 20:54:49 +0200
----- Forwarded message from Jan Hubicka <jh@suse.cz> -----
X-Authentication-Warning: atrey.karlin.mff.cuni.cz: Host qmailr@[207.174.4.53] claimed to be mail.x86-64.org
Mailing-List: contact patches-help@x86-64.org; run by ezmlm
Precedence: bulk
X-No-Archive: yes
List-Post: <mailto:patches@x86-64.org>
List-Help: <mailto:patches-help@x86-64.org>
List-Unsubscribe: <mailto:patches-unsubscribe@x86-64.org>
List-Subscribe: <mailto:patches-subscribe@x86-64.org>
Delivered-To: mailing list patches@x86-64.org
Date: Thu, 26 Jul 2001 20:18:05 +0200
From: Jan Hubicka <jh@suse.cz>
To: Andreas Jaeger <aj@suse.de>, rth@cygnus.com, patches@x86-64.org
User-Agent: Mutt/1.3.15i
In-Reply-To: <u8vgkf5zxf.fsf@gromit.moeb>; from aj@suse.de on Thu, Jul 26, 2001 at 08:05:16PM +0200
Subject: [patches] Re: [Daniel Berlin <dan@cgsoftware.com>] Invalid memory access in loop_p
>
> We have an edge from the entry block to 0.
> So it goes to access pre[-1].
> Whoops.
>
> I don't have time to figure out what the right fix is, i'm just trying
> to give someone some context to fix the bug.
> the bug.
>
> *************** loop_p ()
> *** 2119,2124 ****
> --- 2118,2124 ----
> else
> {
> <Right here, src == ENTRY_BLOCK_PTR >
> if (dest != EXIT_BLOCK_PTR
> && pre[src->index] >= pre[dest->index]
> && post[dest->index] == 0)
> break;
I guess it is as easy as the following. The pre-order number of entry block
is -1 in the notion, so the test should do the trick.
Thu Jul 26 20:16:50 CEST 2001 Jan Hubicka <jh@suse.cz>
* alias.c (loop_p): Avoid uninitialized memory access.
Index: alias.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/alias.c,v
retrieving revision 1.128
diff -c -3 -p -r1.128 alias.c
*** alias.c 2001/07/25 14:38:29 1.128
--- alias.c 2001/07/26 18:15:40
*************** loop_p ()
*** 2118,2124 ****
}
else
{
! if (dest != EXIT_BLOCK_PTR
&& pre[src->index] >= pre[dest->index]
&& post[dest->index] == 0)
break;
--- 2118,2124 ----
}
else
{
! if (dest != EXIT_BLOCK_PTR && src != ENTRY_BLOCK_PTR
&& pre[src->index] >= pre[dest->index]
&& post[dest->index] == 0)
break;
----- End forwarded message -----