public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug optimization/14728] New: [tree-ssa] missed jump threading due to casts
@ 2004-03-25  3:13 pinskia at gcc dot gnu dot org
  2004-03-25  3:14 ` [Bug optimization/14728] " pinskia at gcc dot gnu dot org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-03-25  3:13 UTC (permalink / raw)
  To: gcc-bugs

Because of ABI requirements, functions with _Bool (and other types smaller than int) 
return types are returned as int so the tree optimizers do not optimize the following 
functions by getting rid of the call to link_error:
inline static _Bool f(int i, int j)
{
  return i==j;
}
int link_error(void);
int l(int i, int j)
{
  if (f (i,j))
    {
      if (i == j)
        return 0;
      else
        return link_error();
    }
  return 0;
}
int main()
{
  return l(1, 2);
}

I have a patch to fix this, this is just for me to remind myself to submit it when the tree-ssa 
gets merged into the mainline, this patch also helps C++ code as they do small functions 
which return bools all the time.

-- 
           Summary: [tree-ssa] missed jump threading due to casts
           Product: gcc
           Version: tree-ssa
            Status: UNCONFIRMED
          Keywords: pessimizes-code
          Severity: enhancement
          Priority: P2
         Component: optimization
        AssignedTo: pinskia 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=14728


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

* [Bug optimization/14728] [tree-ssa] missed jump threading due to casts
  2004-03-25  3:13 [Bug optimization/14728] New: [tree-ssa] missed jump threading due to casts pinskia at gcc dot gnu dot org
@ 2004-03-25  3:14 ` pinskia at gcc dot gnu dot org
  2004-04-03  5:04 ` pinskia at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-03-25  3:14 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2004-03-25 03:14:13
               date|                            |
   Target Milestone|---                         |tree-ssa


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


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

* [Bug optimization/14728] [tree-ssa] missed jump threading due to casts
  2004-03-25  3:13 [Bug optimization/14728] New: [tree-ssa] missed jump threading due to casts pinskia at gcc dot gnu dot org
  2004-03-25  3:14 ` [Bug optimization/14728] " pinskia at gcc dot gnu dot org
@ 2004-04-03  5:04 ` pinskia at gcc dot gnu dot org
  2004-04-05 23:59 ` pinskia at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-04-03  5:04 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-04-03 05:04 -------
Patch here: <http://gcc.gnu.org/ml/gcc-patches/2004-04/msg00169.html>.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch


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


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

* [Bug optimization/14728] [tree-ssa] missed jump threading due to casts
  2004-03-25  3:13 [Bug optimization/14728] New: [tree-ssa] missed jump threading due to casts pinskia at gcc dot gnu dot org
  2004-03-25  3:14 ` [Bug optimization/14728] " pinskia at gcc dot gnu dot org
  2004-04-03  5:04 ` pinskia at gcc dot gnu dot org
@ 2004-04-05 23:59 ` pinskia at gcc dot gnu dot org
  2004-05-15  6:07 ` [Bug tree-optimization/14728] " pinskia at gcc dot gnu dot org
  2004-05-15 15:39 ` giovannibajo at libero dot it
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-04-05 23:59 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-04-05 23:59 -------
Note this works on some targets already on the RTL level but not on all.
For an example, it works on PPC but not on i686.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |TREE


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


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

* [Bug tree-optimization/14728] [tree-ssa] missed jump threading due to casts
  2004-03-25  3:13 [Bug optimization/14728] New: [tree-ssa] missed jump threading due to casts pinskia at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2004-04-05 23:59 ` pinskia at gcc dot gnu dot org
@ 2004-05-15  6:07 ` pinskia at gcc dot gnu dot org
  2004-05-15 15:39 ` giovannibajo at libero dot it
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-05-15  6:07 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-05-14 17:43 -------
Also fixed by:
Fixed by:
        * tree-ssa-forwprop.c (record_single_argument_cond_exprs): Accept
        new parameters for the statement and variable worklist as well
        as a bitmap of interesting SSA_NAMEs.  Walk over the statement
        worklist recording interesting variables in the variable worklist
        and bitmap.  Handle casts between integral and boolean types.
        (substitute_single_use_vars): Accept new parameters for the statement
        and variable worklist.  When a substitution is made add a new
        entry to the statement worklist.  Handle casts between integral
        and boolean types.
        (tree_ssa_forward_propagate_single_use_vars): Rework to pass
        worklists to children.  Iterate until the statement worklist
        is empty.

-- 


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


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

* [Bug tree-optimization/14728] [tree-ssa] missed jump threading due to casts
  2004-03-25  3:13 [Bug optimization/14728] New: [tree-ssa] missed jump threading due to casts pinskia at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2004-05-15  6:07 ` [Bug tree-optimization/14728] " pinskia at gcc dot gnu dot org
@ 2004-05-15 15:39 ` giovannibajo at libero dot it
  4 siblings, 0 replies; 6+ messages in thread
From: giovannibajo at libero dot it @ 2004-05-15 15:39 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From giovannibajo at libero dot it  2004-05-14 20:13 -------
So, closing it.

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


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


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

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

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-03-25  3:13 [Bug optimization/14728] New: [tree-ssa] missed jump threading due to casts pinskia at gcc dot gnu dot org
2004-03-25  3:14 ` [Bug optimization/14728] " pinskia at gcc dot gnu dot org
2004-04-03  5:04 ` pinskia at gcc dot gnu dot org
2004-04-05 23:59 ` pinskia at gcc dot gnu dot org
2004-05-15  6:07 ` [Bug tree-optimization/14728] " pinskia at gcc dot gnu dot org
2004-05-15 15:39 ` giovannibajo at libero dot it

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