This is the mail archive of the gcc-patches@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]

Re: Fix alias.c wrt aliases and anchors


Hello!

>> Yeah, I think handling anchors is a good thing.  It just seems that
>> logically the correctness fix is to replace:
>>
>>  /* Label and normal symbol are never the same. */
>>    if (x_decl != y_decl)
>>    return 0;
>>  return offset_overlap_p (c, xsize, ysize);
>>
>> with something like:
>>
>>  if (XSTR (x, 0) == XSTR (y, 0))
>>    return offset_overlap_p (c, xsize, ysize);
>>  /* Symbols might conflict.  */
>>  return -1;
>>
>> Handling anchors would then be a very useful optimisation on top of that.
>
> Ah, OK, now I get your point :)
> Yep, I have no problem beling conservative for non-anchor cases !SYMBOL_REF_DECL case.
> Pretty much all cases that matter are IMO either anchors or SYMBOL_REF_DECL != NULL.
> (i.e. user variables).
>
> I will update the patch and also look into the Alpha AND issues.

I have another version of the patch that deals with AND addresses in
testing, please see attached. The difference from the previous patch
is:

@@ -2339,6 +2337,12 @@ memrefs_conflict_p (int xsize, rtx x, int ysize, r
       /* If both decls are the same, decide by offsets.  */
       if (cmp == 1)
         return offset_overlap_p (c, xsize, ysize);
+      /* Assume a potential overlap for symbolic addresses that went
+        through alignment adjustments (i.e., that have negative
+        sizes), because we can't know how far they are from each
+        other.  */
+      if (xsize < 0 || ysize < 0)
+       return -1;
       /* If decls are different or we know by offsets that there is no overlap,
         we win.  */
       if (!cmp || !offset_overlap_p (c, xsize, ysize))

So, we simply return unknown from memrefs_conflict_p when realignment
is in play.

(We still need early return for AND addresses in base_alias_check, though).

Uros.

Attachment: p.diff.txt
Description: Text document


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