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

            Bug ID: 79144
           Summary: cmpstrsi optimization breaks glibc
           Product: gcc
           Version: 7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: amodra at gmail dot com
  Target Milestone: ---

Created attachment 40541
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=40541&action=edit
strncmp testcase

glibc built with current gcc fails elf/check-localplt due to strcmp and strncmp
appearing in the PLT, when -mcpu=power6 or above.  strncmp emitted by
rs6000.c:expand_strn_compare ought to use the asm alias __GI_strncmp given in
the attached testcase.  For example, as it does when compiled with -O2 -m32
-mcpu=power5, producing:

foo:
        lis 4,.LC0@ha
        li 5,6
        la 4,.LC0@l(4)
        b __GI_strncmp

Reply via email to