https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112346

Shaohua Li <shaohua.li at inf dot ethz.ch> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |shaohua.li at inf dot ethz.ch

--- Comment #2 from Shaohua Li <shaohua.li at inf dot ethz.ch> ---
(In reply to Fedor Chelnokov from comment #0)
> This program
> 
> #include <ctype.h>
> 
> char *SkipAName(char *s) {
>   if (('A' <= *s && *s <= 'Z') || ('a' <= *s && *s <= 'z') ) {
>     while (isalnum(*s)) {
>       s++;
>     }
>   }
>   return s;
> }
> 
> int TestName(char *name) {
>   while (*name)
>     name++;
>   return 0;
> }
> 
> int StrICmp(char *s1, char *s2) {
>   while (*s1 && *s1 == *s2) {
>     s1++;
>     s2++;
>   }
>   return *s1 - *s2;
> }
> 
> int DoTable(char *s) {
>     char *name, c;
>     name = s;
>     s = SkipAName(s);
>     c = *s;
>     *s = 0;
>     TestName(name);
>     *s = c;
>     if (*s == '(')
>       return 3;
>     if (*s != ',')
>       return 2;
>     *s = 0;
>     return StrICmp(name, "sparse");
> }
> 
> int main() {
>   char buf[] = "sparse,C(1)";
>   return DoTable(buf);
> }
> 
> shall return 0, but in GCC 13 with -O2 it returns 44. Online demo:
> https://gcc.godbolt.org/z/c6W33T1zK
> 
> Related discussion: https://stackoverflow.com/q/77407156/7325599

Hi, it seems that this test case is reduced from a real project. Could you tell
me which project it is from?

Reply via email to