[Bug middle-end/88784] Middle end is missing some optimizations about unsigned

2019-09-16 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88784 Martin Liška changed: What|Removed |Added Status|NEW |RESOLVED CC|

[Bug middle-end/88784] Middle end is missing some optimizations about unsigned

2019-09-16 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88784 --- Comment #29 from Martin Liška --- Author: marxin Date: Mon Sep 16 14:22:16 2019 New Revision: 275749 URL: https://gcc.gnu.org/viewcvs?rev=275749=gcc=rev Log: Fix PR88784, middle end is missing some optimizations about unsigned 2019-09-16

[Bug middle-end/88784] Middle end is missing some optimizations about unsigned

2019-06-21 Thread rguenther at suse dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88784 --- Comment #28 from rguenther at suse dot de --- On Tue, 18 Jun 2019, helijia at gcc dot gnu.org wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88784 > > --- Comment #27 from Li Jia He --- > Created attachment 46495 > -->

[Bug middle-end/88784] Middle end is missing some optimizations about unsigned

2019-06-18 Thread helijia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88784 --- Comment #27 from Li Jia He --- Created attachment 46495 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=46495=edit [v2] try to fix this issue in ifcombine(and_comparisons_1 and or_comparisons_1) This patch is similar to the previous

[Bug middle-end/88784] Middle end is missing some optimizations about unsigned

2019-06-11 Thread rguenther at suse dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88784 --- Comment #26 from rguenther at suse dot de --- On Tue, 11 Jun 2019, helijia at gcc dot gnu.org wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88784 > > --- Comment #25 from Li Jia He --- > Indeed, this patch cannot catch all

[Bug middle-end/88784] Middle end is missing some optimizations about unsigned

2019-06-11 Thread helijia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88784 --- Comment #25 from Li Jia He --- Indeed, this patch cannot catch all variants that appear. I found that the optimize_vec_cond_expr function in the tree-ssa-reassoc.c file will call maybe_fold_and_comparisons and maybe_fold_or_comparisons, so

[Bug middle-end/88784] Middle end is missing some optimizations about unsigned

2019-06-11 Thread rguenther at suse dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88784 --- Comment #24 from rguenther at suse dot de --- On Tue, 11 Jun 2019, helijia at gcc dot gnu.org wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88784 > > --- Comment #23 from Li Jia He --- > Created attachment 46477 > -->

[Bug middle-end/88784] Middle end is missing some optimizations about unsigned

2019-06-11 Thread helijia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88784 --- Comment #23 from Li Jia He --- Created attachment 46477 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=46477=edit try to fix this issue in ifcombine(and_comparisons_1 and or_comparisons_1) I am trying to solve this issue directly in

[Bug middle-end/88784] Middle end is missing some optimizations about unsigned

2019-06-04 Thread ffengqi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88784 --- Comment #22 from Qi Feng --- Two more similar ones: x <= y && x == ( 0 or XXX_MIN ) --> x == ( 0 or XXX_MIN ) x >= y && x == ( UXXX_MAX or XXX_MAX ) --> x == ( UXXX_MAX or XXX_MAX )

[Bug middle-end/88784] Middle end is missing some optimizations about unsigned

2019-05-31 Thread rguenther at suse dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88784 --- Comment #21 from rguenther at suse dot de --- On Fri, 31 May 2019, ffengqi at gcc dot gnu.org wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88784 > > --- Comment #20 from Qi Feng --- > I have tried to merge signed and unsigned

[Bug middle-end/88784] Middle end is missing some optimizations about unsigned

2019-05-30 Thread ffengqi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88784 --- Comment #20 from Qi Feng --- I have tried to merge signed and unsigned together: /* x > y && x != ( 0 or XXX_MIN ) --> x > y */ (for and (truth_and bit_and) (simplify (and:c (gt:c@3 @0 @1) (ne @0 INTEGER_CST@2)) (if

[Bug middle-end/88784] Middle end is missing some optimizations about unsigned

2019-05-27 Thread rguenther at suse dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88784 --- Comment #19 from rguenther at suse dot de --- On Mon, 27 May 2019, ffengqi at gcc dot gnu.org wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88784 > > --- Comment #18 from Qi Feng --- > I only learned gcc for about 2 months, and I

[Bug middle-end/88784] Middle end is missing some optimizations about unsigned

2019-05-26 Thread ffengqi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88784 --- Comment #18 from Qi Feng --- I only learned gcc for about 2 months, and I have to say that I don't fully understand what you guys were saying. Is match.pd the right place to fix this issue? Am I in the wrong direction?

[Bug middle-end/88784] Middle end is missing some optimizations about unsigned

2019-05-24 Thread rguenther at suse dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88784 --- Comment #17 from rguenther at suse dot de --- On Fri, 24 May 2019, glisse at gcc dot gnu.org wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88784 > > --- Comment #16 from Marc Glisse --- > (In reply to rguent...@suse.de from

[Bug middle-end/88784] Middle end is missing some optimizations about unsigned

2019-05-24 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88784 --- Comment #16 from Marc Glisse --- (In reply to rguent...@suse.de from comment #15) > It can matter because we might have gimplified the && to > control flow. Indeed. You want to look at the forwprop1 dump to see what gimple-match would need

[Bug middle-end/88784] Middle end is missing some optimizations about unsigned

2019-05-24 Thread rguenther at suse dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88784 --- Comment #15 from rguenther at suse dot de --- On Fri, 24 May 2019, ffengqi at gcc dot gnu.org wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88784 > > --- Comment #14 from Qi Feng --- > Checking .original and .optimized file is

[Bug middle-end/88784] Middle end is missing some optimizations about unsigned

2019-05-24 Thread ffengqi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88784 --- Comment #14 from Qi Feng --- Checking .original and .optimized file is just a quick method I use to check whether an optimization happened (if not happen in first and last pass, probably it didn't happen). I didn't mean or think the

[Bug middle-end/88784] Middle end is missing some optimizations about unsigned

2019-05-24 Thread rguenther at suse dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88784 --- Comment #13 from rguenther at suse dot de --- On Fri, 24 May 2019, glisse at gcc dot gnu.org wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88784 > > --- Comment #12 from Marc Glisse --- > (In reply to Qi Feng from comment #11) > >

[Bug middle-end/88784] Middle end is missing some optimizations about unsigned

2019-05-24 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88784 --- Comment #12 from Marc Glisse --- (In reply to Qi Feng from comment #11) > I tried 2 patterns for the following test > > /* 1. x > y && x != 0 --> x > y */ > /* 2. y < x && x != 0 --> y < x */ > /* 3. x != 0 &&

[Bug middle-end/88784] Middle end is missing some optimizations about unsigned

2019-05-23 Thread ffengqi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88784 --- Comment #11 from Qi Feng --- I tried 2 patterns for the following test /* 1. x > y && x != 0 --> x > y */ /* 2. y < x && x != 0 --> y < x */ /* 3. x != 0 && x > y --> x > y */ /* 4. x != 0 && y

[Bug middle-end/88784] Middle end is missing some optimizations about unsigned

2019-05-23 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88784 --- Comment #10 from Richard Biener --- (In reply to Qi Feng from comment #9) > And there's another problem. Take `x > y && x != 0 --> x > y' for > example, I would also like to do > >x < y && y != 0 --> x < y >x != 0 && x

[Bug middle-end/88784] Middle end is missing some optimizations about unsigned

2019-05-22 Thread ffengqi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88784 --- Comment #9 from Qi Feng --- And there's another problem. Take `x > y && x != 0 --> x > y' for example, I would also like to do x < y && y != 0 --> x < y x != 0 && x > y --> x > y y != 0 && x < y --> x < y If

[Bug middle-end/88784] Middle end is missing some optimizations about unsigned

2019-05-22 Thread rguenther at suse dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88784 --- Comment #8 from rguenther at suse dot de --- On Wed, 22 May 2019, ffengqi at gcc dot gnu.org wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88784 > > --- Comment #7 from Qi Feng --- > I add some patterns in match.pd which handles

[Bug middle-end/88784] Middle end is missing some optimizations about unsigned

2019-05-22 Thread ffengqi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88784 --- Comment #7 from Qi Feng --- I add some patterns in match.pd which handles the original 5 transformations. But I don't the language used in match.pd well, the patterns I wrote are very similar. And I haven't found predicates for constant

[Bug middle-end/88784] Middle end is missing some optimizations about unsigned

2019-05-22 Thread fredrik.hederstie...@securitas-direct.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88784 --- Comment #6 from Fredrik Hederstierna --- Created attachment 46397 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=46397=edit Some more patterns Looking into this I found some more places where it seems to be non-optimal code, maybe

[Bug middle-end/88784] Middle end is missing some optimizations about unsigned

2019-05-22 Thread ffengqi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88784 --- Comment #5 from Qi Feng --- (In reply to Qi Feng from comment #4) > The fourth to the last should be: > > x < y || x != INT_MAX --> x != UINT_MAX > > sorry for the typo. x < y || x != INT_MAX --> x != INT_MAX

[Bug middle-end/88784] Middle end is missing some optimizations about unsigned

2019-05-22 Thread ffengqi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88784 --- Comment #4 from Qi Feng --- The fourth to the last should be: x < y || x != INT_MAX --> x != UINT_MAX sorry for the typo.

[Bug middle-end/88784] Middle end is missing some optimizations about unsigned

2019-05-22 Thread ffengqi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88784 --- Comment #3 from Qi Feng --- I have extended the transformations as following, the first five are the original ones: * unsigned Use UINT_MAX for demonstration, similar for UCHAR_MAX, USHRT_MAX, UINT_MAX, ULONG_MAX, ULLONG_MAX x > y

[Bug middle-end/88784] Middle end is missing some optimizations about unsigned

2019-05-06 Thread ffengqi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88784 Qi Feng changed: What|Removed |Added CC||ffengqi at gcc dot gnu.org --- Comment #2

[Bug middle-end/88784] Middle end is missing some optimizations about unsigned

2019-01-10 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88784 Richard Biener changed: What|Removed |Added Keywords||missed-optimization