public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/26421]  New: tree-ssa-alias.c:find_used_portions considers foo(&var) use all elements of var
@ 2006-02-22 15:57 rguenth at gcc dot gnu dot org
  2006-02-22 16:02 ` [Bug tree-optimization/26421] " pinskia at gcc dot gnu dot org
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2006-02-22 15:57 UTC (permalink / raw)
  To: gcc-bugs

The function in question should ignore ADDR_EXPRs that appear inside CALL_EXPR
parameter lists so that we, for

typedef struct {
  int i;
  int j;
  int k;
} Foo;

void bar(Foo*);
void foo(void)
{
  Foo a;
  a.i = 1;
  bar(&a);
}

do not create SFTs for all elements of a, but only for the first.  This
will reduce clobbers at call sites from

<bb 2>:
  #   SFT.2_2 = V_MUST_DEF <SFT.2_1>;
  a.i = 1;
  #   SFT.0_5 = V_MAY_DEF <SFT.0_3>;
  #   SFT.1_6 = V_MAY_DEF <SFT.1_4>;
  #   SFT.2_7 = V_MAY_DEF <SFT.2_2>;
  bar (&a);

to

<bb 2>:
  #   SFT.2_2 = V_MUST_DEF <SFT.2_1>;
  a.i = 1;
  #   SFT.2_7 = V_MAY_DEF <SFT.2_2>;
  bar (&a);

it especially would reduce the amounts of SFTs we generate for gfortran
struct st_parm, which usually only gets a few fields written to and then
it's address is passed to a function.


-- 
           Summary: tree-ssa-alias.c:find_used_portions considers foo(&var)
                    use all elements of var
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Keywords: memory-hog, compile-time-hog, alias
          Severity: normal
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: rguenth at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26421


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

* [Bug tree-optimization/26421] tree-ssa-alias.c:find_used_portions considers foo(&var) use all elements of var
  2006-02-22 15:57 [Bug tree-optimization/26421] New: tree-ssa-alias.c:find_used_portions considers foo(&var) use all elements of var rguenth at gcc dot gnu dot org
@ 2006-02-22 16:02 ` pinskia at gcc dot gnu dot org
  2006-02-22 16:23 ` rguenth at gcc dot gnu dot org
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-02-22 16:02 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pinskia at gcc dot gnu dot org  2006-02-22 16:02 -------
Really for this example:
For this case V_MAY_DEF's are dead anyways at least for the other SFT's besides
the one for a.i.

Try thinking what about:
typedef struct {
  int i;
  int j;
  int k;
} Foo;

void bar(Foo*);
void bar1(Foo);
void foo(void)
{
  Foo a;
  a.i = 1;
  bar(&a);
  bar1(a);
}


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26421


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

* [Bug tree-optimization/26421] tree-ssa-alias.c:find_used_portions considers foo(&var) use all elements of var
  2006-02-22 15:57 [Bug tree-optimization/26421] New: tree-ssa-alias.c:find_used_portions considers foo(&var) use all elements of var rguenth at gcc dot gnu dot org
  2006-02-22 16:02 ` [Bug tree-optimization/26421] " pinskia at gcc dot gnu dot org
@ 2006-02-22 16:23 ` rguenth at gcc dot gnu dot org
  2006-02-22 21:32 ` rguenth at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2006-02-22 16:23 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from rguenth at gcc dot gnu dot org  2006-02-22 16:23 -------
I get

<bb 2>:
  #   SFT.0D.1534_2 = V_MUST_DEF <SFT.0D.1534_1>;
  aD.1532.iD.1521 = 1;
  #   SFT.0D.1534_3 = V_MAY_DEF <SFT.0D.1534_2>;
  bar (&aD.1532);
  #   SFT.0D.1534_4 = V_MAY_DEF <SFT.0D.1534_3>;
  bar2 (aD.1532);

for this case.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26421


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

* [Bug tree-optimization/26421] tree-ssa-alias.c:find_used_portions considers foo(&var) use all elements of var
  2006-02-22 15:57 [Bug tree-optimization/26421] New: tree-ssa-alias.c:find_used_portions considers foo(&var) use all elements of var rguenth at gcc dot gnu dot org
  2006-02-22 16:02 ` [Bug tree-optimization/26421] " pinskia at gcc dot gnu dot org
  2006-02-22 16:23 ` rguenth at gcc dot gnu dot org
@ 2006-02-22 21:32 ` rguenth at gcc dot gnu dot org
  2006-02-23 13:45 ` rguenth at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2006-02-22 21:32 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from rguenth at gcc dot gnu dot org  2006-02-22 21:32 -------
Patch posted, but now stdarg-5.c ICEs.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dberlin at gcc dot gnu dot
                   |                            |org
                URL|                            |http://gcc.gnu.org/ml/gcc-
                   |                            |patches/2006-
                   |                            |02/msg01781.html
           Keywords|                            |patch


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26421


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

* [Bug tree-optimization/26421] tree-ssa-alias.c:find_used_portions considers foo(&var) use all elements of var
  2006-02-22 15:57 [Bug tree-optimization/26421] New: tree-ssa-alias.c:find_used_portions considers foo(&var) use all elements of var rguenth at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2006-02-22 21:32 ` rguenth at gcc dot gnu dot org
@ 2006-02-23 13:45 ` rguenth at gcc dot gnu dot org
  2006-02-23 15:00 ` patchapp at dberlin dot org
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2006-02-23 13:45 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from rguenth at gcc dot gnu dot org  2006-02-23 13:45 -------
ICE is because of PR26439


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  BugsThisDependsOn|                            |26439
         AssignedTo|unassigned at gcc dot gnu   |rguenth at gcc dot gnu dot
                   |dot org                     |org
             Status|UNCONFIRMED                 |ASSIGNED
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2006-02-23 13:45:49
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26421


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

* [Bug tree-optimization/26421] tree-ssa-alias.c:find_used_portions considers foo(&var) use all elements of var
  2006-02-22 15:57 [Bug tree-optimization/26421] New: tree-ssa-alias.c:find_used_portions considers foo(&var) use all elements of var rguenth at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2006-02-23 13:45 ` rguenth at gcc dot gnu dot org
@ 2006-02-23 15:00 ` patchapp at dberlin dot org
  2006-02-26 16:19 ` rguenth at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: patchapp at dberlin dot org @ 2006-02-23 15:00 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from patchapp at dberlin dot org  2006-02-23 15:00 -------
Subject: Bug number PR26421

A patch for this bug has been added to the patch tracker.
The mailing list url for the patch is
http://gcc.gnu.org/ml/gcc-patches/2006-02/msg01803.html


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26421


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

* [Bug tree-optimization/26421] tree-ssa-alias.c:find_used_portions considers foo(&var) use all elements of var
  2006-02-22 15:57 [Bug tree-optimization/26421] New: tree-ssa-alias.c:find_used_portions considers foo(&var) use all elements of var rguenth at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2006-02-23 15:00 ` patchapp at dberlin dot org
@ 2006-02-26 16:19 ` rguenth at gcc dot gnu dot org
  2006-02-26 21:11 ` rguenth at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2006-02-26 16:19 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from rguenth at gcc dot gnu dot org  2006-02-26 16:17 -------
updated patch was posted.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                URL|http://gcc.gnu.org/ml/gcc-  |http://gcc.gnu.org/ml/gcc-
                   |patches/2006-               |patches/2006-
                   |02/msg01781.html            |02/msg01803.html


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26421


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

* [Bug tree-optimization/26421] tree-ssa-alias.c:find_used_portions considers foo(&var) use all elements of var
  2006-02-22 15:57 [Bug tree-optimization/26421] New: tree-ssa-alias.c:find_used_portions considers foo(&var) use all elements of var rguenth at gcc dot gnu dot org
                   ` (5 preceding siblings ...)
  2006-02-26 16:19 ` rguenth at gcc dot gnu dot org
@ 2006-02-26 21:11 ` rguenth at gcc dot gnu dot org
  2006-02-26 21:38 ` rguenth at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2006-02-26 21:11 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from rguenth at gcc dot gnu dot org  2006-02-26 21:02 -------
Subject: Bug 26421

Author: rguenth
Date: Sun Feb 26 21:02:43 2006
New Revision: 111461

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=111461
Log:
2006-02-26  Richard Guenther  <rguenther@suse.de>

        PR tree-optimization/26421
        * tree-ssa-alias.c (find_used_portions): Don't treat parameters
        in function calls that are ADDR_EXPRs as using the whole structure.

        * gcc.dg/tree-ssa/pr26421.c: New testcase.

Added:
    trunk/gcc/testsuite/gcc.dg/tree-ssa/pr26421.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/tree-ssa-alias.c


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26421


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

* [Bug tree-optimization/26421] tree-ssa-alias.c:find_used_portions considers foo(&var) use all elements of var
  2006-02-22 15:57 [Bug tree-optimization/26421] New: tree-ssa-alias.c:find_used_portions considers foo(&var) use all elements of var rguenth at gcc dot gnu dot org
                   ` (6 preceding siblings ...)
  2006-02-26 21:11 ` rguenth at gcc dot gnu dot org
@ 2006-02-26 21:38 ` rguenth at gcc dot gnu dot org
  2006-02-27  3:42 ` pinskia at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2006-02-26 21:38 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from rguenth at gcc dot gnu dot org  2006-02-26 21:19 -------
Fixed.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26421


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

* [Bug tree-optimization/26421] tree-ssa-alias.c:find_used_portions considers foo(&var) use all elements of var
  2006-02-22 15:57 [Bug tree-optimization/26421] New: tree-ssa-alias.c:find_used_portions considers foo(&var) use all elements of var rguenth at gcc dot gnu dot org
                   ` (7 preceding siblings ...)
  2006-02-26 21:38 ` rguenth at gcc dot gnu dot org
@ 2006-02-27  3:42 ` pinskia at gcc dot gnu dot org
  2006-02-28 14:24 ` pinskia at gcc dot gnu dot org
  2006-02-28 14:40 ` rguenth at gcc dot gnu dot org
  10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-02-27  3:42 UTC (permalink / raw)
  To: gcc-bugs



-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.2.0


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26421


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

* [Bug tree-optimization/26421] tree-ssa-alias.c:find_used_portions considers foo(&var) use all elements of var
  2006-02-22 15:57 [Bug tree-optimization/26421] New: tree-ssa-alias.c:find_used_portions considers foo(&var) use all elements of var rguenth at gcc dot gnu dot org
                   ` (8 preceding siblings ...)
  2006-02-27  3:42 ` pinskia at gcc dot gnu dot org
@ 2006-02-28 14:24 ` pinskia at gcc dot gnu dot org
  2006-02-28 14:40 ` rguenth at gcc dot gnu dot org
  10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-02-28 14:24 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from pinskia at gcc dot gnu dot org  2006-02-28 14:19 -------
This testcase fails on the mainline.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26421


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

* [Bug tree-optimization/26421] tree-ssa-alias.c:find_used_portions considers foo(&var) use all elements of var
  2006-02-22 15:57 [Bug tree-optimization/26421] New: tree-ssa-alias.c:find_used_portions considers foo(&var) use all elements of var rguenth at gcc dot gnu dot org
                   ` (9 preceding siblings ...)
  2006-02-28 14:24 ` pinskia at gcc dot gnu dot org
@ 2006-02-28 14:40 ` rguenth at gcc dot gnu dot org
  10 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2006-02-28 14:40 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #10 from rguenth at gcc dot gnu dot org  2006-02-28 14:40 -------
It will stop failing once I revert my bandaid fix, but I'll just fix the
testcase.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26421


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

end of thread, other threads:[~2006-02-28 14:40 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-02-22 15:57 [Bug tree-optimization/26421] New: tree-ssa-alias.c:find_used_portions considers foo(&var) use all elements of var rguenth at gcc dot gnu dot org
2006-02-22 16:02 ` [Bug tree-optimization/26421] " pinskia at gcc dot gnu dot org
2006-02-22 16:23 ` rguenth at gcc dot gnu dot org
2006-02-22 21:32 ` rguenth at gcc dot gnu dot org
2006-02-23 13:45 ` rguenth at gcc dot gnu dot org
2006-02-23 15:00 ` patchapp at dberlin dot org
2006-02-26 16:19 ` rguenth at gcc dot gnu dot org
2006-02-26 21:11 ` rguenth at gcc dot gnu dot org
2006-02-26 21:38 ` rguenth at gcc dot gnu dot org
2006-02-27  3:42 ` pinskia at gcc dot gnu dot org
2006-02-28 14:24 ` pinskia at gcc dot gnu dot org
2006-02-28 14:40 ` rguenth at gcc dot gnu dot org

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).