This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/17252] [3.5 Regression] not marking char types as aliasing anything
- From: "dnovillo at redhat dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 31 Aug 2004 23:26:15 -0000
- Subject: [Bug tree-optimization/17252] [3.5 Regression] not marking char types as aliasing anything
- References: <20040831193546.17252.pinskia@gcc.gnu.org>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From dnovillo at redhat dot com 2004-08-31 23:26 -------
Subject: Re: [3.5 Regression] not marking
char types as aliasing anything
On Tue, 2004-08-31 at 19:21, pinskia at gcc dot gnu dot org wrote:
> ------- Additional Comments From pinskia at gcc dot gnu dot org 2004-08-31 23:21 -------
> Hmm, For the last example I think this patch caused it: <http://gcc.gnu.org/ml/gcc-patches/2003-12/
> msg01584.html>. but that code was removed in Feburary.
>
> Diego also I should note that Phil's regression hunter also can reproduce this bug (the one related to
> LIM).
>
<dnovillo> i think i know where the bug is. We have the case a=&a, there's a shortcut in may_alias_p that says 'a pointer can't possibly have its own address'. and we do check if the alias set of the variable is != 0, we don't check whether the alias set of *p is != 0. try this
<dnovillo> @@ -1532,7 +1531,8 @@ may_alias_p (tree ptr, HOST_WIDE_INT mem
<dnovillo> for PTR's alias set here, not its pointed-to type. We also can't
<dnovillo> do this check with relaxed aliasing enabled. */
<dnovillo> if (POINTER_TYPE_P (TREE_TYPE (var))
<dnovillo> - && var_alias_set != 0)
<dnovillo> + && var_alias_set != 0
<dnovillo> + && mem_alias_set != 0)
<dnovillo> {
<dnovillo> HOST_WIDE_INT ptr_alias_set = get_alias_set (ptr);
<dnovillo> if (ptr_alias_set == var_alias_set)
Diego.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17252