This is the mail archive of the 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: PR 23551: why should we coalesce inlined variables?

On Jul  9, 2007, "Richard Guenther" <> wrote:

> On 7/9/07, Alexandre Oliva <> wrote:
>> On Jul  9, 2007, "Richard Guenther" <> wrote:
>> > I suggested to have a on-the-side mapping (you need it for each
>> > function), like a hashtable that maps the SSA_NAME version to a list
>> > of user-visible DECLs.
>> I don't think it's that simple.  Consider the example I gave at
>> How do you envision it to work with an on-the-side mapping?  I don't
>> see how it could work, but I'd love to be proven wrong, because it
>> would indeed make my current assignment much simpler.

> If you have a list of variables per SSA_NAME then that problem is
> non-existant.

I don't see how.  Maybe it's not clear that, in the example above, foo
does have an initial value different from that of bar.

So, when we optimize away the assignment to foo at 1:, we can only
emit debug info for that change at that point if we keep some
annotation at that point indicating the change.

And if we don't optimize that assignment away, we end up with a copy
that we could have easily avoided.

You see what I'm getting at?  If I'm reading your suggestion right,
we might end up with something like: (all a single basic block)

   foo = <initial value>;
0: bar = <expr>;
1: foo = bar;
2: bar++;
3: foo--;
   use (bar)
   use (foo)

transformed to:

   foo_1 = <initial value>; # (foo)
0: bar_1 = <expr>; # (bar, foo)
1: ...
   use (bar_1 + 1);
   use (bar_1 - 1);

and then, how would we emit correct debug info for foo, or for bar at

Alexandre Oliva
FSF Latin America Board Member
Red Hat Compiler Engineer   aoliva@{,}
Free Software Evangelist  oliva@{,}

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