[Bug target/78426] New: [7 Regression] wrong code with strncmp on SH

kkojima at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Sat Nov 19 13:55:00 GMT 2016


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

            Bug ID: 78426
           Summary: [7 Regression] wrong code with strncmp on SH
           Product: gcc
           Version: 7.0
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: kkojima at gcc dot gnu.org
  Target Milestone: ---
            Target: sh-*-*

Execution fails for gcc.c-torture/execute/20050218-1.c here:

      if (strncmp (x + j, a[i], strlen (a[i])) != 0)
        return 2;
      j += strlen (a[i]);

It looks that sh_expand_cmpnstr clobbers the length result of the 1st
strlen which is shared with the result of 2nd strlen.  I'm preparing
a patch.


More information about the Gcc-bugs mailing list