public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/11761] New: [tree-ssa] arrays inside classes not optimised away
@ 2003-08-01 15:04 stefaandr at hotmail dot com
  2003-08-01 15:12 ` [Bug c/11761] " pinskia at physics dot uc dot edu
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: stefaandr at hotmail dot com @ 2003-08-01 15:04 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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

           Summary: [tree-ssa] arrays inside classes not optimised away
           Product: gcc
           Version: tree-ssa
            Status: UNCONFIRMED
          Severity: minor
          Priority: P2
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: stefaandr at hotmail dot com
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i386-redhat-linux
  GCC host triplet: i386-redhat-linux
GCC target triplet: i386-redhat-linux

Follow-up of 9059, in which arrays weren't optimised away, which is currently
fixed in tree-ssa.  In the 3 lines of code hereunder the unused array is inside
a class, which again seems to leave the array unbothered.  If the array is
replaced by a regular int or similar, it is optimised away though.

extern void t();
struct p { int a[5]; p() { a[3] = 1234; } };
int main() { p p1; t(); };

Reading specs from /esat/quendi/gcc/lib/gcc-lib/i686-pc-linux-gnu/3.5-tree-ssa/specs
Configured with: ../gcc/configure --prefix=/esat/quendi/gcc --enable-languages=c,c++
Thread model: posix
gcc version 3.5-tree-ssa 20030731 (merged 20030722)
 /esat/quendi/gcc/lib/gcc-lib/i686-pc-linux-gnu/3.5-tree-ssa/cc1plus -quiet -v
-D_GNU_SOURCE t4.cpp -quiet -dumpbase t4.cpp -mtune=pentiumpro -auxbase-strip
t4.s -O3 -version -o t4.s
ignoring nonexistent directory "/esat/quendi/gcc/i686-pc-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 /esat/quendi/gcc/include/c++/3.5-tree-ssa
 /esat/quendi/gcc/include/c++/3.5-tree-ssa/i686-pc-linux-gnu
 /esat/quendi/gcc/include/c++/3.5-tree-ssa/backward
 /usr/local/include
 /esat/quendi/gcc/include
 /esat/quendi/gcc/lib/gcc-lib/i686-pc-linux-gnu/3.5-tree-ssa/include
 /usr/include
End of search list.
GNU C++ version 3.5-tree-ssa 20030731 (merged 20030722) (i686-pc-linux-gnu)
        compiled by GNU C version 3.3.
GGC heuristics: --param ggc-min-expand=55 --param ggc-min-heapsize=48056


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

* [Bug c/11761] [tree-ssa] arrays inside classes not optimised away
  2003-08-01 15:04 [Bug c/11761] New: [tree-ssa] arrays inside classes not optimised away stefaandr at hotmail dot com
@ 2003-08-01 15:12 ` pinskia at physics dot uc dot edu
  2003-08-01 15:23 ` dnovillo at redhat dot com
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at physics dot uc dot edu @ 2003-08-01 15:12 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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


pinskia at physics dot uc dot edu changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|minor                       |enhancement
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
           Keywords|                            |pessimizes-code
   Last reconfirmed|0000-00-00 00:00:00         |2003-08-01 15:12:27
               date|                            |
   Target Milestone|3.4                         |tree-ssa


------- Additional Comments From pinskia at physics dot uc dot edu  2003-08-01 15:12 -------
I can confirm this on tree-ssa branch (20030801).
output from -fdump-tree-all:
int main() ()
{
  {
    struct p p1;

    {
      struct p * const this;

      this = (struct p * const)&p1;
      this->a[3] = 1234
    };
    t ()
  };
  return 0;
}

Looks like the store in this->a[3] is not being optimized away so the variable this is not being 
optimized away which causes p1 not be optimize away.


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

* [Bug c/11761] [tree-ssa] arrays inside classes not optimised away
  2003-08-01 15:04 [Bug c/11761] New: [tree-ssa] arrays inside classes not optimised away stefaandr at hotmail dot com
  2003-08-01 15:12 ` [Bug c/11761] " pinskia at physics dot uc dot edu
@ 2003-08-01 15:23 ` dnovillo at redhat dot com
  2003-10-26 21:20 ` [Bug optimization/11761] " pinskia at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: dnovillo at redhat dot com @ 2003-08-01 15:23 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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



------- Additional Comments From dnovillo at redhat dot com  2003-08-01 15:23 -------
Subject: Re:  [tree-ssa] arrays inside classes not optimised
	away


Right.  Tree SSA does not deal with arrays yet.

There are plans for scalarization and dead storage elimination that
should be able to deal with cases like this.


Diego.


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

* [Bug optimization/11761] [tree-ssa] arrays inside classes not optimised away
  2003-08-01 15:04 [Bug c/11761] New: [tree-ssa] arrays inside classes not optimised away stefaandr at hotmail dot com
  2003-08-01 15:12 ` [Bug c/11761] " pinskia at physics dot uc dot edu
  2003-08-01 15:23 ` dnovillo at redhat dot com
@ 2003-10-26 21:20 ` pinskia at gcc dot gnu dot org
  2004-01-17  4:32 ` [Bug optimization/11761] " pinskia at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2003-10-26 21:20 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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


pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|2003-08-15 03:44:04         |2003-10-26 20:32:09
               date|                            |


------- Additional Comments From pinskia at gcc dot gnu dot org  2003-10-26 20:32 -------
This is semi fixed, now gcc just has to remove p1:
;; Function int main() (main)

int main() ()
{
  {
    struct p p1;

    {
      (void)0
    };
    t ();
  };
  return 0;;
}


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

* [Bug optimization/11761] arrays inside classes not optimised away
  2003-08-01 15:04 [Bug c/11761] New: [tree-ssa] arrays inside classes not optimised away stefaandr at hotmail dot com
                   ` (2 preceding siblings ...)
  2003-10-26 21:20 ` [Bug optimization/11761] " pinskia at gcc dot gnu dot org
@ 2004-01-17  4:32 ` pinskia at gcc dot gnu dot org
  2004-01-17  5:31 ` dnovillo at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-01-17  4:32 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-01-17 04:32 -------
Not really a tree-ssa specific problem, just the infrostructor is there to fix this problem.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[tree-ssa] arrays inside    |arrays inside classes not
                   |classes not optimised away  |optimised away
            Version|tree-ssa                    |3.4.0


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


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

* [Bug optimization/11761] arrays inside classes not optimised away
  2003-08-01 15:04 [Bug c/11761] New: [tree-ssa] arrays inside classes not optimised away stefaandr at hotmail dot com
                   ` (3 preceding siblings ...)
  2004-01-17  4:32 ` [Bug optimization/11761] " pinskia at gcc dot gnu dot org
@ 2004-01-17  5:31 ` dnovillo at gcc dot gnu dot org
  2004-01-17 20:26 ` cvs-commit at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: dnovillo at gcc dot gnu dot org @ 2004-01-17  5:31 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |dnovillo at gcc dot gnu dot
                   |dot org                     |org
             Status|NEW                         |ASSIGNED


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


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

* [Bug optimization/11761] arrays inside classes not optimised away
  2003-08-01 15:04 [Bug c/11761] New: [tree-ssa] arrays inside classes not optimised away stefaandr at hotmail dot com
                   ` (4 preceding siblings ...)
  2004-01-17  5:31 ` dnovillo at gcc dot gnu dot org
@ 2004-01-17 20:26 ` cvs-commit at gcc dot gnu dot org
  2004-01-17 20:31 ` dnovillo at gcc dot gnu dot org
  2004-05-13 16:04 ` [Bug optimization (tree-ssa)/11761] " pinskia at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-01-17 20:26 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2004-01-17 20:26 -------
Subject: Bug 11761

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	tree-ssa-20020619-branch
Changes by:	dnovillo@gcc.gnu.org	2004-01-17 20:26:21

Modified files:
	gcc            : ChangeLog.tree-ssa Makefile.in tree-dfa.c 
	                 tree-flow.h tree-simple.c tree-ssa.c 

Log message:
	2004-01-17  Jan Hubicka  <jh@suse.cz>
	
	PR optimization/11761
	* Makefile.in: Remove tree-simple.c from GTYized files.
	* tree-dfa.c (find_addressable_vars): Parse nontrivial ADDR_EXPRs.
	(discover_nonconstant_array_refs_r): New static function.
	(discover_nonconstant_array_refs): New global function.
	* tree-flow.h (discover_nonconstant_array_refs): Declare.
	* tree-simple.c (types_checked, types_in_memory): Kill.
	(struct_needs_to_live_in_memory): Kill.
	(needs_to_live_in_memory): aggregates are safe.
	* tree-ssa.c (rewrite_out_of_ssa): Call the new function.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.tree-ssa.diff?cvsroot=gcc&only_with_tag=tree-ssa-20020619-branch&r1=1.1.2.1093&r2=1.1.2.1094
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/Makefile.in.diff?cvsroot=gcc&only_with_tag=tree-ssa-20020619-branch&r1=1.903.2.168&r2=1.903.2.169
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/tree-dfa.c.diff?cvsroot=gcc&only_with_tag=tree-ssa-20020619-branch&r1=1.1.4.210&r2=1.1.4.211
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/tree-flow.h.diff?cvsroot=gcc&only_with_tag=tree-ssa-20020619-branch&r1=1.1.4.182&r2=1.1.4.183
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/tree-simple.c.diff?cvsroot=gcc&only_with_tag=tree-ssa-20020619-branch&r1=1.1.4.68&r2=1.1.4.69
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/tree-ssa.c.diff?cvsroot=gcc&only_with_tag=tree-ssa-20020619-branch&r1=1.1.4.187&r2=1.1.4.188



-- 


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


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

* [Bug optimization/11761] arrays inside classes not optimised away
  2003-08-01 15:04 [Bug c/11761] New: [tree-ssa] arrays inside classes not optimised away stefaandr at hotmail dot com
                   ` (5 preceding siblings ...)
  2004-01-17 20:26 ` cvs-commit at gcc dot gnu dot org
@ 2004-01-17 20:31 ` dnovillo at gcc dot gnu dot org
  2004-05-13 16:04 ` [Bug optimization (tree-ssa)/11761] " pinskia at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: dnovillo at gcc dot gnu dot org @ 2004-01-17 20:31 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From dnovillo at gcc dot gnu dot org  2004-01-17 20:31 -------

Fixed in tree-ssa.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |SUSPENDED


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


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

* [Bug optimization (tree-ssa)/11761] arrays inside classes not optimised away
  2003-08-01 15:04 [Bug c/11761] New: [tree-ssa] arrays inside classes not optimised away stefaandr at hotmail dot com
                   ` (6 preceding siblings ...)
  2004-01-17 20:31 ` dnovillo at gcc dot gnu dot org
@ 2004-05-13 16:04 ` pinskia at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-05-13 16:04 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-05-13 11:22 -------
Fixed for 3.5.0 by the merge of the tree-ssa.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|SUSPENDED                   |RESOLVED
          Component|optimization (RTL)          |optimization (tree-ssa)
         Resolution|                            |FIXED
   Target Milestone|tree-ssa                    |3.5.0


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


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

end of thread, other threads:[~2004-05-13 11:22 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-08-01 15:04 [Bug c/11761] New: [tree-ssa] arrays inside classes not optimised away stefaandr at hotmail dot com
2003-08-01 15:12 ` [Bug c/11761] " pinskia at physics dot uc dot edu
2003-08-01 15:23 ` dnovillo at redhat dot com
2003-10-26 21:20 ` [Bug optimization/11761] " pinskia at gcc dot gnu dot org
2004-01-17  4:32 ` [Bug optimization/11761] " pinskia at gcc dot gnu dot org
2004-01-17  5:31 ` dnovillo at gcc dot gnu dot org
2004-01-17 20:26 ` cvs-commit at gcc dot gnu dot org
2004-01-17 20:31 ` dnovillo at gcc dot gnu dot org
2004-05-13 16:04 ` [Bug optimization (tree-ssa)/11761] " pinskia 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).