[Bug tree-optimization/18892] missed optimization with and ==
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=18892 Bug 18892 depends on bug 15459, which changed state. Bug 15459 Summary: [meta-bug] there should be a tree combiner like the rtl one https://gcc.gnu.org/bugzilla/show_bug.cgi?id=15459 What|Removed |Added Status|ASSIGNED|RESOLVED Resolution|--- |FIXED
[Bug tree-optimization/18892] missed optimization with and ==
--- Comment #8 from pinskia at gcc dot gnu dot org 2007-07-01 00:12 --- This was fixed with one of the forwprop patches, I don't know which one though. -- pinskia at gcc dot gnu dot org changed: What|Removed |Added Status|NEW |RESOLVED Resolution||FIXED Target Milestone|--- |4.3.0 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18892
[Bug tree-optimization/18892] missed optimization with and ==
--- Additional Comments From pinskia at gcc dot gnu dot org 2005-07-12 21:27 --- It might be a while for me to rewrite the tree combiner so unassigning for now. -- 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=18892
[Bug tree-optimization/18892] missed optimization with and ==
--- Additional Comments From pinskia at gcc dot gnu dot org 2004-12-11 07:19 --- (In reply to comment #5) (In reply to comment #4) when I compile this program with mainline. Isnt this what you claimed it should be compiled to? or are you claiming it should be optimized to 'return 0'? I am claiming it should be compiled to return 0. The full testcase which is closer to what shows up in GCC is: void f(int a) { int i = a -129; if (i == 144) link_error (); } The testcase works but for the wrong reason (we call fold for COND_EXPR after out of ssa because of tree_cleanup_cfg). Here is a testcase which fails though: void g(int) __attribute__((noinline); void g(int a) { a+=2; } void f(int a) { int i = a -129; g(i); if (i == 144) link_error (); } -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18892
[Bug tree-optimization/18892] missed optimization with and ==
--- Additional Comments From amacleod at redhat dot com 2004-12-09 14:34 --- Im confused. I see a final form of: f (a) { bb 0: return (a -129) == 144; } when I compile this program with mainline. Isnt this what you claimed it should be compiled to? or are you claiming it should be optimized to 'return 0'? -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18892
[Bug tree-optimization/18892] missed optimization with and ==
--- Additional Comments From pinskia at gcc dot gnu dot org 2004-12-09 14:38 --- (In reply to comment #4) when I compile this program with mainline. Isnt this what you claimed it should be compiled to? or are you claiming it should be optimized to 'return 0'? I am claiming it should be compiled to return 0. The full testcase which is closer to what shows up in GCC is: void f(int a { int i = a -129; if (i == 144) link_error (); ] -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18892
[Bug tree-optimization/18892] missed optimization with and ==
--- Additional Comments From dnovillo at redhat dot com 2004-12-08 20:28 --- Subject: Re: New: missed SRA of a block copy pinskia at gcc dot gnu dot org wrote: The following function: int f(int a) { int i = a -129; return i == 144; } Should be compiled to: int f1(int a) { return (a -129) == 144; // aka return 0; } Yes this shows up in real code (gcc), found while testing out my tree combiner. Hmm? What does SRA have to do with anything here? Diego. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18892
[Bug tree-optimization/18892] missed optimization with and ==
--- Additional Comments From pinskia at gcc dot gnu dot org 2004-12-08 20:31 --- (In reply to comment #2) Subject: Re: New: missed SRA of a block copy Hmm? What does SRA have to do with anything here? Nothing I had messed up on the summary and already changed it after seeing that I had messed up on it. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18892