Bug 29551 - FAIL: gcc.dg/tree-ssa/pr26421.c scan-tree-dump-times V_MAY_DEF 1
Summary: FAIL: gcc.dg/tree-ssa/pr26421.c scan-tree-dump-times V_MAY_DEF 1
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: tree-optimization (show other bugs)
Version: 4.3.0
: P3 normal
Target Milestone: 4.3.0
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-10-22 17:04 UTC by John David Anglin
Modified: 2007-08-20 10:31 UTC (History)
4 users (show)

See Also:
Host: hppa-unknown-linux-gnu
Target: hppa-unknown-linux-gnu
Build: hppa-unknown-linux-gnu
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John David Anglin 2006-10-22 17:04:17 UTC
This test has regressed.

Executing on host: /home/dave/gnu/gcc-4.3/objdir/gcc/xgcc -B/home/dave/gnu/gcc-4
.3/objdir/gcc/ /home/dave/gnu/gcc-4.3/gcc/gcc/testsuite/gcc.dg/tree-ssa/pr26421.
c   -O2 -fdump-tree-alias1-vops -fno-show-column -S  -o pr26421.s    (timeout =
300)
PASS: gcc.dg/tree-ssa/pr26421.c (test for excess errors)
FAIL: gcc.dg/tree-ssa/pr26421.c scan-tree-dump-times V_MAY_DEF 1
Comment 1 Richard Biener 2006-10-22 17:12:47 UTC
I think it's ok again, but it shows one weakness of the current NONLOCAL scheme:

foo ()
{
  struct Foo a;
  int D.1534;

<bb 2>:
  #   SFT.0_2 = V_MUST_DEF <SFT.0_1>;
  a.i = 1;
  #   SFT.0_6 = V_MAY_DEF <SFT.0_2>;
  #   NONLOCAL.6_7 = V_MAY_DEF <NONLOCAL.6_5>;
  bar (&a);
  #   VUSE <SFT.0_6>;
  D.1534_3 = a.i;
  return D.1534_3;

}

we should see that &a points to a and so no NONLOCAL var is necessary
here.
Comment 2 Richard Biener 2006-10-22 17:16:00 UTC
Adding
  p = &a
and using that produces

foo ()
{
  struct Foo * p;
  struct Foo a;
  int D.1535;

<bb 2>:
  #   SFT.2_2 = V_MUST_DEF <SFT.2_1>;
  a.i = 1;
  p_3 = &a;
  #   SFT.0_9 = V_MAY_DEF <SFT.0_6>;
  #   SFT.1_10 = V_MAY_DEF <SFT.1_7>;
  #   SFT.2_11 = V_MAY_DEF <SFT.2_2>;
  #   NONLOCAL.8_12 = V_MAY_DEF <NONLOCAL.8_8>;
  bar (p_3);
  #   VUSE <SFT.2_11>;
  D.1535_4 = a.i;
  return D.1535_4;

}

!?
Comment 3 Andrew Pinski 2006-10-22 17:30:26 UTC
http://gcc.gnu.org/ml/gcc-cvs/2006-10/msg00625.html

That just needs to merged back.
Comment 4 Daniel Berlin 2006-10-22 17:37:22 UTC
Subject: Re:  FAIL: gcc.dg/tree-ssa/pr26421.c scan-tree-dump-times V_MAY_DEF 1

On 22 Oct 2006 17:16:00 -0000, rguenth at gcc dot gnu dot org
<gcc-bugzilla@gcc.gnu.org> wrote:
>
>
> ------- Comment #2 from rguenth at gcc dot gnu dot org  2006-10-22 17:16 -------
> Adding
>   p = &a
> and using that produces
>
> foo ()
> {
>   struct Foo * p;
>   struct Foo a;
>   int D.1535;
>
> <bb 2>:
>   #   SFT.2_2 = V_MUST_DEF <SFT.2_1>;
>   a.i = 1;
>   p_3 = &a;
>   #   SFT.0_9 = V_MAY_DEF <SFT.0_6>;
>   #   SFT.1_10 = V_MAY_DEF <SFT.1_7>;
>   #   SFT.2_11 = V_MAY_DEF <SFT.2_2>;
>   #   NONLOCAL.8_12 = V_MAY_DEF <NONLOCAL.8_8>;
>   bar (p_3);
>   #   VUSE <SFT.2_11>;
>   D.1535_4 = a.i;
>   return D.1535_4;
>
> }
>
> !?
Escaping computation is a bit funky, but this is correct.
Comment 5 Daniel Berlin 2006-10-22 17:39:02 UTC
(In reply to comment #1)
> I think it's ok again, but it shows one weakness of the current NONLOCAL
> scheme:
> 
> foo ()
> {
>   struct Foo a;
>   int D.1534;
> 
> <bb 2>:
>   #   SFT.0_2 = V_MUST_DEF <SFT.0_1>;
>   a.i = 1;
>   #   SFT.0_6 = V_MAY_DEF <SFT.0_2>;
>   #   NONLOCAL.6_7 = V_MAY_DEF <NONLOCAL.6_5>;
>   bar (&a);
>   #   VUSE <SFT.0_6>;
>   D.1534_3 = a.i;
>   return D.1534_3;
> 
> }
> 
> we should see that &a points to a and so no NONLOCAL var is necessary
> here.
> 
The nonlocal variable is not necessary because it is unused elsewhere, *not* because you only pass something pointing to a.  If we had globals here, they could still be modified by the call to bar.


Comment 6 Manuel López-Ibáñez 2007-08-20 10:26:55 UTC
Is this still valid?
Comment 7 Andrew Pinski 2007-08-20 10:31:32 UTC
Fixed by:
2006-12-11  Aldy Hernandez  <aldyh@redhat.com>
            Diego Novillo  <dnovillo@redhat.com>
        * gcc.dg/tree-ssa/pr26421.c: Likewise