This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug tree-optimization/29680] Misscompilation of spec2006 gcc



------- Comment #4 from dberlin at gcc dot gnu dot org  2006-11-01 01:29 -------
Subject: Re:  Misscompilation of spec2006 gcc

>
> ------- Comment #3 from rakdver at gcc dot gnu dot org  2006-11-01 00:49 -------
> access_can_touch_variable determines that fde_13->dw_fde_cfi cannot touch
> cie_cfi_head; the list of virtual operands of the load thus becomes empty, and
> we insert SMT.48 for it.
>
> On *p, we cannot eliminate cie_cfi_head, and since the condition for insertion
> of SMT is formulated as
>
>   ...
>   ||none_added
>   || (TREE_CODE (var) == SYMBOL_MEMORY_TAG
>       && for_clobber
>       && SMT_USED_ALONE (var)))
>
> and for_clobber is only true on call operands, we do not insert SMT.  The lists
> of virtual operands thus become disjoint.
We should not insert the SMT here.
We are never supposed to use a bare SMT when it has aliases that we
can use (IE something has not been pruned).

In other words, we assume we can prune the same set of aliases
regardless of where the access occurs.  This *was* true before your
patch.

>
> Daniel, any idea how to fix this?  I do not quite understand the SMT_USED_ALONE
> stuff.  The condition above looks suspicious to me, especially the test for
> "for_clobber" -- why should we want to handle call virtual operands differently
> from any others?

SMT_USED_ALONE is used to eliminate the need for SMT operands on calls
when the only place the SMT is used is to be def'd at call sites (IE
it has no real uses).

The real problem here is that we can't get away with pruning some but
not all accesses to the same variables in the current tag scheme.

>Obviously, removing the for_clobber test would fix this
> problem, but I am not really sure this would be the right solution.
>
It would not. The test does not exist in isolation, you'd have to
remove the whole block for that |, and that wouldn't fix your problem.

I will work around this problem by teaching PTA about casts from
nonpointers to pointers, which will cause it to end up with a nonlocal
var in the set.

However, this is going to lose precision in this particular instance.

Until our tagging system is based on load/store interference, and not
variables this name can access, we will always run into these issues.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29680


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]