public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug optimization/15255] New: [tree-ssa] a * 2 + a * 2 is not converted to a * 4
@ 2004-05-03  7:14 kazu at cs dot umass dot edu
  2004-05-03 11:24 ` [Bug optimization/15255] " pinskia at gcc dot gnu dot org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: kazu at cs dot umass dot edu @ 2004-05-03  7:14 UTC (permalink / raw)
  To: gcc-bugs

int
foo (int a)
{
  return a * 2 + a * 2;
}

The last SSA form looks like:

foo (a)
{
  int T.0;

<bb 0>:
  T.0_2 = a_1 + a_1;
  return T.0_2 * 2;

}

Why not return a_1 * 4?

Interestingly, a * 3 + a * 5 is converted to a * 8, but if I compute like so

int
foo (int a)
{
  int b = a * 3;
  int c = a * 5;
  return b + c;
}

I get:

  b_2 = a_1 * 3;
  c_3 = a_1 * 5;
  return b_2 + c_3;

-- 
           Summary: [tree-ssa] a * 2 + a * 2 is not converted to a * 4
           Product: gcc
           Version: tree-ssa
            Status: UNCONFIRMED
          Keywords: pessimizes-code
          Severity: enhancement
          Priority: P2
         Component: optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: kazu at cs dot umass dot edu
                CC: gcc-bugs at gcc dot gnu dot org


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


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

* [Bug optimization/15255] [tree-ssa] a * 2 + a * 2 is not converted to a * 4
  2004-05-03  7:14 [Bug optimization/15255] New: [tree-ssa] a * 2 + a * 2 is not converted to a * 4 kazu at cs dot umass dot edu
@ 2004-05-03 11:24 ` pinskia at gcc dot gnu dot org
  2004-05-24 21:23 ` [Bug tree-optimization/15255] " pinskia at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-05-03 11:24 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-05-03 11:24 -------
Confirmed.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2004-05-03 11:24:24
               date|                            |
   Target Milestone|---                         |tree-ssa


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


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

* [Bug tree-optimization/15255] [tree-ssa] a * 2 + a * 2 is not converted to a * 4
  2004-05-03  7:14 [Bug optimization/15255] New: [tree-ssa] a * 2 + a * 2 is not converted to a * 4 kazu at cs dot umass dot edu
  2004-05-03 11:24 ` [Bug optimization/15255] " pinskia at gcc dot gnu dot org
@ 2004-05-24 21:23 ` pinskia at gcc dot gnu dot org
  2004-05-25 14:30 ` pinskia at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-05-24 21:23 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-05-24 01:26 -------
Mine as this will get fixed when 15459 gets fixed.

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


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


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

* [Bug tree-optimization/15255] [tree-ssa] a * 2 + a * 2 is not converted to a * 4
  2004-05-03  7:14 [Bug optimization/15255] New: [tree-ssa] a * 2 + a * 2 is not converted to a * 4 kazu at cs dot umass dot edu
  2004-05-03 11:24 ` [Bug optimization/15255] " pinskia at gcc dot gnu dot org
  2004-05-24 21:23 ` [Bug tree-optimization/15255] " pinskia at gcc dot gnu dot org
@ 2004-05-25 14:30 ` pinskia at gcc dot gnu dot org
  2004-05-27  8:36 ` pinskia at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-05-25 14:30 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-05-24 15:57 -------
The first one is because fold converted it to be (a + a) * 2 but fold should be doing this conversion.  PR 
15459 fixes the other problem in the PR, I will submitting a new patch today with more comments and 
more like the RTL combiner. 

-- 


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


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

* [Bug tree-optimization/15255] [tree-ssa] a * 2 + a * 2 is not converted to a * 4
  2004-05-03  7:14 [Bug optimization/15255] New: [tree-ssa] a * 2 + a * 2 is not converted to a * 4 kazu at cs dot umass dot edu
                   ` (2 preceding siblings ...)
  2004-05-25 14:30 ` pinskia at gcc dot gnu dot org
@ 2004-05-27  8:36 ` pinskia at gcc dot gnu dot org
  2004-06-21  5:13 ` pinskia at gcc dot gnu dot org
  2005-02-16  4:22 ` pinskia at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-05-27  8:36 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|3.5.0                       |---


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


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

* [Bug tree-optimization/15255] [tree-ssa] a * 2 + a * 2 is not converted to a * 4
  2004-05-03  7:14 [Bug optimization/15255] New: [tree-ssa] a * 2 + a * 2 is not converted to a * 4 kazu at cs dot umass dot edu
                   ` (3 preceding siblings ...)
  2004-05-27  8:36 ` pinskia at gcc dot gnu dot org
@ 2004-06-21  5:13 ` pinskia at gcc dot gnu dot org
  2005-02-16  4:22 ` pinskia at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-06-21  5:13 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-06-21 05:13 -------
I will submit my patch tree combine patch tonight which fixes the second case but not the first as the 
first is a problem in fold.

-- 


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


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

* [Bug tree-optimization/15255] [tree-ssa] a * 2 + a * 2 is not converted to a * 4
  2004-05-03  7:14 [Bug optimization/15255] New: [tree-ssa] a * 2 + a * 2 is not converted to a * 4 kazu at cs dot umass dot edu
                   ` (4 preceding siblings ...)
  2004-06-21  5:13 ` pinskia at gcc dot gnu dot org
@ 2005-02-16  4:22 ` pinskia at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-02-16  4:22 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-02-15 22:22 -------
As I said before I was not going to fix a fold problem (for the first testcase).

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


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


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

end of thread, other threads:[~2005-02-15 22:22 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-05-03  7:14 [Bug optimization/15255] New: [tree-ssa] a * 2 + a * 2 is not converted to a * 4 kazu at cs dot umass dot edu
2004-05-03 11:24 ` [Bug optimization/15255] " pinskia at gcc dot gnu dot org
2004-05-24 21:23 ` [Bug tree-optimization/15255] " pinskia at gcc dot gnu dot org
2004-05-25 14:30 ` pinskia at gcc dot gnu dot org
2004-05-27  8:36 ` pinskia at gcc dot gnu dot org
2004-06-21  5:13 ` pinskia at gcc dot gnu dot org
2005-02-16  4:22 ` 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).