Re: [COMMITTED] tree-optimization/78888 - Adjust ranges for to_upper and to_lower.

2021-07-26 Thread Andrew MacLeod via Gcc-patches
On 7/26/21 5:01 PM, Jakub Jelinek wrote: On Mon, Jul 26, 2021 at 04:57:14PM -0400, Andrew MacLeod wrote: Handle ASCII and EBCDIC in toupper and tolower ranges. gcc/ PR tree-optimization/7 * gimple-range-fold.cc (get_letter_range): New.

Re: [COMMITTED] tree-optimization/78888 - Adjust ranges for to_upper and to_lower.

2021-07-26 Thread Jakub Jelinek via Gcc-patches
On Mon, Jul 26, 2021 at 04:57:14PM -0400, Andrew MacLeod wrote: > Handle ASCII and EBCDIC in toupper and tolower ranges. > > gcc/ > PR tree-optimization/7 > * gimple-range-fold.cc (get_letter_range): New. > (fold_using_range::range_of_bui

Re: [COMMITTED] tree-optimization/78888 - Adjust ranges for to_upper and to_lower.

2021-07-26 Thread Andrew MacLeod via Gcc-patches
On 7/26/21 4:36 PM, Jakub Jelinek wrote: On Mon, Jul 26, 2021 at 10:33:51PM +0200, Jakub Jelinek via Gcc-patches wrote: @@ -835,6 +836,43 @@ fold_using_range::range_of_builtin_ubsan_call (irange &r, gcall *call, r.set_varying (type); } +// Return TRUE if we recognize the target chara

Re: [COMMITTED] tree-optimization/78888 - Adjust ranges for to_upper and to_lower.

2021-07-26 Thread Jakub Jelinek via Gcc-patches
On Mon, Jul 26, 2021 at 10:33:51PM +0200, Jakub Jelinek via Gcc-patches wrote: > > @@ -835,6 +836,43 @@ fold_using_range::range_of_builtin_ubsan_call (irange > > &r, gcall *call, > > r.set_varying (type); > > } > > > > +// Return TRUE if we recognize the target character set and return the

Re: [COMMITTED] tree-optimization/78888 - Adjust ranges for to_upper and to_lower.

2021-07-26 Thread Jakub Jelinek via Gcc-patches
On Mon, Jul 26, 2021 at 03:44:28PM -0400, Andrew MacLeod via Gcc-patches wrote: > I'm testing this...   Think this'll work better?  we don't support any > character sets where a space is 32 but it isnt ASCI.. and 64 isnt EBCDIC? > > This should handle those 2 sets.. and if is something else, it ba

Re: [COMMITTED] tree-optimization/78888 - Adjust ranges for to_upper and to_lower.

2021-07-26 Thread David Malcolm via Gcc-patches
On Mon, 2021-07-26 at 15:44 -0400, Andrew MacLeod wrote: > I'm testing this...   Think this'll work better?  we don't support > any > character sets where a space is 32 but it isnt ASCI.. and 64 isnt > EBCDIC? Not sure; libcpp has some code for EBCDIC support, but it seems to be for the host, not

Re: [COMMITTED] tree-optimization/78888 - Adjust ranges for to_upper and to_lower.

2021-07-26 Thread Andrew MacLeod via Gcc-patches
I'm testing this...   Think this'll work better?  we don't support any character sets where a space is 32 but it isnt ASCI.. and 64 isnt EBCDIC? This should handle those 2 sets.. and if is something else, it bails. This seems OK?  Im testing it now on x86-64... but dont have an ebcdic target..

Re: [COMMITTED] tree-optimization/78888 - Adjust ranges for to_upper and to_lower.

2021-07-26 Thread Andrew MacLeod via Gcc-patches
On 7/26/21 2:39 PM, David Malcolm wrote: On Mon, 2021-07-26 at 14:21 -0400, Andrew MacLeod via Gcc-patches wrote: Remove lower case characters from the range of to_upper and likewise, upper case characters from to_lower. I looked at also only adding the upper case characters for which there is

Re: [COMMITTED] tree-optimization/78888 - Adjust ranges for to_upper and to_lower.

2021-07-26 Thread David Malcolm via Gcc-patches
On Mon, 2021-07-26 at 14:21 -0400, Andrew MacLeod via Gcc-patches wrote: > Remove lower case characters from the range of to_upper and likewise, > upper case characters from to_lower. > > I looked at also only adding the upper case characters for which there > is a lower_case character in the ran

[COMMITTED] tree-optimization/78888 - Adjust ranges for to_upper and to_lower.

2021-07-26 Thread Andrew MacLeod via Gcc-patches
Remove lower case characters from the range of to_upper and likewise, upper case characters from to_lower. I looked at also only adding the upper case characters for which there is a lower_case character in the range,  but it seemed of limited use Given some odd usage patterns we emit. .  Inst