This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/32328] [4.2/4.3 Regression] -fstrict-aliasing causes skipped code
- From: "dberlin at dberlin dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 16 Jul 2007 22:29:29 -0000
- Subject: [Bug tree-optimization/32328] [4.2/4.3 Regression] -fstrict-aliasing causes skipped code
- References: <bug-32328-14702@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #20 from dberlin at gcc dot gnu dot org 2007-07-16 22:29 -------
Subject: Re: [4.2/4.3 Regression] -fstrict-aliasing causes skipped code
Oh, for 4.2 you need to add make_constraint_to_escaped_var
On 16 Jul 2007 15:51:44 -0000, rguenth at gcc dot gnu dot org
<gcc-bugzilla@gcc.gnu.org> wrote:
>
>
> ------- Comment #19 from rguenth at gcc dot gnu dot org 2007-07-16 15:51 -------
> The backported patch causes
>
> FAIL: gcc.c-torture/execute/pr28778.c execution, -O2
> FAIL: gcc.c-torture/execute/pr28778.c execution, -Os
>
> DCE removes
>
> -
> -<L1>:;
> - list[3] = 42;
>
> we have one added constraint:
>
> blist.0_7 = blist_1
> +*blist.0_7 = &ANYTHING
> ESCAPED_VARS = blist.0_7
>
> IL differences after alias1 are
>
> @@ -251,12 +247,11 @@
> list[3] = 42;
> blist_6 = &list;
>
> - # list_8 = PHI <list_4(3), list_5(4)>;
> # blist_1 = PHI <blist_3(3), blist_6(4)>;
> <L2>:;
> blist.0_7 = (const GLint *) blist_1;
> - # list_10 = V_MAY_DEF <list_8>;
> - # NONLOCAL.44_11 = V_MAY_DEF <NONLOCAL.44_9>;
> + # NONLOCAL.44_10 = V_MAY_DEF <NONLOCAL.44_8>;
> + # SMT.45_11 = V_MAY_DEF <SMT.45_9>;
> aglChoosePixelFormat (blist.0_7);
> return;
This is something that was fixed on 4.3 by proper SMT pruning.
What is happening is it decides to prune the list access even though
it's illegal to do so.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32328