This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: update address taken: don't drop clobbers
- From: Richard Biener <richard dot guenther at gmail dot com>
- To: Jeff Law <law at redhat dot com>
- Cc: Michael Matz <matz at suse dot de>, Marc Glisse <marc dot glisse at inria dot fr>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 11 Jul 2014 10:14:13 +0200
- Subject: Re: update address taken: don't drop clobbers
- Authentication-results: sourceware.org; auth=none
- References: <alpine dot DEB dot 2 dot 02 dot 1406282350110 dot 31815 at stedding dot saclay dot inria dot fr> <CAFiYyc0fRhV09A3C2WT8yQ1ndp9dcyWntCVSPHzhwHb3tgNZLg at mail dot gmail dot com> <alpine dot LNX dot 2 dot 00 dot 1407101743300 dot 31863 at wotan dot suse dot de> <53BED9FE dot 1040701 at redhat dot com> <CAFiYyc3t5iNkrVWFz42YLU=e7HX8xgskpWe4g16deUX1vvyQag at mail dot gmail dot com>
On Fri, Jul 11, 2014 at 10:10 AM, Richard Biener
<richard.guenther@gmail.com> wrote:
> On Thu, Jul 10, 2014 at 8:22 PM, Jeff Law <law@redhat.com> wrote:
>> On 07/10/14 09:48, Michael Matz wrote:
>>>
>>> Hi,
>>>
>>> On Thu, 10 Jul 2014, Richard Biener wrote:
>>>
>>>> Apart from the out-of-SSA patch you proposed elsewhere a possibility
>>>> is to simply never mark undefined SSA names as
>>>> SSA_NAME_OCCURS_IN_ABNORMAL_PHI ... (or not mark those
>>>> as must-coalesce).
>>>
>>>
>>> The insight to note is, that undefined SSA names should really be
>>> coalesced with something (otherwise you lost an optimization opportunity),
>>> but it doesn't matter with _what_ each use of the undefined name is
>>> coalesced, you can even identify different uses of them with different SSA
>>> names (e.g. the LHS of each using stmt). Requires some change in the
>>> order things are done in out-of-ssa.
>>
>> The last part is what I hinted might be problematical. If some undefined
>> SSA_NAME appears on the RHS of two PHIs and we want to coalesce that
>> undefined SSA_NAME with the LHS of each of those PHIs, then the LHS of those
>> two PHIs must coalesce as well. At least that's my recollection of how all
>> that stuff worked.
>
> Yes, coalescing doesn't do "live-range splitting" to avoid coalescing the
> two PHI results. But they have to be coalesced anyway.
>
> I still think simply never recording conflicts for undefined SSA names
> is a proper "hack" to avoid this issue.
>
>> It was that realization that made me wonder if we should have a unique
>> SSA_NAME at each undefined use point.
>
> That would be unnecessarily expensive.
Btw, the bug must be already kind-of preexisting due to
bool
may_propagate_copy (tree dest, tree orig)
{
...
/* If ORIG flows in from an abnormal edge, it cannot be propagated. */
if (TREE_CODE (orig) == SSA_NAME
&& SSA_NAME_OCCURS_IN_ABNORMAL_PHI (orig)
/* If it is the default definition and an automatic variable then
we can though and it is important that we do to avoid
uninitialized regular copies. */
&& !(SSA_NAME_IS_DEFAULT_DEF (orig)
&& (SSA_NAME_VAR (orig) == NULL_TREE
|| TREE_CODE (SSA_NAME_VAR (orig)) == VAR_DECL)))
return false;
but it never replaces an abnormal SSA names with its default definition
due to the next check:
/* If DEST is an SSA_NAME that flows from an abnormal edge, then it
cannot be replaced. */
if (TREE_CODE (dest) == SSA_NAME
&& SSA_NAME_OCCURS_IN_ABNORMAL_PHI (dest))
return false;
still it might create overlapping life-ranges for abnormals.
Richard.
> Richard.
>
>> jeff
>>