This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PR 18785: alternative patch


On Tue, 15 Feb 2005, Zack Weinberg wrote:

> > isdigit only needs '0'.  isascii and toascii don't really make sense on 
> > non-ASCII-compatible character sets and POSIX defines them to follow a 
> > specified algorithm independent of locale, so we don't need to do anything 
> > with them.  The printf optimizations need '%', 'c', 's', '\n' (format 
> > checking needs lots more).  nan parsing needs whitespace, '-', '+', '0' 
> > (and other digits but we know they are consecutive after '0'), 'x' and hex 
> > digits 'a' to 'f' and 'A' to 'F' (but for some reason we don't accept "0X" 
> > prefix in real_nan, only "0x"; this may be a bug).
> 
> Thanks for the list.
> 
> Is the interface I've provided convenient for all of these routines,
> in your opinion?

I think it is.  Whatever real_nan uses in place of hex_value may want to 
build its own lookup table like that used in hex_value, as it has the task 
of "given a target character, what hex digit is it?" rather than "given a 
host character, what is the target character?"

Once this is in it probably makes sense to file separate bugs for the 
individual cases that need fixing if not being fixed immediately, so 
anyone can pick them up:

* printf optimizations (expand_builtin_printf, expand_builtin_fprintf, 
expand_builtin_sprintf, fold_builtin_sprintf).  I think one bug rather 
than four suffices.

* format checking.

* real_nan.

> It's not likely to be measurable for just isdigit(), but once all the
> above routines are changed, it may well be.  Are you willing to do the
> legwork on updating all the builtins?

I wouldn't expect to get to it immediately (hence the suggestion of filing 
bugs, which anyone can assign to themselves when working on a patch).

-- 
Joseph S. Myers               http://www.srcf.ucam.org/~jsm28/gcc/
    jsm@polyomino.org.uk (personal mail)
    joseph@codesourcery.com (CodeSourcery mail)
    jsm28@gcc.gnu.org (Bugzilla assignments and CCs)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]