[Bug c++/25689] missed diagnostic about assignment used as truth value.

2022-02-09 Thread zhaoweiliew at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=25689 --- Comment #3 from Zhao Wei Liew --- Created attachment 52395 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=52395&action=edit Test patch (seeking feedback) Hi! I wrote a small patch to fix this issue, but I think that it has much room fo

[Bug tree-optimization/95424] Failure to optimize division with numerator of 1

2022-01-04 Thread zhaoweiliew at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95424 Zhao Wei Liew changed: What|Removed |Added Attachment #52098|0 |1 is obsolete|

[Bug tree-optimization/95424] Failure to optimize division with numerator of 1

2021-12-30 Thread zhaoweiliew at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95424 Zhao Wei Liew changed: What|Removed |Added Attachment #52097|0 |1 is obsolete|

[Bug tree-optimization/95424] Failure to optimize division with numerator of 1

2021-12-30 Thread zhaoweiliew at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95424 --- Comment #4 from Zhao Wei Liew --- Comment on attachment 52097 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=52097 Optimization for both unsigned and signed integer X diff --git a/gcc/match.pd b/gcc/match.pd index 0d7b8dd1334..6fbf1071

[Bug tree-optimization/95424] Failure to optimize division with numerator of 1

2021-12-30 Thread zhaoweiliew at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95424 --- Comment #3 from Zhao Wei Liew --- Comment on attachment 52097 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=52097 Optimization for both unsigned and signed integer X diff --git a/gcc/match.pd b/gcc/match.pd index 0d7b8dd1334..6fbf1071

[Bug tree-optimization/95424] Failure to optimize division with numerator of 1

2021-12-30 Thread zhaoweiliew at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95424 Zhao Wei Liew changed: What|Removed |Added Attachment #52091|0 |1 is obsolete|

[Bug tree-optimization/95424] Failure to optimize division with numerator of 1

2021-12-29 Thread zhaoweiliew at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95424 --- Comment #1 from Zhao Wei Liew --- Created attachment 52091 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=52091&action=edit Tested patch for the case of unsigned integer X I tried to tackle the unsigned integer X case by adding an opti

[Bug tree-optimization/103855] Missed optimization: 64bit division used instead of 32bit division

2021-12-29 Thread zhaoweiliew at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103855 --- Comment #6 from Zhao Wei Liew --- I see that the vect_get_range_info(tree, wide_int*, wide_int*) function returns the range of a tree type, but in expand_divmod(), the operands are of rtx type. Is there still a way to extract the range infor

[Bug tree-optimization/103855] Missed optimization: 64bit division used instead of 32bit division

2021-12-29 Thread zhaoweiliew at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103855 --- Comment #5 from Zhao Wei Liew --- Thanks for your guidance. I'm looking into adding a fix in expmed.c, but I can't figure out how to get the range of op1 and op0 from within expand_divmod().

[Bug tree-optimization/103855] Missed optimization: 64bit division used instead of 32bit division

2021-12-28 Thread zhaoweiliew at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103855 --- Comment #1 from Zhao Wei Liew --- After some research, I decided to look into value range propagation (VRP). I compiled with `-fdump-tree-vrp` and the VRP files contained the following for `optimized()`: For the file ending in .vrp1, ``` ;

[Bug tree-optimization/103855] New: Missed optimization: 64bit division used instead of 32bit division

2021-12-28 Thread zhaoweiliew at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103855 Bug ID: 103855 Summary: Missed optimization: 64bit division used instead of 32bit division Product: gcc Version: 12.0 Status: UNCONFIRMED Severity: normal

[Bug libstdc++/103798] New: Missed optimization: char_traits::find (and thus string_view::find_first_of) is slow when invoked with short strings

2021-12-21 Thread zhaoweiliew at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103798 Bug ID: 103798 Summary: Missed optimization: char_traits::find (and thus string_view::find_first_of) is slow when invoked with short strings Product: gcc Version