[Bug c/11992] New: [Regression 3.3.1]Wrong built-in code for memcmp with length 1<<24 only (1<<24)-1 possible for CLCL-Instruction

heinrich dot brand at fujitsu-siemens dot com gcc-bugzilla@gcc.gnu.org
Wed Aug 20 12:34:00 GMT 2003


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11992

           Summary: [Regression 3.3.1]Wrong built-in code for memcmp with
                    length 1<<24 only (1<<24)-1 possible for CLCL-
                    Instruction
           Product: gcc
           Version: 3.3.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: heinrich dot brand at fujitsu-siemens dot com
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: LINUX S390 on FSC S180
  GCC host triplet: LINUX S390 on FSC S180
GCC target triplet: LINUX S390 on FSC S180

Please look in file config/s390/s390.c function s390_expand_cmpstr. There 


is a difference to 3.3. which could be the cause of the problem:


#if 0


  /* Deactivate for now as profile code cannot cope with


     CC being live across basic block boundaries.  */




A test:




#include <stdio.h>


#include <string.h>




#define L1 ((1<<24)-0)0




int foo (char *p, char *q) {


    return memcmp (p, q, L1); 


}


main() {


 int c;


 char x[L1],y[L1];


 char *p,*q;


 p=&x[0];


 q=&y[0];


 q[0] = 1;


 p[0] = 0;


 c=foo(p,q);


 printf(" c = %d\n",c);


 if (c < 0) 


  printf("SUCCESSFUL\n");


    else 


  printf("FAILED\n");


 exit (0);




}



More information about the Gcc-bugs mailing list