On Mon, 29 Jun 2026, Filip Kastl wrote:
> Ah and one more detail: I'm working with all constraints involving uses and
> clobbers disabled (I don't call
> gimple-ssa-pta-constraints.cc:find_func_clobbers). I'm mentioning that in
> case
> you'd be confused that some constraints are missing.
>
> But the mystery of why Andersen decides to fill those sets remains.
>
> Filip
>
> On Mon 2026-06-29 11:57:49, Filip Kastl wrote:
> > Hi Richi,
> >
> > I have another question about PTA that may or may not be related to the last
> > week's question.
> >
> > I'm debugging a difference between what my Steensgaard-style solver and what
> > GCC's Andersen-style solver compute. In particular on my testcase (gcc_r
> > from
> > 2017 SPEC CPU) Steensgaard computes these sets...
> >
> > ix86_encode_section_info.clobber = { }
> > ix86_encode_section_info.use = { }
> > ix86_encode_section_info.result = { }
> > ix86_encode_section_info.arg0 = { NULL ANYTHING STRING ESCAPED N ...
> > ix86_encode_section_info.arg1 = { NULL ANYTHING STRING ESCAPED N ...
> > ix86_encode_section_info.arg2 = { }
> >
> > ...while Steensgaard computes this:
> >
> > ix86_encode_section_info.clobber = { NULL ANYTHING p p }
> > ix86_encode_section_info.use = { NULL ANYTHING p p }
> > ix86_encode_section_info.result = { NULL ANYTHING p p }
> > ix86_encode_section_info.arg0 = { NULL ANYTHING p p }
> > ix86_encode_section_info.arg1 = { NULL ANYTHING p p }
> > ix86_encode_section_info.arg2 = { NULL ANYTHING p p }
> >
> > To figure out how Andersen arrived at these sets I searched the IPA PTA dump
> > for constraints involving ix86_encode_section_info*. I found only these...
It's been some time since I had the Andersen code swapped in my brain,
so please bear with me eventually giving false hints ...
> > Generating constraints for ix86_encode_section_info/332
> > (ix86_encode_section_info)
> > _18 = *ix86_encode_section_info.arg1
> > _19 = *ix86_encode_section_info.arg1 + 64
> > _24 = *ix86_encode_section_info.arg0
> > *_26 + 5 = ix86_encode_section_info.arg0
> > _30 = *ix86_encode_section_info.arg0
> > _31 = *ix86_encode_section_info.arg0 + 1165
> > _32 = *ix86_encode_section_info.arg0 + 1160
> > *_38 + 5 = ix86_encode_section_info.arg0
> > _41 = *ix86_encode_section_info.arg0
> > _44 = *ix86_encode_section_info.arg0 + 472
> > _46 = *ix86_encode_section_info.arg0 + 24
> > _1 = *ix86_encode_section_info.arg0
> > _2 = *ix86_encode_section_info.arg0 + 24
> > _4 = *ix86_encode_section_info.arg0 + 472
> > _55 = *ix86_encode_section_info.arg0
> > _56 = *ix86_encode_section_info.arg0 + 1024
> > _60 = *ix86_encode_section_info.arg0 + 128
> > _17 = *ix86_encode_section_info.arg1 + 64
> >
> > ...which is strange. I don't see any assigning into
> > ix86_encode_section_info*
> > nor assigning &ix86_encode_section_info* into any other set. Shouldn't then
> > Andersen compute empty sets for all of these? (Although it is a good thing
> > that Andersen fills those sets. Otherwise, there would be a miscompilation.
> > I just want to understand what is it that my solver fails to do here.)
There must be call sites of ix86_encode_section_info/332 and I'd expect
those to have constraints like
ix86_encode_section_info.arg0 = ...
&ix86_encode_section_info itself would appear when the function is only
called indirectly ...
> > First explanation I came up with was expanding of ix86_encode_section_info
> > (the
> > fninfo) using '+ UNKNOWN' that we discussed last week. But
> > ix86_encode_section_info is not present in any constraint at all so it
> > cannot
> > be present in any pt set and therefore it cannot get expanded this way.
> >
> > Note that ix86_encode_section_info is only ever called indirectly through a
> > function pointer targetm.encode_section_info. That may be relevant here, I
> > think.
... as you say here. It might be only visible when creating
constraints for the targem initializer (a global). We might end up
with just feeding that from NONLOCAL and thus you'd get ESCAPED
at uses and ix86_encode_section_info should be escaped?
> >
> > Do you have any hunch about what is going on here? How does the Andersen
> > solver decide to fill those sets?
the indirect call.
Richard.
> >
> > Cheers,
> > Filip
> >
> >
> > Btw, here is another thing I'm confused about:
> >
> > ix86_encode_section_info is a non-pointer variable, eliminating edges.
> > ix86_encode_section_info.clobber is a non-pointer variable, eliminating
> > edges.
> > ix86_encode_section_info.use is a non-pointer variable, eliminating edges.
> > ix86_encode_section_info.result is a non-pointer variable, eliminating
> > edges.
> > ix86_encode_section_info.arg0 is a non-pointer variable, eliminating edges.
> > ix86_encode_section_info.arg1 is a non-pointer variable, eliminating edges.
> > ix86_encode_section_info.arg2 is a non-pointer variable, eliminating edges.
> > ix86_encode_section_info.arg1 is a non-pointer variable, ignoring
> > constraint:_18 = *ix86_encode_section_info.arg1
> > ix86_encode_section_info.arg1 is a non-pointer variable, ignoring
> > constraint:_19 = *ix86_encode_section_info.arg1 + 64
> > ix86_encode_section_info.arg0 is a non-pointer variable, ignoring
> > constraint:_24 = *ix86_encode_section_info.arg0
> > ix86_encode_section_info.arg0 is a non-pointer variable, ignoring
> > constraint:*_26 + 5 = ix86_encode_section_info.arg0
> > ix86_encode_section_info.arg0 is a non-pointer variable, ignoring
> > constraint:_30 = *ix86_encode_section_info.arg0
> > ix86_encode_section_info.arg0 is a non-pointer variable, ignoring
> > constraint:_31 = *ix86_encode_section_info.arg0 + 1165
> > ix86_encode_section_info.arg0 is a non-pointer variable, ignoring
> > constraint:_32 = *ix86_encode_section_info.arg0 + 1160
> > ix86_encode_section_info.arg0 is a non-pointer variable, ignoring
> > constraint:*_38 + 5 = ix86_encode_section_info.arg0
> > ix86_encode_section_info.arg0 is a non-pointer variable, ignoring
> > constraint:_41 = *ix86_encode_section_info.arg0
> > ix86_encode_section_info.arg0 is a non-pointer variable, ignoring
> > constraint:_44 = *ix86_encode_section_info.arg0 + 472
> > ix86_encode_section_info.arg0 is a non-pointer variable, ignoring
> > constraint:_46 = *ix86_encode_section_info.arg0 + 24
> > ix86_encode_section_info.arg0 is a non-pointer variable, ignoring
> > constraint:_1 = *ix86_encode_section_info.arg0
> > ix86_encode_section_info.arg0 is a non-pointer variable, ignoring
> > constraint:_2 = *ix86_encode_section_info.arg0 + 24
> > ix86_encode_section_info.arg0 is a non-pointer variable, ignoring
> > constraint:_4 = *ix86_encode_section_info.arg0 + 472
> > ix86_encode_section_info.arg0 is a non-pointer variable, ignoring
> > constraint:_55 = *ix86_encode_section_info.arg0
> > ix86_encode_section_info.arg0 is a non-pointer variable, ignoring
> > constraint:_56 = *ix86_encode_section_info.arg0 + 1024
> > ix86_encode_section_info.arg0 is a non-pointer variable, ignoring
> > constraint:_60 = *ix86_encode_section_info.arg0 + 128
> > ix86_encode_section_info.arg1 is a non-pointer variable, ignoring
> > constraint:_17 = *ix86_encode_section_info.arg1 + 64
> >
> > The Andersen dump says that ix86_encode_section_info.arg1 is a non-pointer
> > variable. That's weird since the second argument is of type rtx and that's
> > a
> > pointer to rtx_def.
>
--
Richard Biener <[email protected]>
SUSE Software Solutions Germany GmbH,
Frankenstrasse 146, 90461 Nuernberg, Germany;
GF: Jochen Jaser, Andrew McDonald, Werner Knoblich; (HRB 36809, AG Nuernberg)