This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: -fstrict-aliasing fixes 6/6: permit inlining of comdats
- From: Jan Hubicka <hubicka at ucw dot cz>
- To: Richard Biener <rguenther at suse dot de>
- Cc: Jan Hubicka <hubicka at ucw dot cz>, gcc-patches at gcc dot gnu dot org
- Date: Mon, 7 Dec 2015 19:53:23 +0100
- Subject: Re: -fstrict-aliasing fixes 6/6: permit inlining of comdats
- Authentication-results: sourceware.org; auth=none
- References: <20151204073733 dot GA42295 at kam dot mff dot cuni dot cz> <alpine dot LSU dot 2 dot 11 dot 1512041208360 dot 4884 at t29 dot fhfr dot qr> <20151204165741 dot GA20023 at kam dot mff dot cuni dot cz> <20151204180425 dot GA55053 at kam dot mff dot cuni dot cz> <20151204180811 dot GB55053 at kam dot mff dot cuni dot cz> <alpine dot LSU dot 2 dot 11 dot 1512070918090 dot 4884 at t29 dot fhfr dot qr>
> On Fri, 4 Dec 2015, Jan Hubicka wrote:
>
> > Hi,
> > this is the patch for fold-const.c. Can you think of some testcase for the
> > MR_DEPENDENCE_CLIQUE comparsion? I am not that familiar with the code to
> > be able to construct it :(
>
> With ICF it would involve a variant using restrict args vs.
> non-restrict args. For other optimizers it's more difficult
> to construct a testcase that would fail. But if any alias related
> compare is necessary in operand_equal_p then the dependence check
> is required as well.
>
> > Bootstrapped/regtested x86_64-linux, OK?
>
> Ok.
OK, thanks.
Comitted w/o a testcase for now. Once ipa-icf-gimple transition to operand_equal_p
is complete, we can invent a testcase. Obviously restrict args are checked earlier
independently of the operand comparsion ATM, so this testcase would not fail either.
Honza
>
> Thanks,
> Richard.
>
> > Honza
> >
> > * fold-const.c (operand_equal_p): Do not use flag_strict_aliasing.
> > Index: fold-const.c
> > ===================================================================
> > --- fold-const.c (revision 231290)
> > +++ fold-const.c (working copy)
> > @@ -2987,14 +2987,13 @@ operand_equal_p (const_tree arg0, const_
> > flags)))
> > return 0;
> > /* Verify that accesses are TBAA compatible. */
> > - if (flag_strict_aliasing
> > - && (!alias_ptr_types_compatible_p
> > - (TREE_TYPE (TREE_OPERAND (arg0, 1)),
> > - TREE_TYPE (TREE_OPERAND (arg1, 1)))
> > - || (MR_DEPENDENCE_CLIQUE (arg0)
> > - != MR_DEPENDENCE_CLIQUE (arg1))
> > - || (MR_DEPENDENCE_BASE (arg0)
> > - != MR_DEPENDENCE_BASE (arg1))))
> > + if (!alias_ptr_types_compatible_p
> > + (TREE_TYPE (TREE_OPERAND (arg0, 1)),
> > + TREE_TYPE (TREE_OPERAND (arg1, 1)))
> > + || (MR_DEPENDENCE_CLIQUE (arg0)
> > + != MR_DEPENDENCE_CLIQUE (arg1))
> > + || (MR_DEPENDENCE_BASE (arg0)
> > + != MR_DEPENDENCE_BASE (arg1)))
> > return 0;
> > /* Verify that alignment is compatible. */
> > if (TYPE_ALIGN (TREE_TYPE (arg0))