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
> > +// range for lower case and upper case letters.
> > +
> > +static bool
> > +get_letter_range (tree type, irange &lowers, irange &uppers)
> > +{
> > +  // ASCII
> > +  if (lang_hooks.to_target_charset (' ') == 0x20)
> > +    {
> > +      lowers = int_range<2> (build_int_cst (type, 'a'),
> > +                         build_int_cst (type, 'z'));
> > +      uppers = int_range<2> (build_int_cst (type, 'A'),
> > +                        build_int_cst (type, 'Z'));
> 
> Wouldn't it be safer to lang_hooks.to_target_charset ('a')
> (and 'z') and just verify that their difference is that of 'z' - 'a'

David is right, that their difference is 25.  I think we don't support
EBCDIC on the host, but what if.

        Jakub

Reply via email to