public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Problem with SSA inlining and default defs
@ 2007-12-16 18:01 Eric Botcazou
  2007-12-16 18:10 ` Jakub Jelinek
  0 siblings, 1 reply; 4+ messages in thread
From: Eric Botcazou @ 2007-12-16 18:01 UTC (permalink / raw)
  To: gcc

[-- Attachment #1: Type: text/plain, Size: 679 bytes --]

Hi,

How SSA inlining and default defs for uninitialized variables are supposed to 
interact?  Suppose you have the following situation

    BB0 ...
     |   \
(ab) |    BB1 s_2 = f(s_1(D))
     |   /
    BB2 s_3 = PHI <s_1(D), s2>

in a function that gets inlined into a loop.  The liveness of s_1(D) in BB0 
will propagate to BB2 along the backwards edge and you get overlapping live 
ranges for s_1(D) and s_3.  If s_1(D) is SSA_NAME_OCCURS_IN_ABNORMAL_PHI, the 
compilation will abort during SSA coalescing because they must be coalesced.

This is on the mainline, Ada testcase attached, run 'gnatchop' on it and 
compile at -O -gnatp.

Thanks in advance.

-- 
Eric Botcazou

[-- Attachment #2: p.ada --]
[-- Type: text/plain, Size: 508 bytes --]

package Q is

    procedure Read(S : out Integer);
    procedure Restore(S : in out Integer);

end Q;
package P is

    type Int_Ptr is access all Integer;
    procedure Exec(P : Int_Ptr);

end P;
with Q; use Q;

package body P is

    procedure Lock is
        S : Integer;
    begin
        Read(S);
        Restore(S);
    exception
        when others => Restore(S);
    end;

    procedure Exec(P : Int_Ptr) is
    begin
        while P /= NULL loop
            Lock;
        end loop;
    end;

end P;

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Problem with SSA inlining and default defs
  2007-12-16 18:01 Problem with SSA inlining and default defs Eric Botcazou
@ 2007-12-16 18:10 ` Jakub Jelinek
  2007-12-16 18:27   ` Eric Botcazou
  0 siblings, 1 reply; 4+ messages in thread
From: Jakub Jelinek @ 2007-12-16 18:10 UTC (permalink / raw)
  To: Eric Botcazou; +Cc: gcc

On Sun, Dec 16, 2007 at 06:54:29PM +0100, Eric Botcazou wrote:
> How SSA inlining and default defs for uninitialized variables are supposed to 
> interact?  Suppose you have the following situation
> 
>     BB0 ...
>      |   \
> (ab) |    BB1 s_2 = f(s_1(D))
>      |   /
>     BB2 s_3 = PHI <s_1(D), s2>
> 
> in a function that gets inlined into a loop.  The liveness of s_1(D) in BB0 
> will propagate to BB2 along the backwards edge and you get overlapping live 
> ranges for s_1(D) and s_3.  If s_1(D) is SSA_NAME_OCCURS_IN_ABNORMAL_PHI, the 
> compilation will abort during SSA coalescing because they must be coalesced.

This sounds like PR31081.

	Jakub

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Problem with SSA inlining and default defs
  2007-12-16 18:10 ` Jakub Jelinek
@ 2007-12-16 18:27   ` Eric Botcazou
  2007-12-16 19:45     ` Jakub Jelinek
  0 siblings, 1 reply; 4+ messages in thread
From: Eric Botcazou @ 2007-12-16 18:27 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: gcc

> This sounds like PR31081.

Indeed, the C++ testcase is the exact translation of my Ada testcase. :-)

The problem seems to arise relatively often in Ada, I think the PR should be 
made "critical".

-- 
Eric Botcazou

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Problem with SSA inlining and default defs
  2007-12-16 18:27   ` Eric Botcazou
@ 2007-12-16 19:45     ` Jakub Jelinek
  0 siblings, 0 replies; 4+ messages in thread
From: Jakub Jelinek @ 2007-12-16 19:45 UTC (permalink / raw)
  To: Eric Botcazou; +Cc: gcc

On Sun, Dec 16, 2007 at 07:11:49PM +0100, Eric Botcazou wrote:
> > This sounds like PR31081.
> 
> Indeed, the C++ testcase is the exact translation of my Ada testcase. :-)
> 
> The problem seems to arise relatively often in Ada, I think the PR should be 
> made "critical".

Yeah, to me this looks like the most worrisome P1 4.3 regression.

	Jakub

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2007-12-16 19:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-12-16 18:01 Problem with SSA inlining and default defs Eric Botcazou
2007-12-16 18:10 ` Jakub Jelinek
2007-12-16 18:27   ` Eric Botcazou
2007-12-16 19:45     ` Jakub Jelinek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).