public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/18832] New: missed jump threading with ||
@ 2004-12-04 19:31 pinskia at gcc dot gnu dot org
  2004-12-04 19:43 ` [Bug tree-optimization/18832] " pinskia at gcc dot gnu dot org
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-12-04 19:31 UTC (permalink / raw)
  To: gcc-bugs

I was messing around with trying to find compile time regressions.
The following 3 functions should produce the same asm.

int f0(int c, int a, int b)
{
  if (a == 0 || b == 0) c++;
  if (a == 0 || b == 0) c++;
  return c;
}

int f1(int c,int a, int b)
{
  if (a == 0) goto L1;
  if (b == 0) goto L1; else goto L5;
L1:
  c++;
L5:

  if (a == 0) goto L2;
  if (b == 0) goto L2; else goto L3;
L2:
  c++;
L3:
  return c;
}


int f2(int c,int a, int b)
{
  if (a == 0) goto L1;
  if (b == 0) goto L1; else goto L5;
L1:
  c+=2;
L5:
  return c;
}

-- 
           Summary: missed jump threading with ||
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: enhancement
          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=18832


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

* [Bug tree-optimization/18832] missed jump threading with ||
  2004-12-04 19:31 [Bug tree-optimization/18832] New: missed jump threading with || pinskia at gcc dot gnu dot org
@ 2004-12-04 19:43 ` pinskia at gcc dot gnu dot org
  2004-12-05 16:16 ` pinskia at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-12-04 19:43 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-12-04 19:43 -------
Oh and this one too:
int f3(int c,int a, int b)
{
  if (a== 0||b==0) c+=2;
  return c;
}

-- 


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


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

* [Bug tree-optimization/18832] missed jump threading with ||
  2004-12-04 19:31 [Bug tree-optimization/18832] New: missed jump threading with || pinskia at gcc dot gnu dot org
  2004-12-04 19:43 ` [Bug tree-optimization/18832] " pinskia at gcc dot gnu dot org
@ 2004-12-05 16:16 ` pinskia at gcc dot gnu dot org
  2005-02-15  1:26 ` law at redhat dot com
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-12-05 16:16 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-12-05 16:16 -------
Confirmed.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2004-12-05 16:16:12
               date|                            |


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


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

* [Bug tree-optimization/18832] missed jump threading with ||
  2004-12-04 19:31 [Bug tree-optimization/18832] New: missed jump threading with || pinskia at gcc dot gnu dot org
  2004-12-04 19:43 ` [Bug tree-optimization/18832] " pinskia at gcc dot gnu dot org
  2004-12-05 16:16 ` pinskia at gcc dot gnu dot org
@ 2005-02-15  1:26 ` law at redhat dot com
  2005-04-23  1:08 ` law at redhat dot com
  2005-04-25 18:20 ` pinskia at gcc dot gnu dot org
  4 siblings, 0 replies; 7+ messages in thread
From: law at redhat dot com @ 2005-02-15  1:26 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From law at redhat dot com  2005-02-14 20:49 -------
We get the code we want for f0, f2 and f3 with the updated thread selection
code.  There's still some lameness in f1 though.  

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |law at redhat dot com


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


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

* [Bug tree-optimization/18832] missed jump threading with ||
  2004-12-04 19:31 [Bug tree-optimization/18832] New: missed jump threading with || pinskia at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2005-02-15  1:26 ` law at redhat dot com
@ 2005-04-23  1:08 ` law at redhat dot com
  2005-04-25 18:20 ` pinskia at gcc dot gnu dot org
  4 siblings, 0 replies; 7+ messages in thread
From: law at redhat dot com @ 2005-04-23  1:08 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From law at redhat dot com  2005-04-23 01:08 -------
The threading issues in f0 have been addressed.  Some simple code hoisting would
make f0 slightly better from a code size standpoint, but probably wouldn't
help runtime.

The lameness in f1 isn't really a jump threading problem.  We have a merge
point  before the second pair of tests which is going to make it damn near
impossible to track the values well enough to optimize this code.  This
isn't a jump threading problem.

f2 and f3 look good.

Basically there's no jump threading issues left here.



(In reply to comment #1)
> Oh and this one too:
> int f3(int c,int a, int b)
> {
>   if (a== 0||b==0) c+=2;
>   return c;
> }



-- 


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


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

* [Bug tree-optimization/18832] missed jump threading with ||
  2004-12-04 19:31 [Bug tree-optimization/18832] New: missed jump threading with || pinskia at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2005-04-23  1:08 ` law at redhat dot com
@ 2005-04-25 18:20 ` pinskia at gcc dot gnu dot org
  4 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-04-25 18:20 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-04-25 18:20 -------
They all produce the same asm on PPC now, thanks.

-- 


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


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

* [Bug tree-optimization/18832] missed jump threading with ||
       [not found] <bug-18832-4@http.gcc.gnu.org/bugzilla/>
@ 2011-03-17 23:14 ` law at redhat dot com
  0 siblings, 0 replies; 7+ messages in thread
From: law at redhat dot com @ 2011-03-17 23:14 UTC (permalink / raw)
  To: gcc-bugs

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

Jeffrey A. Law <law at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |law at redhat dot com
         Resolution|                            |FIXED

--- Comment #6 from Jeffrey A. Law <law at redhat dot com> 2011-03-17 23:10:16 UTC ---
Fixed long ago.


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

end of thread, other threads:[~2011-03-17 23:10 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-12-04 19:31 [Bug tree-optimization/18832] New: missed jump threading with || pinskia at gcc dot gnu dot org
2004-12-04 19:43 ` [Bug tree-optimization/18832] " pinskia at gcc dot gnu dot org
2004-12-05 16:16 ` pinskia at gcc dot gnu dot org
2005-02-15  1:26 ` law at redhat dot com
2005-04-23  1:08 ` law at redhat dot com
2005-04-25 18:20 ` pinskia at gcc dot gnu dot org
     [not found] <bug-18832-4@http.gcc.gnu.org/bugzilla/>
2011-03-17 23:14 ` law at redhat dot com

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