public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/22532] New: [4.1 Regression] We produce worse code on the mainline for a loop
@ 2005-07-17 20:50 pinskia at gcc dot gnu dot org
  2005-07-17 20:52 ` [Bug tree-optimization/22532] " pinskia at gcc dot gnu dot org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-07-17 20:50 UTC (permalink / raw)
  To: gcc-bugs

Take the following code:
#define NUMPOINTS 20

static float opoints[NUMPOINTS];

double sqrt (double);
double f(double);

void NormalizeVectors1 (void)
{
  int i, r;
  float s, x, y, z;
  static float d = 0.0;
  d += 0.2f;
  s = d;
  for (i=0; i<NUMPOINTS; i++)
    opoints[i] = f(s);
}

Compile at -O2 and -O3 and compare.  See how we load/store now at -O3 to the static variable, d 
inside the loop.

-- 
           Summary: [4.1 Regression] We produce worse code on the mainline
                    for a loop
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: normal
          Priority: P2
         Component: tree-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: pinskia at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org


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


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

* [Bug tree-optimization/22532] [4.1 Regression] We produce worse code on the mainline for a loop
  2005-07-17 20:50 [Bug tree-optimization/22532] New: [4.1 Regression] We produce worse code on the mainline for a loop pinskia at gcc dot gnu dot org
@ 2005-07-17 20:52 ` pinskia at gcc dot gnu dot org
  2005-07-17 20:52 ` pinskia at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-07-17 20:52 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
OtherBugsDependingO|                            |19905
              nThis|                            |


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


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

* [Bug tree-optimization/22532] [4.1 Regression] We produce worse code on the mainline for a loop
  2005-07-17 20:50 [Bug tree-optimization/22532] New: [4.1 Regression] We produce worse code on the mainline for a loop pinskia at gcc dot gnu dot org
  2005-07-17 20:52 ` [Bug tree-optimization/22532] " pinskia at gcc dot gnu dot org
@ 2005-07-17 20:52 ` pinskia at gcc dot gnu dot org
  2005-07-17 21:37 ` dberlin at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-07-17 20:52 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dberlin at gcc dot gnu dot
                   |                            |org
   Target Milestone|---                         |4.1.0


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


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

* [Bug tree-optimization/22532] [4.1 Regression] We produce worse code on the mainline for a loop
  2005-07-17 20:50 [Bug tree-optimization/22532] New: [4.1 Regression] We produce worse code on the mainline for a loop pinskia at gcc dot gnu dot org
  2005-07-17 20:52 ` [Bug tree-optimization/22532] " pinskia at gcc dot gnu dot org
  2005-07-17 20:52 ` pinskia at gcc dot gnu dot org
@ 2005-07-17 21:37 ` dberlin at gcc dot gnu dot org
  2005-07-17 22:02 ` pinskia at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: dberlin at gcc dot gnu dot org @ 2005-07-17 21:37 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From dberlin at gcc dot gnu dot org  2005-07-17 21:36 -------
the eustores stuff i just committed should fix this now
please try again :)


-- 


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


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

* [Bug tree-optimization/22532] [4.1 Regression] We produce worse code on the mainline for a loop
  2005-07-17 20:50 [Bug tree-optimization/22532] New: [4.1 Regression] We produce worse code on the mainline for a loop pinskia at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2005-07-17 21:37 ` dberlin at gcc dot gnu dot org
@ 2005-07-17 22:02 ` pinskia at gcc dot gnu dot org
  2005-07-18  5:52 ` pinskia 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 @ 2005-07-17 22:02 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-07-17 21:37 -------
(In reply to comment #1)
> the eustores stuff i just committed should fix this now
> please try again :)
This was after eustores stuff was committed.



-- 


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


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

* [Bug tree-optimization/22532] [4.1 Regression] We produce worse code on the mainline for a loop
  2005-07-17 20:50 [Bug tree-optimization/22532] New: [4.1 Regression] We produce worse code on the mainline for a loop pinskia at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2005-07-17 22:02 ` pinskia at gcc dot gnu dot org
@ 2005-07-18  5:52 ` pinskia at gcc dot gnu dot org
  2005-07-18  6:49 ` pinskia at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-07-18  5:52 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-07-18 05:17 -------
The reason why eustore does not remove it is because we have a loop and a PHI intbetween the load 
and store:
  #   d_15 = V_MUST_DEF <d_1>;
  d = s_2;
  #   d_18 = V_MAY_DEF <d_15>;
  f (s_9);
  #   VUSE <d_18>;
  s_16 = d;
  i_17 = i_3 + 1;

  # i_3 = PHI <i_10(0), i_17(1)>;
  # s_2 = PHI <s_8(0), s_16(1)>;
  # d_1 = PHI <d_4(0), d_18(1)>;
<L1>:;
  if (i_3 < l_11) goto <L0>; else goto <L2>;

<L2>:;
  s_12 = s_2;
  #   d_13 = V_MUST_DEF <d_1>;
  d = s_2;

See how have a PHI involved.  Maybe eustore should handle PHIs too.

-- 


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


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

* [Bug tree-optimization/22532] [4.1 Regression] We produce worse code on the mainline for a loop
  2005-07-17 20:50 [Bug tree-optimization/22532] New: [4.1 Regression] We produce worse code on the mainline for a loop pinskia at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2005-07-18  5:52 ` pinskia at gcc dot gnu dot org
@ 2005-07-18  6:49 ` pinskia at gcc dot gnu dot org
  2005-07-18  7:47 ` steven at gcc dot gnu dot org
  2005-07-19 19:58 ` pinskia at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-07-18  6:49 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-07-18 06:43 -------
Created an attachment (id=9298)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=9298&action=view)
patch which I need to test

This patch which needs more comments but should be complete otherwise.	This
implements my suggesting for following PHI nodes.
It also cleans up some of the code by doing bsi_next/continue only in one
place.

ChangeLog:
(remove_useless_store_vop_expr): New function.
(remove_useless_store_p): New function.
(do_eustores): Use remove_useless_store_p.

Daniel what do you think about this patch?  If you could suggest better
function names because I could not think of better name as it is late.

-- 


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


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

* [Bug tree-optimization/22532] [4.1 Regression] We produce worse code on the mainline for a loop
  2005-07-17 20:50 [Bug tree-optimization/22532] New: [4.1 Regression] We produce worse code on the mainline for a loop pinskia at gcc dot gnu dot org
                   ` (5 preceding siblings ...)
  2005-07-18  6:49 ` pinskia at gcc dot gnu dot org
@ 2005-07-18  7:47 ` steven at gcc dot gnu dot org
  2005-07-19 19:58 ` pinskia at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: steven at gcc dot gnu dot org @ 2005-07-18  7:47 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2005-07-18 07:41:32
               date|                            |


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


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

* [Bug tree-optimization/22532] [4.1 Regression] We produce worse code on the mainline for a loop
  2005-07-17 20:50 [Bug tree-optimization/22532] New: [4.1 Regression] We produce worse code on the mainline for a loop pinskia at gcc dot gnu dot org
                   ` (6 preceding siblings ...)
  2005-07-18  7:47 ` steven at gcc dot gnu dot org
@ 2005-07-19 19:58 ` pinskia at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-07-19 19:58 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-07-19 19:57 -------
Fixed removing promot-statics by:
2005-07-19  Danny Berlin <dberlin@dberlin.org>
            Kenneth Zadeck <zadeck@naturalbridge.com>

        * Makefile.in: Removed tree-promote-statics.c
        * tree-promote-statics.c: Removed.
        * common.opt: Removed flag-promote-statics.
        * opts.c: Ditto.
        * passes.c: Removed tree-promote-statics pass.
        * tree-pass.h: Ditto.
        * timevar.def: Removed TV_PROMOTE_STATICS.


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


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


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

end of thread, other threads:[~2005-07-19 19:57 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-07-17 20:50 [Bug tree-optimization/22532] New: [4.1 Regression] We produce worse code on the mainline for a loop pinskia at gcc dot gnu dot org
2005-07-17 20:52 ` [Bug tree-optimization/22532] " pinskia at gcc dot gnu dot org
2005-07-17 20:52 ` pinskia at gcc dot gnu dot org
2005-07-17 21:37 ` dberlin at gcc dot gnu dot org
2005-07-17 22:02 ` pinskia at gcc dot gnu dot org
2005-07-18  5:52 ` pinskia at gcc dot gnu dot org
2005-07-18  6:49 ` pinskia at gcc dot gnu dot org
2005-07-18  7:47 ` steven at gcc dot gnu dot org
2005-07-19 19:58 ` 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).