diff mbox series

lra: emit caller-save register spills before call insn [PR116028]

Message ID 9e7c4797-a930-45fe-9ac1-91d750645407@linux.ibm.com
State New
Headers show
Series lra: emit caller-save register spills before call insn [PR116028] | expand

Commit Message

Surya Kumari Jangala Aug. 1, 2024, 10:12 a.m. UTC
lra: emit caller-save register spills before call insn [PR116028]

LRA emits insns to save caller-save registers in the
inheritance/splitting pass. In this pass, LRA builds EBBs (Extended
Basic Block) and traverses the insns in the EBBs in reverse order from
the last insn to the first insn. When LRA sees a write to a pseudo (that
has been assigned a caller-save register), and there is a read following
the write, with an intervening call insn between the write and read,
then LRA generates a spill immediately after the write and a restore
immediately before the read. The spill is needed because the call insn
will clobber the caller-save register.

If there is a write insn and a call insn in two separate BBs but
belonging to the same EBB, the spill insn gets generated in the BB
containing the write insn. If the write insn is in the entry BB, then
the spill insn that is generated in the entry BB prevents shrink wrap
from happening. This is because the spill insn references the stack
pointer and hence the prolog gets generated in the entry BB itself.

This patch ensures that the spill insn is generated before the call insn
instead of after the write. This is also more efficient as the spill now
occurs only in the path containing the call.

2024-08-01  Surya Kumari Jangala  <jskumari@linux.ibm.com>

gcc/
	PR rtl-optimization/PR116028
	* lra-constraints.cc (split_reg): Spill register before call
	insn.
	(latest_call_insn): New variable.
	(inherit_in_ebb): Track the latest call insn.

gcc/testsuite/
	PR rtl-optimization/PR116028
	* gcc.dg/ira-shrinkwrap-prep-1.c: Remove xfail for powerpc.
	* gcc.dg/pr10474.c: Remove xfail for powerpc.
---

Comments

Jeff Law Aug. 2, 2024, 2:29 p.m. UTC | #1
On 8/1/24 4:12 AM, Surya Kumari Jangala wrote:
> lra: emit caller-save register spills before call insn [PR116028]
> 
> LRA emits insns to save caller-save registers in the
> inheritance/splitting pass. In this pass, LRA builds EBBs (Extended
> Basic Block) and traverses the insns in the EBBs in reverse order from
> the last insn to the first insn. When LRA sees a write to a pseudo (that
> has been assigned a caller-save register), and there is a read following
> the write, with an intervening call insn between the write and read,
> then LRA generates a spill immediately after the write and a restore
> immediately before the read. The spill is needed because the call insn
> will clobber the caller-save register.
> 
> If there is a write insn and a call insn in two separate BBs but
> belonging to the same EBB, the spill insn gets generated in the BB
> containing the write insn. If the write insn is in the entry BB, then
> the spill insn that is generated in the entry BB prevents shrink wrap
> from happening. This is because the spill insn references the stack
> pointer and hence the prolog gets generated in the entry BB itself.
> 
> This patch ensures that the spill insn is generated before the call insn
> instead of after the write. This is also more efficient as the spill now
> occurs only in the path containing the call.
> 
> 2024-08-01  Surya Kumari Jangala  <jskumari@linux.ibm.com>
> 
> gcc/
> 	PR rtl-optimization/PR116028
> 	* lra-constraints.cc (split_reg): Spill register before call
> 	insn.
> 	(latest_call_insn): New variable.
> 	(inherit_in_ebb): Track the latest call insn.
> 
> gcc/testsuite/
> 	PR rtl-optimization/PR116028
> 	* gcc.dg/ira-shrinkwrap-prep-1.c: Remove xfail for powerpc.
> 	* gcc.dg/pr10474.c: Remove xfail for powerpc.
Implementation looks fine.  I would suggest a comment indicating why 
we're inserting before last_call_insn.  Otherwise someone in the future 
would have to find the patch submission to know why we're handling that 
case specially.

OK with that additional comment.

Thanks,
jeff
Andrew Pinski Aug. 8, 2024, 9:07 p.m. UTC | #2
On Fri, Aug 2, 2024 at 7:30 AM Jeff Law <jeffreyalaw@gmail.com> wrote:
>
>
>
> On 8/1/24 4:12 AM, Surya Kumari Jangala wrote:
> > lra: emit caller-save register spills before call insn [PR116028]
> >
> > LRA emits insns to save caller-save registers in the
> > inheritance/splitting pass. In this pass, LRA builds EBBs (Extended
> > Basic Block) and traverses the insns in the EBBs in reverse order from
> > the last insn to the first insn. When LRA sees a write to a pseudo (that
> > has been assigned a caller-save register), and there is a read following
> > the write, with an intervening call insn between the write and read,
> > then LRA generates a spill immediately after the write and a restore
> > immediately before the read. The spill is needed because the call insn
> > will clobber the caller-save register.
> >
> > If there is a write insn and a call insn in two separate BBs but
> > belonging to the same EBB, the spill insn gets generated in the BB
> > containing the write insn. If the write insn is in the entry BB, then
> > the spill insn that is generated in the entry BB prevents shrink wrap
> > from happening. This is because the spill insn references the stack
> > pointer and hence the prolog gets generated in the entry BB itself.
> >
> > This patch ensures that the spill insn is generated before the call insn
> > instead of after the write. This is also more efficient as the spill now
> > occurs only in the path containing the call.
> >
> > 2024-08-01  Surya Kumari Jangala  <jskumari@linux.ibm.com>
> >
> > gcc/
> >       PR rtl-optimization/PR116028
> >       * lra-constraints.cc (split_reg): Spill register before call
> >       insn.
> >       (latest_call_insn): New variable.
> >       (inherit_in_ebb): Track the latest call insn.
> >
> > gcc/testsuite/
> >       PR rtl-optimization/PR116028
> >       * gcc.dg/ira-shrinkwrap-prep-1.c: Remove xfail for powerpc.
> >       * gcc.dg/pr10474.c: Remove xfail for powerpc.
> Implementation looks fine.  I would suggest a comment indicating why
> we're inserting before last_call_insn.  Otherwise someone in the future
> would have to find the patch submission to know why we're handling that
> case specially.
>
> OK with that additional comment.

This causes bootstrap failure on aarch64-linux-gnu; self-tests fail at
stage 2. Looks to be wrong code is produced compiling stage 2
compiler.
I have not looked further than that right now.

Thanks,
Andrew

>
> Thanks,
> jeff
Mark Wielaard Aug. 9, 2024, 10:19 a.m. UTC | #3
Hi,

On Thu, Aug 08, 2024 at 02:07:50PM -0700, Andrew Pinski wrote:
> On Fri, Aug 2, 2024 at 7:30 AM Jeff Law <jeffreyalaw@gmail.com> wrote:
> > > 2024-08-01  Surya Kumari Jangala  <jskumari@linux.ibm.com>
> > >
> > > gcc/
> > >       PR rtl-optimization/PR116028
> > >       * lra-constraints.cc (split_reg): Spill register before call
> > >       insn.
> > >       (latest_call_insn): New variable.
> > >       (inherit_in_ebb): Track the latest call insn.
> > >
> > > gcc/testsuite/
> > >       PR rtl-optimization/PR116028
> > >       * gcc.dg/ira-shrinkwrap-prep-1.c: Remove xfail for powerpc.
> > >       * gcc.dg/pr10474.c: Remove xfail for powerpc.
> > Implementation looks fine.  I would suggest a comment indicating why
> > we're inserting before last_call_insn.  Otherwise someone in the future
> > would have to find the patch submission to know why we're handling that
> > case specially.
> >
> > OK with that additional comment.
> 
> This causes bootstrap failure on aarch64-linux-gnu; self-tests fail at
> stage 2. Looks to be wrong code is produced compiling stage 2
> compiler.
> I have not looked further than that right now.

There are also risc-v bootstrap comparison failures:

Comparing stages 2 and 3
Bootstrap comparison failure!
gcc/gimple-pretty-print.o differs
gcc/tree.o differs
gcc/fortran/trans.o differs
gcc/fortran/openmp.o differs
gcc/fortran/scanner.o differs
gcc/stor-layout.o differs
gcc/range-op-ptr.o differs
gcc/tree-vect-loop.o differs
make[2]: *** [Makefile:26283: compare] Error 1
make[1]: *** [Makefile:26263: stage3-bubble] Error 2
make: *** [Makefile:1102: all] Error 2

I haven't bisected it yet, but it started with a build that included
this patch:
https://builder.sourceware.org/buildbot/#/builders/310/builds/36

Cheers,

Mark
Surya Kumari Jangala Aug. 9, 2024, 12:58 p.m. UTC | #4
I am looking into this failure.

Thanks,
Surya

On 09/08/24 2:37 am, Andrew Pinski wrote:
> On Fri, Aug 2, 2024 at 7:30 AM Jeff Law <jeffreyalaw@gmail.com> wrote:
>>
>>
>>
>> On 8/1/24 4:12 AM, Surya Kumari Jangala wrote:
>>> lra: emit caller-save register spills before call insn [PR116028]
>>>
>>> LRA emits insns to save caller-save registers in the
>>> inheritance/splitting pass. In this pass, LRA builds EBBs (Extended
>>> Basic Block) and traverses the insns in the EBBs in reverse order from
>>> the last insn to the first insn. When LRA sees a write to a pseudo (that
>>> has been assigned a caller-save register), and there is a read following
>>> the write, with an intervening call insn between the write and read,
>>> then LRA generates a spill immediately after the write and a restore
>>> immediately before the read. The spill is needed because the call insn
>>> will clobber the caller-save register.
>>>
>>> If there is a write insn and a call insn in two separate BBs but
>>> belonging to the same EBB, the spill insn gets generated in the BB
>>> containing the write insn. If the write insn is in the entry BB, then
>>> the spill insn that is generated in the entry BB prevents shrink wrap
>>> from happening. This is because the spill insn references the stack
>>> pointer and hence the prolog gets generated in the entry BB itself.
>>>
>>> This patch ensures that the spill insn is generated before the call insn
>>> instead of after the write. This is also more efficient as the spill now
>>> occurs only in the path containing the call.
>>>
>>> 2024-08-01  Surya Kumari Jangala  <jskumari@linux.ibm.com>
>>>
>>> gcc/
>>>       PR rtl-optimization/PR116028
>>>       * lra-constraints.cc (split_reg): Spill register before call
>>>       insn.
>>>       (latest_call_insn): New variable.
>>>       (inherit_in_ebb): Track the latest call insn.
>>>
>>> gcc/testsuite/
>>>       PR rtl-optimization/PR116028
>>>       * gcc.dg/ira-shrinkwrap-prep-1.c: Remove xfail for powerpc.
>>>       * gcc.dg/pr10474.c: Remove xfail for powerpc.
>> Implementation looks fine.  I would suggest a comment indicating why
>> we're inserting before last_call_insn.  Otherwise someone in the future
>> would have to find the patch submission to know why we're handling that
>> case specially.
>>
>> OK with that additional comment.
> 
> This causes bootstrap failure on aarch64-linux-gnu; self-tests fail at
> stage 2. Looks to be wrong code is produced compiling stage 2
> compiler.
> I have not looked further than that right now.
> 
> Thanks,
> Andrew
> 
>>
>> Thanks,
>> jeff
Jeff Law Aug. 9, 2024, 4:37 p.m. UTC | #5
On 8/9/24 6:58 AM, Surya Kumari Jangala wrote:
> I am looking into this failure.
Also note that it appears that this change is causing either an infinite 
loop or severe compile-time regression for Wrestrict.

Build a cross for xstormy16-elf.  You don't need a full toolchain, just 
compiler should be enough to see the before/after compile time behavior. 
  I've attached the cpp output so you don't need any header files.

Compile the attached code with -O2.  It should complete in a second or 
less, it seems to be in an infinite loop in LRA.

Jeff
# 0 "j.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "j.c"




# 1 "range.h" 1
# 11 "range.h"
typedef long int int32_t;
typedef int ptrdiff_t;
typedef unsigned int size_t;

static inline ptrdiff_t signed_value (void)
{
  extern volatile ptrdiff_t signed_value_source;
  return signed_value_source;
}

static inline size_t unsigned_value (void)
{
  extern volatile size_t unsigned_value_source;
  return unsigned_value_source;
}

static inline ptrdiff_t signed_range (ptrdiff_t min, ptrdiff_t max)
{
  ptrdiff_t val = signed_value ();
  return val < min || max < val ? min : val;
}

static inline ptrdiff_t signed_anti_range (ptrdiff_t min, ptrdiff_t max)
{
  ptrdiff_t val = signed_value ();
  return min <= val && val <= max ? min == (-0x7fff - 1) ? max + 1 : min - 1 : val;
}

static inline size_t unsigned_range (size_t min, size_t max)
{
  size_t val = unsigned_value ();
  return val < min || max < val ? min : val;
}

static inline size_t unsigned_anti_range (size_t min, size_t max)
{
  size_t val = unsigned_value ();
  return min <= val && val <= max ? min == 0 ? max + 1 : min - 1 : val;
}
# 6 "j.c" 2
# 16 "j.c"
extern void* memcpy (void* restrict, const void* restrict, size_t);
extern void* mempcpy (void* restrict, const void* restrict, size_t);
extern void* memmove (void*, const void*, size_t);

extern char* stpcpy (char* restrict, const char* restrict);

extern char* strcat (char* restrict, const char* restrict);
extern char* strcpy (char* restrict, const char* restrict);
extern char* strncpy (char* restrict, const char* restrict, size_t);





void sink (void*, ...);

struct MemArrays
{
  char a8[8];
  char a16[16];
  char ax[];
};



void test_memcpy_cst (void *d, const void *s)
{
# 54 "j.c"
  do { if (!0 || 0 == 54) { char a[9] = { 1, 2, 3, 4, 5, 6, 7, 8, 9 }; void *pd = (a); const void *ps = (a); memcpy (pd, ps, (0)); sink (a, pd, ps); } } while (0);
# 64 "j.c"
  do { if (!0 || 0 == 64) { char a[9] = { 1, 2, 3, 4, 5, 6, 7, 8, 9 }; void *pd = (a); const void *ps = (a + 1); memcpy (pd, ps, (1)); sink (a, pd, ps); } } while (0);
  do { if (!0 || 0 == 65) { char a[9] = { 1, 2, 3, 4, 5, 6, 7, 8, 9 }; void *pd = (a); const void *ps = (a + 3); memcpy (pd, ps, (3)); sink (a, pd, ps); } } while (0);
  do { if (!0 || 0 == 66) { char a[9] = { 1, 2, 3, 4, 5, 6, 7, 8, 9 }; void *pd = (a); const void *ps = (a + 3); memcpy (pd, ps, (5)); sink (a, pd, ps); } } while (0);

  {
    char a[3][7];
    sink (a);

    void *d = a[0];
    const void *s = a[1];
    memcpy (d, s, sizeof a[0]);
    sink (&a);

    d = a[0];
    s = a[1];


    memcpy (d, s, sizeof a[0] + 2);
    sink (&a);

    d = a[0] + 1;
    s = a[1] + 1;
    memcpy (d, s, sizeof a[0]);
    sink (&a);

    d = a[0] + 1;
    s = a[1] + 1;
    memcpy (d, s, sizeof a[0] + 2);
    sink (&a);
  }

  {
    struct {
      char a[7];
      char b[7];
      char c[7];
    } x;
    sink (&x);

    void *d = x.a;
    const void *s = x.b;
    memcpy (d, s, sizeof x.a);
    sink (&x);

    d = x.a + 4;
    s = x.b;
    memcpy (d, s, sizeof x.a);
    sink (&x);

    d = x.a + 6;
    s = x.b;
    memcpy (d, s, 1);
    sink (&x);

    d = x.a + 7;
    s = x.b;
    memcpy (d, s, 3);
    sink (&x);

    d = x.a + 7;
    s = x.b + 1;
    memcpy (d, s, 1);
    sink (&x);

    d = x.b;
    s = x.a;
    memcpy (d, s, 1);
    sink (&x);

    d = x.b;
    s = x.a;
    memcpy (d, s, sizeof x.b);
    sink (&x);

    d = x.b + 2;
    s = x.a + 1;
    memcpy (d, s, sizeof x.b);
    sink (&x);

    d = x.b + 2;
    s = x.a + 2;
    memcpy (d, s, sizeof x.b);
    sink (&x);

    d = x.b + 2;
    s = x.a + 3;
    memcpy (d, s, sizeof x.b);
    sink (&x);
  }

  {
# 166 "j.c"
    do { if (!0 || 0 == 166) { char a[9] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 }; memcpy ((a), (a + 1), (5)); sink (a); } } while (0);
    do { if (!0 || 0 == 167) { char a[9] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 }; memcpy ((a), (a + 2), (5)); sink (a); } } while (0);
    do { if (!0 || 0 == 168) { char a[9] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 }; memcpy ((a), (a + 3), (5)); sink (a); } } while (0);

    do { if (!0 || 0 == 170) { char a[9] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 }; memcpy ((a + 1), (a), (5)); sink (a); } } while (0);
    do { if (!0 || 0 == 171) { char a[9] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 }; memcpy ((a + 2), (a), (5)); sink (a); } } while (0);
    do { if (!0 || 0 == 172) { char a[9] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 }; memcpy ((a + 3), (a), (5)); sink (a); } } while (0);
  }
}




void test_memcpy_range (char *d, size_t sz)
{
# 192 "j.c"
  ptrdiff_t ir = signed_range ((2), (3));
  do { if (!0 || 0 == 193) { char a[9] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 }; void *pd = (a + ir); const void *ps = (a); memcpy (pd, ps, (0)); sink (a, pd, ps); } } while (0);
  do { if (!0 || 0 == 194) { char a[9] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 }; void *pd = (a + ir); const void *ps = (a); memcpy (pd, ps, (1)); sink (a, pd, ps); } } while (0);
  do { if (!0 || 0 == 195) { char a[9] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 }; void *pd = (a + ir); const void *ps = (a); memcpy (pd, ps, (2)); sink (a, pd, ps); } } while (0);
  do { if (!0 || 0 == 196) { char a[9] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 }; void *pd = (a + ir); const void *ps = (a); memcpy (pd, ps, (3)); sink (a, pd, ps); } } while (0);

  do { if (!0 || 0 == 198) { char a[9] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 }; void *pd = (a + ir); const void *ps = (a); memcpy (pd, ps, (4)); sink (a, pd, ps); } } while (0);
  do { if (!0 || 0 == 199) { char a[9] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 }; void *pd = (a + ir); const void *ps = (a); memcpy (pd, ps, (5)); sink (a, pd, ps); } } while (0);

  do { if (!0 || 0 == 201) { char a[9] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 }; void *pd = (d + ir); const void *ps = (d); memcpy (pd, ps, (0)); sink (a, pd, ps); } } while (0);
  do { if (!0 || 0 == 202) { char a[9] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 }; void *pd = (d + ir); const void *ps = (d); memcpy (pd, ps, (1)); sink (a, pd, ps); } } while (0);
  do { if (!0 || 0 == 203) { char a[9] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 }; void *pd = (d + ir); const void *ps = (d); memcpy (pd, ps, (2)); sink (a, pd, ps); } } while (0);
  do { if (!0 || 0 == 204) { char a[9] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 }; void *pd = (d + ir); const void *ps = (d); memcpy (pd, ps, (3)); sink (a, pd, ps); } } while (0);
  do { if (!0 || 0 == 205) { char a[9] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 }; void *pd = (d + ir); const void *ps = (d); memcpy (pd, ps, (4)); sink (a, pd, ps); } } while (0);
  do { if (!0 || 0 == 206) { char a[9] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 }; void *pd = (d + ir); const void *ps = (d); memcpy (pd, ps, (5)); sink (a, pd, ps); } } while (0);



  do { if (!0 || 0 == 210) { char a[9] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 }; void *pd = (d + ir); const void *ps = (d); memcpy (pd, ps, (4)); sink (a, pd, ps); } } while (0);
  do { if (!0 || 0 == 211) { char a[9] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 }; void *pd = (d + ir); const void *ps = (d); memcpy (pd, ps, (5)); sink (a, pd, ps); } } while (0);


  do { if (!0 || 0 == 214) { char a[9] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 }; void *pd = (d + sz); const void *ps = (d); memcpy (pd, ps, (0)); sink (a, pd, ps); } } while (0);
  do { if (!0 || 0 == 215) { char a[9] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 }; void *pd = (d + sz); const void *ps = (d); memcpy (pd, ps, (1)); sink (a, pd, ps); } } while (0);
  do { if (!0 || 0 == 216) { char a[9] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 }; void *pd = (d + sz); const void *ps = (d); memcpy (pd, ps, (9)); sink (a, pd, ps); } } while (0);

  do { if (!0 || 0 == 218) { char a[9] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 }; void *pd = (a); const void *ps = (a + 1); memcpy (pd, ps, (signed_range ((0), (1)))); sink (a, pd, ps); } } while (0);
  do { if (!0 || 0 == 219) { char a[9] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 }; void *pd = (a); const void *ps = (a + 1); memcpy (pd, ps, (signed_range ((0), (2)))); sink (a, pd, ps); } } while (0);
  do { if (!0 || 0 == 220) { char a[9] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 }; void *pd = (a); const void *ps = (a + 1); memcpy (pd, ps, (signed_range ((1), (2)))); sink (a, pd, ps); } } while (0);
  do { if (!0 || 0 == 221) { char a[9] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 }; void *pd = (a); const void *ps = (a + 1); memcpy (pd, ps, (signed_range ((2), (3)))); sink (a, pd, ps); } } while (0);
  do { if (!0 || 0 == 222) { char a[9] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 }; void *pd = (a); const void *ps = (a + 1); memcpy (pd, ps, (unsigned_range ((2), (0x7fff + (size_t)1)))); sink (a, pd, ps); } } while (0);
  do { if (!0 || 0 == 223) { char a[9] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 }; void *pd = (a); const void *ps = (a + 1); memcpy (pd, ps, (unsigned_range ((2), (0xffffU - 1)))); sink (a, pd, ps); } } while (0);
  do { if (!0 || 0 == 224) { char a[9] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 }; void *pd = (a); const void *ps = (a + 2); memcpy (pd, ps, (signed_range ((2), (3)))); sink (a, pd, ps); } } while (0);
  do { if (!0 || 0 == 225) { char a[9] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 }; void *pd = (a); const void *ps = (a + 2); memcpy (pd, ps, (signed_range ((3), (4)))); sink (a, pd, ps); } } while (0);
  do { if (!0 || 0 == 226) { char a[9] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 }; void *pd = (a); const void *ps = (a + 3); memcpy (pd, ps, (signed_range ((3), (4)))); sink (a, pd, ps); } } while (0);
  do { if (!0 || 0 == 227) { char a[9] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 }; void *pd = (a); const void *ps = (a + 3); memcpy (pd, ps, (signed_range ((4), (5)))); sink (a, pd, ps); } } while (0);
  do { if (!0 || 0 == 228) { char a[9] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 }; void *pd = (a); const void *ps = (a + 3); memcpy (pd, ps, (signed_range ((5), (6)))); sink (a, pd, ps); } } while (0);

  do { if (!0 || 0 == 230) { char a[9] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 }; void *pd = (a + 1); const void *ps = (a); memcpy (pd, ps, (signed_range ((0), (1)))); sink (a, pd, ps); } } while (0);
  do { if (!0 || 0 == 231) { char a[9] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 }; void *pd = (a + 1); const void *ps = (a); memcpy (pd, ps, (signed_range ((0), (2)))); sink (a, pd, ps); } } while (0);
  do { if (!0 || 0 == 232) { char a[9] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 }; void *pd = (a + 1); const void *ps = (a); memcpy (pd, ps, (signed_range ((1), (2)))); sink (a, pd, ps); } } while (0);
  do { if (!0 || 0 == 233) { char a[9] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 }; void *pd = (a + 1); const void *ps = (a); memcpy (pd, ps, (signed_range ((2), (3)))); sink (a, pd, ps); } } while (0);
  do { if (!0 || 0 == 234) { char a[9] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 }; void *pd = (a + 1); const void *ps = (a); memcpy (pd, ps, (unsigned_range ((2), (0x7fff + (size_t)1)))); sink (a, pd, ps); } } while (0);
  do { if (!0 || 0 == 235) { char a[9] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 }; void *pd = (a + 1); const void *ps = (a); memcpy (pd, ps, (unsigned_range ((2), (0xffffU - 1)))); sink (a, pd, ps); } } while (0);
  do { if (!0 || 0 == 236) { char a[9] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 }; void *pd = (a + 2); const void *ps = (a); memcpy (pd, ps, (signed_range ((2), (3)))); sink (a, pd, ps); } } while (0);
  do { if (!0 || 0 == 237) { char a[9] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 }; void *pd = (a + 2); const void *ps = (a); memcpy (pd, ps, (signed_range ((3), (4)))); sink (a, pd, ps); } } while (0);
  do { if (!0 || 0 == 238) { char a[9] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 }; void *pd = (a + 3); const void *ps = (a); memcpy (pd, ps, (signed_range ((3), (4)))); sink (a, pd, ps); } } while (0);
  do { if (!0 || 0 == 239) { char a[9] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 }; void *pd = (a + 3); const void *ps = (a); memcpy (pd, ps, (signed_range ((4), (5)))); sink (a, pd, ps); } } while (0);
  do { if (!0 || 0 == 240) { char a[9] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 }; void *pd = (a + 3); const void *ps = (a); memcpy (pd, ps, (signed_range ((5), (6)))); sink (a, pd, ps); } } while (0);

  ir = signed_range ((2), (5));
  do { if (!0 || 0 == 243) { char a[9] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 }; void *pd = (a); const void *ps = (a + ir); memcpy (pd, ps, (4)); sink (a, pd, ps); } } while (0);
  do { if (!0 || 0 == 244) { char a[9] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 }; void *pd = (a); const void *ps = (a + ir); memcpy (pd, ps, (5)); sink (a, pd, ps); } } while (0);
  do { if (!0 || 0 == 245) { char a[9] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 }; void *pd = (a); const void *ps = (a + ir); memcpy (pd, ps, (6)); sink (a, pd, ps); } } while (0);
# 255 "j.c"
  do { if (!0 || 0 == 255) { char a[9] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 }; void *pd = (d); const void *ps = (d + unsigned_range ((0x7fff - 3), (0xffffU - 7))); memcpy (pd, ps, (5)); sink (a, pd, ps); } } while (0);
  do { if (!0 || 0 == 256) { char a[9] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 }; void *pd = (d); const void *ps = (d + unsigned_range ((0x7fff - 3), (0xffffU - 7))); memcpy (pd, ps, (6)); sink (a, pd, ps); } } while (0);
  do { if (!0 || 0 == 257) { char a[9] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 }; void *pd = (d); const void *ps = (d + unsigned_range ((0x7fff - 3), (0xffffU - 7))); memcpy (pd, ps, (7)); sink (a, pd, ps); } } while (0);
  do { if (!0 || 0 == 258) { char a[9] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 }; void *pd = (d); const void *ps = (d + unsigned_range ((0x7fff - 3), (0xffffU - 7))); memcpy (pd, ps, (9)); sink (a, pd, ps); } } while (0);

  do { if (!0 || 0 == 260) { char a[9] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 }; void *pd = (d + unsigned_range ((0x7fff - 3), (0xffffU - 7))); const void *ps = (d); memcpy (pd, ps, (5)); sink (a, pd, ps); } } while (0);
  do { if (!0 || 0 == 261) { char a[9] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 }; void *pd = (d + unsigned_range ((0x7fff - 3), (0xffffU - 7))); const void *ps = (d); memcpy (pd, ps, (6)); sink (a, pd, ps); } } while (0);
  do { if (!0 || 0 == 262) { char a[9] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 }; void *pd = (d + unsigned_range ((0x7fff - 3), (0xffffU - 7))); const void *ps = (d); memcpy (pd, ps, (7)); sink (a, pd, ps); } } while (0);
  do { if (!0 || 0 == 263) { char a[9] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 }; void *pd = (d + unsigned_range ((0x7fff - 3), (0xffffU - 7))); const void *ps = (d); memcpy (pd, ps, (9)); sink (a, pd, ps); } } while (0);

  {

    size_t o = sz << 1;

    do { if (!0 || 0 == 269) { char a[9] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 }; void *pd = (d); const void *ps = (d + o); memcpy (pd, ps, (1234)); sink (a, pd, ps); } } while (0);
    do { if (!0 || 0 == 270) { char a[9] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 }; void *pd = (d + o); const void *ps = (d); memcpy (pd, ps, (2345)); sink (a, pd, ps); } } while (0);




  }



  size_t n = unsigned_range ((3), (4));
  do { if (!0 || 0 == 280) { char a[9] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 }; void *pd = (a + signed_range ((1), (3))); const void *ps = (a + signed_range ((1), (3))); memcpy (pd, ps, (n)); sink (a, pd, ps); } } while (0);
# 295 "j.c"
  do { if (!0 || 0 == 295) { char a[9] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 }; void *pd = (a + signed_range ((1), (3))); const void *ps = (a + signed_range ((2), (3))); memcpy (pd, ps, (n)); sink (a, pd, ps); } } while (0);
  do { if (!0 || 0 == 296) { char a[9] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 }; void *pd = (a + signed_range ((1), (3))); const void *ps = (a + signed_range ((3), (4))); memcpy (pd, ps, (n)); sink (a, pd, ps); } } while (0);

  do { if (!0 || 0 == 298) { char a[9] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 }; void *pd = (a + signed_range ((2), (3))); const void *ps = (a + signed_range ((3), (4))); memcpy (pd, ps, (n)); sink (a, pd, ps); } } while (0);

  do { if (!0 || 0 == 300) { char a[9] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 }; void *pd = (a + signed_range ((1), (3))); const void *ps = (a + signed_range ((4), (5))); memcpy (pd, ps, (n)); sink (a, pd, ps); } } while (0);
  do { if (!0 || 0 == 301) { char a[9] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 }; void *pd = (a + signed_range ((2), (3))); const void *ps = (a + signed_range ((4), (5))); memcpy (pd, ps, (n)); sink (a, pd, ps); } } while (0);
  do { if (!0 || 0 == 302) { char a[9] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 }; void *pd = (a + signed_range ((3), (4))); const void *ps = (a + signed_range ((4), (5))); memcpy (pd, ps, (n)); sink (a, pd, ps); } } while (0);


  do { if (!0 || 0 == 305) { char a[9] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 }; void *pd = (d); const void *ps = (d + sz); memcpy (pd, ps, (0)); sink (a, pd, ps); } } while (0);
  do { if (!0 || 0 == 306) { char a[9] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 }; void *pd = (d); const void *ps = (d + sz); memcpy (pd, ps, (1)); sink (a, pd, ps); } } while (0);
  do { if (!0 || 0 == 307) { char a[9] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 }; void *pd = (d); const void *ps = (d + sz); memcpy (pd, ps, (9)); sink (a, pd, ps); } } while (0);
}



void test_memcpy_anti_range (char *d, const char *s)
{
  do { if (!0 || 0 == 314) { char a[9] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 }; void *pd = (d); const void *ps = (d + signed_anti_range ((0), (3))); memcpy (pd, ps, (1)); sink (a, pd, ps); } } while (0);
  do { if (!0 || 0 == 315) { char a[9] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 }; void *pd = (d); const void *ps = (d + signed_anti_range ((0), (3))); memcpy (pd, ps, (2)); sink (a, pd, ps); } } while (0);
  do { if (!0 || 0 == 316) { char a[9] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 }; void *pd = (d); const void *ps = (d + signed_anti_range ((0), (3))); memcpy (pd, ps, (3)); sink (a, pd, ps); } } while (0);
  do { if (!0 || 0 == 317) { char a[9] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 }; void *pd = (d); const void *ps = (d + signed_anti_range ((0), (3))); memcpy (pd, ps, (0x7fff - 2)); sink (a, pd, ps); } } while (0);
  do { if (!0 || 0 == 318) { char a[9] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 }; void *pd = (d); const void *ps = (d + signed_anti_range ((0), (3))); memcpy (pd, ps, (0x7fff - 1)); sink (a, pd, ps); } } while (0);
  do { if (!0 || 0 == 319) { char a[9] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 }; void *pd = (d); const void *ps = (d + signed_anti_range ((0), (3))); memcpy (pd, ps, (0x7fff)); sink (a, pd, ps); } } while (0);

  do { if (!0 || 0 == 321) { char a[9] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 }; void *pd = (d); const void *ps = (d + signed_anti_range ((0), (3))); memcpy (pd, ps, (unsigned_range ((0x7fff - 2), (0x7fff)))); sink (a, pd, ps); } } while (0);







  do { if (!0 || 0 == 329) { char a[9] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 }; void *pd = (d); const void *ps = (s); memcpy (pd, ps, (unsigned_anti_range ((1), (0x7fff / 2 - 1)))); sink (a, pd, ps); } } while (0);
  do { if (!0 || 0 == 330) { char a[9] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 }; void *pd = (d); const void *ps = (s); memcpy (pd, ps, (unsigned_anti_range ((1), (0x7fff - 1)))); sink (a, pd, ps); } } while (0);
  do { if (!0 || 0 == 331) { char a[9] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 }; void *pd = (d); const void *ps = (s); memcpy (pd, ps, (unsigned_anti_range ((1), (0x7fff)))); sink (a, pd, ps); } } while (0);
  do { if (!0 || 0 == 332) { char a[9] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 }; void *pd = (d); const void *ps = (s); memcpy (pd, ps, (unsigned_anti_range ((1), (0xffffU - 1)))); sink (a, pd, ps); } } while (0);
  do { if (!0 || 0 == 333) { char a[9] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 }; void *pd = (d); const void *ps = (s); memcpy (pd, ps, (unsigned_anti_range ((1), (0xffffU)))); sink (a, pd, ps); } } while (0);
}






void test_memcpy_range_exceed (char *d, const char *s)
{





  ptrdiff_t i = signed_range ((3), (5));
  size_t n = unsigned_range ((4), (6));

  do { if (!0 || 0 == 351) { char a[9] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 }; void *pd = (a); const void *ps = (a + i); memcpy (pd, ps, (n)); sink (a, pd, ps); } } while (0);
  do { if (!0 || 0 == 352) { char a[9] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 }; void *pd = (a + i); const void *ps = (a); memcpy (pd, ps, (n)); sink (a, pd, ps); } } while (0);

  do { if (!0 || 0 == 354) { char a[9] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 }; void *pd = (d); const void *ps = (d + i); memcpy (pd, ps, (n)); sink (a, pd, ps); } } while (0);
  do { if (!0 || 0 == 355) { char a[9] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 }; void *pd = (d + i); const void *ps = (d); memcpy (pd, ps, (n)); sink (a, pd, ps); } } while (0);




  do { if (!0 || 0 == 360) { char a[9] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 }; void *pd = (d); const void *ps = (s); memcpy (pd, ps, (0x7fff / 2)); sink (a, pd, ps); } } while (0);
  do { if (!0 || 0 == 361) { char a[9] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 }; void *pd = (d); const void *ps = (s); memcpy (pd, ps, (0x7fff / 2 + 1)); sink (a, pd, ps); } } while (0);
  do { if (!0 || 0 == 362) { char a[9] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 }; void *pd = (d); const void *ps = (s); memcpy (pd, ps, (0x7fff / 2 + 2)); sink (a, pd, ps); } } while (0);
  do { if (!0 || 0 == 363) { char a[9] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 }; void *pd = (d); const void *ps = (s); memcpy (pd, ps, (0x7fff / 2 + 3)); sink (a, pd, ps); } } while (0);

  i = signed_range ((0x7fff - 2), (0x7fff));



  do { if (!0 || 0 == 369) { char a[9] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 }; void *pd = (d); const void *ps = (d + i); memcpy (pd, ps, (3)); sink (a, pd, ps); } } while (0);
  do { if (!0 || 0 == 370) { char a[9] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 }; void *pd = (d + i); const void *ps = (d); memcpy (pd, ps, (3)); sink (a, pd, ps); } } while (0);

  do { if (!0 || 0 == 372) { char a[9] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 }; void *pd = (d + 1); const void *ps = (d + i); memcpy (pd, ps, (3)); sink (a, pd, ps); } } while (0);
  do { if (!0 || 0 == 373) { char a[9] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 }; void *pd = (d + i); const void *ps = (d + 1); memcpy (pd, ps, (3)); sink (a, pd, ps); } } while (0);



  do { if (!0 || 0 == 377) { char a[9] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 }; void *pd = (d); const void *ps = (s + i); memcpy (pd, ps, (3)); sink (a, pd, ps); } } while (0);
  do { if (!0 || 0 == 378) { char a[9] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 }; void *pd = (d + i); const void *ps = (s); memcpy (pd, ps, (3)); sink (a, pd, ps); } } while (0);

  do { if (!0 || 0 == 380) { char a[9] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 }; void *pd = (d + 1); const void *ps = (s + i); memcpy (pd, ps, (3)); sink (a, pd, ps); } } while (0);
  do { if (!0 || 0 == 381) { char a[9] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 }; void *pd = (d + i); const void *ps = (s + 1); memcpy (pd, ps, (3)); sink (a, pd, ps); } } while (0);
# 400 "j.c"
  ptrdiff_t j = signed_range ((0x7fff - 9), (0x7fff - 1));
  i = signed_range ((0x7fff - 5), (0x7fff - 1));
  n = unsigned_range ((4), (5));
  do { if (!0 || 0 == 403) { char a[9] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 }; void *pd = (d + i); const void *ps = (d + j); memcpy (pd, ps, (n)); sink (a, pd, ps); } } while (0);

  n = unsigned_range ((4), (0x7fff - 1));
  do { if (!0 || 0 == 406) { char a[9] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 }; void *pd = (d + i); const void *ps = (d + j); memcpy (pd, ps, (n)); sink (a, pd, ps); } } while (0);

  n = unsigned_range ((4), (0xffffU - 1));
  do { if (!0 || 0 == 409) { char a[9] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 }; void *pd = (d + i); const void *ps = (d + j); memcpy (pd, ps, (n)); sink (a, pd, ps); } } while (0);

  j = signed_range ((0x7fff - 8), (0x7fff - 1));
  do { if (!0 || 0 == 412) { char a[9] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 }; void *pd = (d + i); const void *ps = (d + j); memcpy (pd, ps, (n)); sink (a, pd, ps); } } while (0);

  j = signed_range ((0x7fff - 7), (0x7fff - 1));
  do { if (!0 || 0 == 415) { char a[9] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 }; void *pd = (d + i); const void *ps = (d + j); memcpy (pd, ps, (n)); sink (a, pd, ps); } } while (0);

  j = signed_range ((0x7fff - 6), (0x7fff - 1));
  do { if (!0 || 0 == 418) { char a[9] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 }; void *pd = (d + i); const void *ps = (d + j); memcpy (pd, ps, (n)); sink (a, pd, ps); } } while (0);

  n = unsigned_range ((3), (0x7fff));
  do { if (!0 || 0 == 421) { char a[9] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 }; void *pd = (d + i); const void *ps = (d + j); memcpy (pd, ps, (n)); sink (a, pd, ps); } } while (0);

  j = signed_range ((0x7fff - 6), (0x7fff - 1));
  do { if (!0 || 0 == 424) { char a[9] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 }; void *pd = (d + i); const void *ps = (d + j); memcpy (pd, ps, (n)); sink (a, pd, ps); } } while (0);

  j = signed_range ((0x7fff - 5), (0x7fff - 1));
  do { if (!0 || 0 == 427) { char a[9] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 }; void *pd = (d + i); const void *ps = (d + j); memcpy (pd, ps, (n)); sink (a, pd, ps); } } while (0);

  j = signed_range ((0x7fff - 4), (0x7fff - 1));
  do { if (!0 || 0 == 430) { char a[9] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 }; void *pd = (d + i); const void *ps = (d + j); memcpy (pd, ps, (n)); sink (a, pd, ps); } } while (0);

  j = signed_range ((0x7fff - 2), (0x7fff - 1));
  do { if (!0 || 0 == 433) { char a[9] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 }; void *pd = (d + i); const void *ps = (d + j); memcpy (pd, ps, (n)); sink (a, pd, ps); } } while (0);
}



void test_memcpy_var (char *d, const char *s)
{
  size_t n = unsigned_value ();


  memcpy (d, d, 0);
  sink (d);


  s = d + 1;
  memcpy (d, s, n);
  sink (d);

  s = d + n;
  memcpy (d, s, n);
  sink (d);

  s = d + signed_value ();
  memcpy (d, s, unsigned_value ());
  sink (d);

  s = d + 3;
  n = 1;
  memcpy (d, s, n);
  sink (d);

  s = d + 3;
  n = 2;
  memcpy (d, s, n);
  sink (d);

  s = d + 3;
  n = 3;
  memcpy (d, s, n);
  sink (d);

  s = d + 3;
  n = 4;
  memcpy (d, s, n);
  sink (d);

  s = d + 5;
  n = 7;
  memcpy (d, s, n);
}


void test_memcpy_memarrray (struct MemArrays *p)
{
# 497 "j.c"
  do { if (!0 || 0 == 497) { void *pd = (p->a8); const void *ps = (p->a8); memcpy (pd, ps, (0)); sink (pd, ps); } } while (0);
  do { if (!0 || 0 == 498) { void *pd = (p->a8); const void *ps = (p->a8 + 1); memcpy (pd, ps, (1)); sink (pd, ps); } } while (0);
  do { if (!0 || 0 == 499) { void *pd = (p->a8); const void *ps = (p->a8 + 2); memcpy (pd, ps, (2)); sink (pd, ps); } } while (0);
  do { if (!0 || 0 == 500) { void *pd = (p->a8); const void *ps = (p->a8 + 8); memcpy (pd, ps, (1)); sink (pd, ps); } } while (0);

  do { if (!0 || 0 == 502) { void *pd = (p->a8); const void *ps = (p->a8 + 2); memcpy (pd, ps, (3)); sink (pd, ps); } } while (0);
}



void test_memmove (void)
{
  {
    char d[7];
    sink (d);

    const void *s = d;
    memmove (d, s, 7);
    sink (d);

    s = d + 1;
    memmove (d, s, 6);
    sink (d);

    s = d + 2;
    memmove (d + 1, s, 5);
    sink (d);
  }
}



void test_strcat_cst (const char *s)
{
# 542 "j.c"
  do { if (!0 || 0 == 542) { char a[9] = "0"; char *pd = (a); const char *ps = (a); strcat (pd, ps); sink (a, pd, ps); } } while (0);
  do { if (!0 || 0 == 543) { char a[9] = "01"; char *pd = (a); const char *ps = (a); strcat (pd, ps); sink (a, pd, ps); } } while (0);
  do { if (!0 || 0 == 544) { char a[9] = "012"; char *pd = (a); const char *ps = (a); strcat (pd, ps); sink (a, pd, ps); } } while (0);

  do { if (!0 || 0 == 546) { char a[9] = "012"; char *pd = (a); const char *ps = (a + 1); strcat (pd, ps); sink (a, pd, ps); } } while (0);
  do { if (!0 || 0 == 547) { char a[9] = "012"; char *pd = (a); const char *ps = (a + 2); strcat (pd, ps); sink (a, pd, ps); } } while (0);


  do { if (!0 || 0 == 550) { char a[9] = "012"; char *pd = (a); const char *ps = (a + 3); strcat (pd, ps); sink (a, pd, ps); } } while (0);

  do { if (!0 || 0 == 552) { char a[9] = "012"; char *pd = (a); const char *ps = (a + 4); strcat (pd, ps); sink (a, pd, ps); } } while (0);
  do { if (!0 || 0 == 553) { char a[9] = "012"; char *pd = (a); const char *ps = (a + 5); strcat (pd, ps); sink (a, pd, ps); } } while (0);
  do { if (!0 || 0 == 554) { char a[9] = "012"; char *pd = (a); const char *ps = (a + 6); strcat (pd, ps); sink (a, pd, ps); } } while (0);
  do { if (!0 || 0 == 555) { char a[9] = "012"; char *pd = (a); const char *ps = (a + 7); strcat (pd, ps); sink (a, pd, ps); } } while (0);
  do { if (!0 || 0 == 556) { char a[9] = "012"; char *pd = (a); const char *ps = (a + 8); strcat (pd, ps); sink (a, pd, ps); } } while (0);

  do { if (!0 || 0 == 558) { char a[9] = "0"; char *pd = (a + 1); const char *ps = (a); strcat (pd, ps); sink (a, pd, ps); } } while (0);
  do { if (!0 || 0 == 559) { char a[9] = "0"; char *pd = (a + 2); const char *ps = (a); strcat (pd, ps); sink (a, pd, ps); } } while (0);




  do { if (!0 || 0 == 564) { char a[9] = "01"; char *pd = (a + 1); const char *ps = (a); strcat (pd, ps); sink (a, pd, ps); } } while (0);
  do { if (!0 || 0 == 565) { char a[9] = "01"; char *pd = (a + 2); const char *ps = (a); strcat (pd, ps); sink (a, pd, ps); } } while (0);
  do { if (!0 || 0 == 566) { char a[9] = "01"; char *pd = (a + 3); const char *ps = (a); strcat (pd, ps); sink (a, pd, ps); } } while (0);

  do { if (!0 || 0 == 568) { char a[9] = "012"; char *pd = (a + 1); const char *ps = (a); strcat (pd, ps); sink (a, pd, ps); } } while (0);
  do { if (!0 || 0 == 569) { char a[9] = "012"; char *pd = (a + 2); const char *ps = (a); strcat (pd, ps); sink (a, pd, ps); } } while (0);
  do { if (!0 || 0 == 570) { char a[9] = "012"; char *pd = (a + 3); const char *ps = (a); strcat (pd, ps); sink (a, pd, ps); } } while (0);
  do { if (!0 || 0 == 571) { char a[9] = "012"; char *pd = (a + 4); const char *ps = (a); strcat (pd, ps); sink (a, pd, ps); } } while (0);
  do { if (!0 || 0 == 572) { char a[9] = "012"; char *pd = (a + 5); const char *ps = (a); strcat (pd, ps); sink (a, pd, ps); } } while (0);


  do { if (!0 || 0 == 575) { char a[9] = "012"; char *pd = (a); const char *ps = ("012"); strcat (pd, ps); sink (a, pd, ps); } } while (0);
  do { if (!0 || 0 == 576) { char a[9] = "012"; char *pd = (a); const char *ps = (s); strcat (pd, ps); sink (a, pd, ps); } } while (0);
  do { if (!0 || 0 == 577) { char a[9] = "01234567"; char *pd = (a); const char *ps = (s); strcat (pd, ps); sink (a, pd, ps); } } while (0);
}



void test_strcat_var (char *d, const char *s)
{
# 594 "j.c"
  do { if (!0 || 0 == 594) { char *pd = (d); const char *ps = (d); strcat (pd, ps); sink (pd, ps); } } while (0);
  do { if (!0 || 0 == 595) { char *pd = (d); const char *ps = (d + 1); strcat (pd, ps); sink (pd, ps); } } while (0);
  do { if (!0 || 0 == 596) { char *pd = (d); const char *ps = (d + 2); strcat (pd, ps); sink (pd, ps); } } while (0);
  do { if (!0 || 0 == 597) { char *pd = (d); const char *ps = (d + 999); strcat (pd, ps); sink (pd, ps); } } while (0);



  do { if (!0 || 0 == 601) { char *pd = (d); const char *ps = (d + -99); strcat (pd, ps); sink (pd, ps); } } while (0);

  size_t n = unsigned_value ();

  do { if (!0 || 0 == 605) { char *pd = (d + n); const char *ps = (d + n); strcat (pd, ps); sink (pd, ps); } } while (0);


  do { if (!0 || 0 == 608) { char *pd = (d); const char *ps = ("012"); strcat (pd, ps); sink (pd, ps); } } while (0);
  do { if (!0 || 0 == 609) { char *pd = (d + 1); const char *ps = ("0123"); strcat (pd, ps); sink (pd, ps); } } while (0);
  do { if (!0 || 0 == 610) { char *pd = (d + n); const char *ps = ("01234"); strcat (pd, ps); sink (pd, ps); } } while (0);
  do { if (!0 || 0 == 611) { char *pd = (d); const char *ps = (s); strcat (pd, ps); sink (pd, ps); } } while (0);
  do { if (!0 || 0 == 612) { char *pd = (d + 1); const char *ps = (s); strcat (pd, ps); sink (pd, ps); } } while (0);
  do { if (!0 || 0 == 613) { char *pd = (d + n); const char *ps = (s); strcat (pd, ps); sink (pd, ps); } } while (0);







  do { if (!0 || 0 == 621) { char *pd = (d); const char *ps = (d + n); strcat (pd, ps); sink (pd, ps); } } while (0);
}



void test_strcpy_cst (ptrdiff_t i)
{
# 639 "j.c"
  do { if (!0 || 0 == 639) { char a[8] = "012"; char *pd = (a); const char *ps = (a); strcpy (pd, ps); sink (a, pd, ps); } } while (0);
  do { if (!0 || 0 == 640) { char a[8] = "012"; char *pd = (a); const char *ps = (a + 1); strcpy (pd, ps); sink (a, pd, ps); } } while (0);
  do { if (!0 || 0 == 641) { char a[8] = "012"; char *pd = (a); const char *ps = (a + 2); strcpy (pd, ps); sink (a, pd, ps); } } while (0);
  do { if (!0 || 0 == 642) { char a[8] = "012"; char *pd = (a); const char *ps = (a + 3); strcpy (pd, ps); sink (a, pd, ps); } } while (0);
  do { if (!0 || 0 == 643) { char a[8] = "012"; char *pd = (a); const char *ps = (a + sizeof a); strcpy (pd, ps); sink (a, pd, ps); } } while (0);


  do { if (!0 || 0 == 646) { char a[8] = "0123"; char *pd = (a); const char *ps = (a + 2); strcpy (pd, ps); sink (a, pd, ps); } } while (0);


  do { if (!0 || 0 == 649) { char a[8] = "01234"; char *pd = (a); const char *ps = (a + 2); strcpy (pd, ps); sink (a, pd, ps); } } while (0);


  do { if (!0 || 0 == 652) { char a[8] = "012"; char *pd = (a); const char *ps = (a); strcpy (pd, ps); sink (a, pd, ps); } } while (0);

  do { if (!0 || 0 == 654) { char a[8] = "012"; char *pd = (a + 1); const char *ps = (a); strcpy (pd, ps); sink (a, pd, ps); } } while (0);
  do { if (!0 || 0 == 655) { char a[8] = "012"; char *pd = (a + 2); const char *ps = (a); strcpy (pd, ps); sink (a, pd, ps); } } while (0);
  do { if (!0 || 0 == 656) { char a[8] = "012"; char *pd = (a + 3); const char *ps = (a); strcpy (pd, ps); sink (a, pd, ps); } } while (0);
  do { if (!0 || 0 == 657) { char a[8] = "012"; char *pd = (a + 4); const char *ps = (a); strcpy (pd, ps); sink (a, pd, ps); } } while (0);


  do { if (!0 || 0 == 660) { char a[8] = "012"; char *pd = (a + sizeof a); const char *ps = (a); strcpy (pd, ps); sink (a, pd, ps); } } while (0);
}





void test_strcpy_range (void)
{
# 681 "j.c"
  ptrdiff_t r;

  r = signed_range ((0), (1));
  do { if (!0 || 0 == 684) { char a[8] = "0"; char *pd = (a + r); const char *ps = (a); strcpy (pd, ps); sink (a, pd, ps); } } while (0);

  r = signed_range ((2), (5));
  do { if (!0 || 0 == 687) { char a[8] = "01"; char *pd = (a + r); const char *ps = (a); strcpy (pd, ps); sink (a, pd, ps); } } while (0);
  do { if (!0 || 0 == 688) { char a[8] = "012"; char *pd = (a + r); const char *ps = (a); strcpy (pd, ps); sink (a, pd, ps); } } while (0);



  do { if (!0 || 0 == 692) { char a[8] = "0123"; char *pd = (a + r); const char *ps = (a); strcpy (pd, ps); sink (a, pd, ps); } } while (0);



  do { if (!0 || 0 == 696) { char a[9] = "0123"; char *pd = (a + r); const char *ps = (a); strcpy (pd, ps); sink (a, pd, ps); } } while (0);




  do { if (!0 || 0 == 701) { char a[10] = "0123"; char *pd = (a + r); const char *ps = (a); strcpy (pd, ps); sink (a, pd, ps); } } while (0);


  r = signed_range ((3), (4));
  do { if (!0 || 0 == 705) { char a[8] = "01"; char *pd = (a + r); const char *ps = (a); strcpy (pd, ps); sink (a, pd, ps); } } while (0);
  do { if (!0 || 0 == 706) { char a[8] = "012"; char *pd = (a + r); const char *ps = (a); strcpy (pd, ps); sink (a, pd, ps); } } while (0);



  do { if (!0 || 0 == 710) { char a[8] = "0123"; char *pd = (a + r); const char *ps = (a); strcpy (pd, ps); sink (a, pd, ps); } } while (0);



  do { if (!0 || 0 == 714) { char a[9] = "0123"; char *pd = (a + r); const char *ps = (a); strcpy (pd, ps); sink (a, pd, ps); } } while (0);




  do { if (!0 || 0 == 719) { char a[10] = "0123"; char *pd = (a + r); const char *ps = (a); strcpy (pd, ps); sink (a, pd, ps); } } while (0);

  do { if (!0 || 0 == 721) { char a[8] = "01"; char *pd = (a); const char *ps = (a + r); strcpy (pd, ps); sink (a, pd, ps); } } while (0);
  do { if (!0 || 0 == 722) { char a[8] = "012"; char *pd = (a); const char *ps = (a + r); strcpy (pd, ps); sink (a, pd, ps); } } while (0);
  do { if (!0 || 0 == 723) { char a[8] = "0123"; char *pd = (a); const char *ps = (a + r); strcpy (pd, ps); sink (a, pd, ps); } } while (0);
  do { if (!0 || 0 == 724) { char a[8] = "01234"; char *pd = (a); const char *ps = (a + r); strcpy (pd, ps); sink (a, pd, ps); } } while (0);





  do { if (!0 || 0 == 730) { char a[8] = "012345"; char *pd = (a); const char *ps = (a + r); strcpy (pd, ps); sink (a, pd, ps); } } while (0);
  do { if (!0 || 0 == 731) { char a[8] = "0123456"; char *pd = (a); const char *ps = (a + r); strcpy (pd, ps); sink (a, pd, ps); } } while (0);

  r = signed_range ((3), (0x7fff - 3));
  do { if (!0 || 0 == 734) { char a[8] = "01"; char *pd = (a + r); const char *ps = (a); strcpy (pd, ps); sink (a, pd, ps); } } while (0);






  do { if (!0 || 0 == 741) { char a[8] = "012"; char *pd = (a + r); const char *ps = (a); strcpy (pd, ps); sink (a, pd, ps); } } while (0);

  r = signed_range ((0x7fff - 2), (0x7fff - 1));
  do { if (!0 || 0 == 744) { char a[8] = "012"; char *pd = (a + r); const char *ps = (a); strcpy (pd, ps); sink (a, pd, ps); } } while (0);


  r = signed_value ();



  do { if (!0 || 0 == 751) { char a[8] = ""; char *pd = (a); const char *ps = (a + r); strcpy (pd, ps); sink (a, pd, ps); } } while (0);
  do { if (!0 || 0 == 752) { char a[8] = "0"; char *pd = (a + r); const char *ps = (a); strcpy (pd, ps); sink (a, pd, ps); } } while (0);
  do { if (!0 || 0 == 753) { char a[8] = "012"; char *pd = (a + r); const char *ps = (a); strcpy (pd, ps); sink (a, pd, ps); } } while (0);

  do { if (!0 || 0 == 755) { char a[8] = ""; char *pd = (a); const char *ps = (a + r); strcpy (pd, ps); sink (a, pd, ps); } } while (0);
  do { if (!0 || 0 == 756) { char a[8] = "0"; char *pd = (a); const char *ps = (a + r); strcpy (pd, ps); sink (a, pd, ps); } } while (0);
  do { if (!0 || 0 == 757) { char a[8] = "012"; char *pd = (a); const char *ps = (a + r); strcpy (pd, ps); sink (a, pd, ps); } } while (0);
}



void test_strcpy_var (char *d, const char *s)
{
# 774 "j.c"
  do { if (!0 || 0 == 774) { char *pd = (d); const char *ps = (s); strcpy (pd, ps); sink (pd, ps); } } while (0);

  do { if (!0 || 0 == 776) { char *pd = (d); const char *ps = (&d[0]); strcpy (pd, ps); sink (pd, ps); } } while (0);
  do { if (!0 || 0 == 777) { char *pd = (&d[0]); const char *ps = (d); strcpy (pd, ps); sink (pd, ps); } } while (0);

  s = d;
  do { if (!0 || 0 == 780) { char *pd = (d); const char *ps = (s); strcpy (pd, ps); sink (pd, ps); } } while (0);



  do { if (!0 || 0 == 784) { char *pd = (d); const char *ps = (d + 1); strcpy (pd, ps); sink (pd, ps); } } while (0);



  int r = signed_range ((2), (3));
  do { if (!0 || 0 == 789) { char *pd = (d); const char *ps = (d + r); strcpy (pd, ps); sink (pd, ps); } } while (0);



  s = d + signed_value ();
  do { if (!0 || 0 == 794) { char *pd = (d); const char *ps = (s); strcpy (pd, ps); sink (pd, ps); } } while (0);
}



void test_strncpy_cst (void)
{
# 812 "j.c"
  do { if (!0 || 0 == 812) { char a[9] = "012"; char *pd = (a); const char *ps = (a); strncpy (pd, ps, (0)); sink (a, pd, ps); } } while (0);
  do { if (!0 || 0 == 813) { char a[9] = "012"; char *pd = (a); const char *ps = (a); strncpy (pd, ps, (1)); sink (a, pd, ps); } } while (0);

  do { if (!0 || 0 == 815) { char a[9] = "012"; char *pd = (a); const char *ps = (a + 1); strncpy (pd, ps, (1)); sink (a, pd, ps); } } while (0);
  do { if (!0 || 0 == 816) { char a[9] = "012"; char *pd = (a); const char *ps = (a + 1); strncpy (pd, ps, (2)); sink (a, pd, ps); } } while (0);
  do { if (!0 || 0 == 817) { char a[9] = "012"; char *pd = (a); const char *ps = (a + 1); strncpy (pd, ps, (3)); sink (a, pd, ps); } } while (0);
  do { if (!0 || 0 == 818) { char a[9] = "012"; char *pd = (a); const char *ps = (a + 1); strncpy (pd, ps, (4)); sink (a, pd, ps); } } while (0);
  do { if (!0 || 0 == 819) { char a[9] = "012"; char *pd = (a); const char *ps = (a + 1); strncpy (pd, ps, (5)); sink (a, pd, ps); } } while (0);
  do { if (!0 || 0 == 820) { char a[9] = "012"; char *pd = (a); const char *ps = (a + 1); strncpy (pd, ps, (6)); sink (a, pd, ps); } } while (0);

  do { if (!0 || 0 == 822) { char a[9] = "012"; char *pd = (a); const char *ps = (a + 2); strncpy (pd, ps, (1)); sink (a, pd, ps); } } while (0);
  do { if (!0 || 0 == 823) { char a[9] = "012"; char *pd = (a); const char *ps = (a + 2); strncpy (pd, ps, (2)); sink (a, pd, ps); } } while (0);

  do { if (!0 || 0 == 825) { char a[9] = "012"; char *pd = (a); const char *ps = (a + 2); strncpy (pd, ps, (3)); sink (a, pd, ps); } } while (0);
  do { if (!0 || 0 == 826) { char a[9] = "012"; char *pd = (a); const char *ps = (a + 2); strncpy (pd, ps, (4)); sink (a, pd, ps); } } while (0);
  do { if (!0 || 0 == 827) { char a[9] = "012"; char *pd = (a); const char *ps = (a + 2); strncpy (pd, ps, (5)); sink (a, pd, ps); } } while (0);

  do { if (!0 || 0 == 829) { char a[9] = "0123"; char *pd = (a); const char *ps = (a + 2); strncpy (pd, ps, (1)); sink (a, pd, ps); } } while (0);
  do { if (!0 || 0 == 830) { char a[9] = "0123"; char *pd = (a); const char *ps = (a + 2); strncpy (pd, ps, (2)); sink (a, pd, ps); } } while (0);

  do { if (!0 || 0 == 832) { char a[9] = "0123"; char *pd = (a); const char *ps = (a + 2); strncpy (pd, ps, (3)); sink (a, pd, ps); } } while (0);
  do { if (!0 || 0 == 833) { char a[9] = "0123"; char *pd = (a); const char *ps = (a + 2); strncpy (pd, ps, (4)); sink (a, pd, ps); } } while (0);
  do { if (!0 || 0 == 834) { char a[9] = "0123"; char *pd = (a); const char *ps = (a + 2); strncpy (pd, ps, (5)); sink (a, pd, ps); } } while (0);
  do { if (!0 || 0 == 835) { char a[9] = "0123"; char *pd = (a); const char *ps = (a + 2); strncpy (pd, ps, (6)); sink (a, pd, ps); } } while (0);

  do { if (!0 || 0 == 837) { char a[9] = "01234"; char *pd = (a); const char *ps = (a + 2); strncpy (pd, ps, (1)); sink (a, pd, ps); } } while (0);
  do { if (!0 || 0 == 838) { char a[9] = "01234"; char *pd = (a); const char *ps = (a + 2); strncpy (pd, ps, (2)); sink (a, pd, ps); } } while (0);
  do { if (!0 || 0 == 839) { char a[9] = "01234"; char *pd = (a); const char *ps = (a + 2); strncpy (pd, ps, (3)); sink (a, pd, ps); } } while (0);

  do { if (!0 || 0 == 841) { char a[9] = "01234"; char *pd = (a); const char *ps = (a + 2); strncpy (pd, ps, (4)); sink (a, pd, ps); } } while (0);
  do { if (!0 || 0 == 842) { char a[9] = "01234"; char *pd = (a); const char *ps = (a + 2); strncpy (pd, ps, (5)); sink (a, pd, ps); } } while (0);
}




void test_strncpy_range (char *d, size_t n)
{
# 859 "j.c"
  ptrdiff_t i;

  i = signed_range ((0), (1));
  do { if (!0 || 0 == 862) { char a[9] = "0123"; strncpy ((a), (a + i), (0)); sink (a, (a), (a + i)); } } while (0);
  do { if (!0 || 0 == 863) { char a[9] = "0123"; strncpy ((a), (a + i), (1)); sink (a, (a), (a + i)); } } while (0);



  do { if (!0 || 0 == 867) { char a[9] = "0123"; strncpy ((a), (a + i), (2)); sink (a, (a), (a + i)); } } while (0);

  i = signed_range ((1), (5));
  do { if (!0 || 0 == 870) { char a[9] = "0123"; strncpy ((a), (a + i), (0)); sink (a, (a), (a + i)); } } while (0);
  do { if (!0 || 0 == 871) { char a[9] = "0123"; strncpy ((a), (a + i), (1)); sink (a, (a), (a + i)); } } while (0);
  do { if (!0 || 0 == 872) { char a[9] = "0123"; strncpy ((a), (a + i), (2)); sink (a, (a), (a + i)); } } while (0);
  do { if (!0 || 0 == 873) { char a[9] = "0123"; strncpy ((a), (a + i), (3)); sink (a, (a), (a + i)); } } while (0);
  do { if (!0 || 0 == 874) { char a[9] = "0123"; strncpy ((a), (a + i), (4)); sink (a, (a), (a + i)); } } while (0);
  do { if (!0 || 0 == 875) { char a[9] = "0123"; strncpy ((a), (a + i), (5)); sink (a, (a), (a + i)); } } while (0);

  i = signed_range ((2), (5));
  do { if (!0 || 0 == 878) { char a[9] = "0123"; strncpy ((a), (a + i), (0)); sink (a, (a), (a + i)); } } while (0);
  do { if (!0 || 0 == 879) { char a[9] = "0123"; strncpy ((a), (a + i), (1)); sink (a, (a), (a + i)); } } while (0);
  do { if (!0 || 0 == 880) { char a[9] = "0123"; strncpy ((a), (a + i), (2)); sink (a, (a), (a + i)); } } while (0);
  do { if (!0 || 0 == 881) { char a[9] = "0123"; strncpy ((a), (a + i), (3)); sink (a, (a), (a + i)); } } while (0);
  do { if (!0 || 0 == 882) { char a[9] = "0123"; strncpy ((a), (a + i), (4)); sink (a, (a), (a + i)); } } while (0);
  do { if (!0 || 0 == 883) { char a[9] = "0123"; strncpy ((a), (a + i), (5)); sink (a, (a), (a + i)); } } while (0);



  do { if (!0 || 0 == 887) { char a[9] = "0123"; strncpy ((a), (a + i), (6)); sink (a, (a), (a + i)); } } while (0);

  i = signed_range ((3), (5));
  do { if (!0 || 0 == 890) { char a[9] = "0123"; strncpy ((a), (a + i), (0)); sink (a, (a), (a + i)); } } while (0);
  do { if (!0 || 0 == 891) { char a[9] = "0123"; strncpy ((a), (a + i), (1)); sink (a, (a), (a + i)); } } while (0);
  do { if (!0 || 0 == 892) { char a[9] = "0123"; strncpy ((a), (a + i), (2)); sink (a, (a), (a + i)); } } while (0);
  do { if (!0 || 0 == 893) { char a[9] = "0123"; strncpy ((a), (a + i), (3)); sink (a, (a), (a + i)); } } while (0);
  do { if (!0 || 0 == 894) { char a[9] = "0123"; strncpy ((a), (a + i), (4)); sink (a, (a), (a + i)); } } while (0);
  do { if (!0 || 0 == 895) { char a[9] = "0123"; strncpy ((a), (a + i), (5)); sink (a, (a), (a + i)); } } while (0);






  do { if (!0 || 0 == 902) { char a[9] = "0123"; strncpy ((a), (a + i), (6)); sink (a, (a), (a + i)); } } while (0);

  i = signed_range ((4), (5));
  do { if (!0 || 0 == 905) { char a[9] = "0123"; strncpy ((a), (a + i), (0)); sink (a, (a), (a + i)); } } while (0);
  do { if (!0 || 0 == 906) { char a[9] = "0123"; strncpy ((a), (a + i), (1)); sink (a, (a), (a + i)); } } while (0);
  do { if (!0 || 0 == 907) { char a[9] = "0123"; strncpy ((a), (a + i), (2)); sink (a, (a), (a + i)); } } while (0);
  do { if (!0 || 0 == 908) { char a[9] = "0123"; strncpy ((a), (a + i), (3)); sink (a, (a), (a + i)); } } while (0);
  do { if (!0 || 0 == 909) { char a[9] = "0123"; strncpy ((a), (a + i), (4)); sink (a, (a), (a + i)); } } while (0);
  do { if (!0 || 0 == 910) { char a[9] = "0123"; strncpy ((a), (a + i), (5)); sink (a, (a), (a + i)); } } while (0);




  do { if (!0 || 0 == 915) { char a[9] = "0123"; strncpy ((a), (a + i), (6)); sink (a, (a), (a + i)); } } while (0);
# 929 "j.c"
  do { if (!0 || 0 == 929) { char a[9] = "01234567"; strncpy ((a), (a + i), (unsigned_range ((4), (6)))); sink (a, (a), (a + i)); } } while (0);


  do { if (!0 || 0 == 932) { char a[9] = "01234567"; strncpy ((d), (d + i), (unsigned_range ((4), (6)))); sink (a, (d), (d + i)); } } while (0);

  do { if (!0 || 0 == 934) { char a[9] = "01234567"; strncpy ((a), (a + i), (unsigned_range ((6), (7)))); sink (a, (a), (a + i)); } } while (0);



  do { if (!0 || 0 == 938) { char a[9] = "012"; strncpy ((a), (a), (n)); sink (a, (a), (a)); } } while (0);
}




void test_strncpy_var (char *d, const char *s, size_t n)
{
# 956 "j.c"
  do { if (!0 || 0 == 956) { char *pd = (d); const char *ps = (s); strncpy (pd, ps, (1)); sink (pd, ps); } } while (0);
  do { if (!0 || 0 == 957) { char *pd = (d); const char *ps = (s); strncpy (pd, ps, (n)); sink (pd, ps); } } while (0);

  do { if (!0 || 0 == 959) { char *pd = (d); const char *ps = (d); strncpy (pd, ps, (1)); sink (pd, ps); } } while (0);
  do { if (!0 || 0 == 960) { char *pd = (d); const char *ps = (d); strncpy (pd, ps, (n)); sink (pd, ps); } } while (0);

  do { if (!0 || 0 == 962) { char *pd = (d); const char *ps = (d + 1); strncpy (pd, ps, (1)); sink (pd, ps); } } while (0);
  do { if (!0 || 0 == 963) { char *pd = (d); const char *ps = (d + 1); strncpy (pd, ps, (2)); sink (pd, ps); } } while (0);
  do { if (!0 || 0 == 964) { char *pd = (d + 1); const char *ps = (d); strncpy (pd, ps, (1)); sink (pd, ps); } } while (0);
  do { if (!0 || 0 == 965) { char *pd = (d + 1); const char *ps = (d); strncpy (pd, ps, (2)); sink (pd, ps); } } while (0);
}

struct MemberArrays
{
  char a[7];
  char b[8];
  char c[9];
};

void test_strncpy_strcpy_var (struct MemberArrays *ar, const char *s)
{

  strncpy (ar->b, s, sizeof ar->b - 1);
  ar->b[sizeof ar->b - 1] = '\0';
  strcpy (ar->a, ar->b);
  sink (ar);



  strncpy (ar->c, s, sizeof ar->c - 1);
  ar->c[sizeof ar->c - 1] = '\0';
  strcpy (ar->a, ar->c);
  sink (ar);
}
Vladimir Makarov Aug. 9, 2024, 5:02 p.m. UTC | #6
On 8/9/24 08:58, Surya Kumari Jangala wrote:
> I am looking into this failure.
>
Sorry for delay with this email.  I was on vacation.

I believe your should reverse the original patch and all the patches you 
submitted to fix the issues with the original patch.

This is a standard procedure in such case.  You should do a better 
testing you patches
Kyrylo Tkachov Aug. 9, 2024, 7:46 p.m. UTC | #7
> On 9 Aug 2024, at 19:02, Vladimir Makarov <vmakarov@redhat.com> wrote:
> 
> External email: Use caution opening links or attachments
> 
> 
> On 8/9/24 08:58, Surya Kumari Jangala wrote:
>> I am looking into this failure.
>> 
> Sorry for delay with this email.  I was on vacation.
> 
> I believe your should reverse the original patch and all the patches you
> submitted to fix the issues with the original patch.
> 
> This is a standard procedure in such case.  You should do a better
> testing you patches
> 

Hello,
I’ve pushed a revert with 4734c1bfe837b3e70bc783dafc442de3bca43d88 so that testers can work on aarch64 over the weekend.

Thanks,
Kyrill
Peter Bergner Aug. 9, 2024, 9 p.m. UTC | #8
On 8/9/24 12:02 PM, Vladimir Makarov wrote:
> I believe your should reverse the original patch and all the patches you
> submitted to fix the issues with the original patch.

I agree this commit should be reverted and Kyrill has pushed that already,
so bootstrap should be restored now.  Thank you Kyrill.  Surya was testing
her revert commit too, but was waiting for her bootstrap to complete before
pushing (per process rules).  It's just the cfarm systems she has access
to were being slow.

I do *not* agree that all the previous patches should be reverted, since they
fixed *real* bugs and really only exposed other latent issues which Surya
has been working on.



> You should do a better testing you patches

It is not correct to presume she did not test her patches thoroughly.
I know she has, but with the large number of supported architectures
and ABIs on those architectures, she cannot possibly test everything.
That's why we have stage1 and our patch revert process.


Peter
Vladimir Makarov Aug. 9, 2024, 9:55 p.m. UTC | #9
On 8/9/24 17:00, Peter Bergner wrote:
> On 8/9/24 12:02 PM, Vladimir Makarov wrote:
>> I believe your should reverse the original patch and all the patches you
>> submitted to fix the issues with the original patch.
> I agree this commit should be reverted and Kyrill has pushed that already,
> so bootstrap should be restored now.  Thank you Kyrill.  Surya was testing
> her revert commit too, but was waiting for her bootstrap to complete before
> pushing (per process rules).  It's just the cfarm systems she has access
> to were being slow.
>
> I do *not* agree that all the previous patches should be reverted, since they
> fixed *real* bugs and really only exposed other latent issues which Surya
> has been working on.
>
>
>
>> You should do a better testing you patches
> It is not correct to presume she did not test her patches thoroughly.
> I know she has, but with the large number of supported architectures
> and ABIs on those architectures, she cannot possibly test everything.
> That's why we have stage1 and our patch revert process.
>
Sorry, I did not finish writing my email and sent it accidentally.  I 
wanted to explain more in my email.

I am agree I was wrong about reverting all her previous patches.

Still, for GCC developer novice, I think it is important to test all 
major targets and aarch64 (one target on which bootstrap was broken) is 
the 2nd most important target.  I myself always test x86-64, aarch64, 
and ppc64le (except for trivial changes).  For patches which probably 
affect performance, I do SPEC17 on x86-64 but I don't require it from 
others for RA patches because it might be not possible to do this.  
Still I benchmark others patches by myself.

Reason for my email is that when any bootstrap is broken, I think it 
should be fixed as soon as possible and the fastest way to do is to 
revert it.  At least that is what I'd do if somebody reported about this 
yesterday.

Everybody can make a mistake, especially people with little experience.  
I hope my email  will not discourage Surya to work on GCC.
Xi Ruoyao Aug. 10, 2024, 3:11 a.m. UTC | #10
On Fri, 2024-08-09 at 17:55 -0400, Vladimir Makarov wrote:

> Still, for GCC developer novice, I think it is important to test all 
> major targets and aarch64 (one target on which bootstrap was broken) is 
> the 2nd most important target.

Linaro CI will complain (via off-list email) if a patch posted on the
list breaks aarch64.  It complained some of my patches and I fixed them
before commit.  Why this case was not caught?
Andrew Pinski Aug. 10, 2024, 3:15 a.m. UTC | #11
On Fri, Aug 9, 2024 at 8:11 PM Xi Ruoyao <xry111@xry111.site> wrote:
>
> On Fri, 2024-08-09 at 17:55 -0400, Vladimir Makarov wrote:
>
> > Still, for GCC developer novice, I think it is important to test all
> > major targets and aarch64 (one target on which bootstrap was broken) is
> > the 2nd most important target.
>
> Linaro CI will complain (via off-list email) if a patch posted on the
> list breaks aarch64.  It complained some of my patches and I fixed them
> before commit.  Why this case was not caught?

I had been wondering the same until I looked into it earlier today.
Linaro CI's does `--disable-bootstrap` and there was no extra
testsuite failures with the patch.
So Linaro CI's is not catching all the bugs that a developer would
catch in the end. Because bootstrap is one of the normal requirements;
though usually only on one target.

Thanks,
Andrew Pinski

>
> --
> Xi Ruoyao <xry111@xry111.site>
> School of Aerospace Science and Technology, Xidian University
Mark Wielaard Aug. 11, 2024, 10:06 p.m. UTC | #12
Hi,

On Fri, Aug 09, 2024 at 08:15:31PM -0700, Andrew Pinski wrote:
> I had been wondering the same until I looked into it earlier today.
> Linaro CI's does `--disable-bootstrap` and there was no extra
> testsuite failures with the patch.
> So Linaro CI's is not catching all the bugs that a developer would
> catch in the end. Because bootstrap is one of the normal requirements;
> though usually only on one target.

Sam pointed out the same about the gcc arm64 build on
builder.sourceware.org. We enabled full bootrap and tests for that
architecture now.

fedora rawhide x86_64 (*), debian stable amd64, debian stable arm64,
fedora riscv and gentoo sparc.

https://builder.sourceware.org/buildbot/#/builders?tags=gcc-full

Note that these builds don't sent any email atm (they probably should
on build failure), so you would have to check by hand after commit
(after a a couple of hours). Test results are uploaded to bunsen.

Cheers,

Mark

(*) that one seems to loose a connection after a couple of ours
during the testsuite run though.
diff mbox series

Patch

diff --git a/gcc/lra-constraints.cc b/gcc/lra-constraints.cc
index 92b343fa99a..34f2461f791 100644
--- a/gcc/lra-constraints.cc
+++ b/gcc/lra-constraints.cc
@@ -143,6 +143,7 @@  static int bb_reload_num;
    (NULL otherwise), its data (basic block, the insn data, the insn
    static data, and the mode of each operand).  */
 static rtx_insn *curr_insn;
+static rtx_insn *latest_call_insn;
 static rtx curr_insn_set;
 static basic_block curr_bb;
 static lra_insn_recog_data_t curr_id;
@@ -6286,10 +6287,14 @@  split_reg (bool before_p, int original_regno, rtx_insn *insn,
 			 after_p ? restore : NULL,
 			 call_save_p
 			 ?  "Add reg<-save" : "Add reg<-split");
-  lra_process_new_insns (insn, before_p ? save : NULL,
-			 before_p ? NULL : save,
-			 call_save_p
-			 ?  "Add save<-reg" : "Add split<-reg");
+  if (call_save_p)
+    lra_process_new_insns (PREV_INSN (latest_call_insn), NULL, save,
+			   "Add save<-reg");
+  else
+    lra_process_new_insns (insn, before_p ? save : NULL,
+			   before_p ? NULL : save,
+			   call_save_p
+			   ?  "Add save<-reg" : "Add split<-reg");
   if (nregs > 1 || original_regno < FIRST_PSEUDO_REGISTER)
     /* If we are trying to split multi-register.  We should check
        conflicts on the next assignment sub-pass.  IRA can allocate on
@@ -6773,6 +6778,7 @@  inherit_in_ebb (rtx_insn *head, rtx_insn *tail)
   last_processed_bb = NULL;
   CLEAR_HARD_REG_SET (potential_reload_hard_regs);
   live_hard_regs = eliminable_regset | lra_no_alloc_regs;
+  latest_call_insn = NULL;
   /* We don't process new insns generated in the loop.	*/
   for (curr_insn = tail; curr_insn != PREV_INSN (head); curr_insn = prev_insn)
     {
@@ -6985,6 +6991,7 @@  inherit_in_ebb (rtx_insn *head, rtx_insn *tail)
 	      last_call_for_abi[callee_abi.id ()] = calls_num;
 	      full_and_partial_call_clobbers
 		|= callee_abi.full_and_partial_reg_clobbers ();
+	      latest_call_insn = curr_insn;
 	      if ((cheap = find_reg_note (curr_insn,
 					  REG_RETURNED, NULL_RTX)) != NULL_RTX
 		  && ((cheap = XEXP (cheap, 0)), true)
diff --git a/gcc/testsuite/gcc.dg/ira-shrinkwrap-prep-1.c b/gcc/testsuite/gcc.dg/ira-shrinkwrap-prep-1.c
index a95637abbe5..8c150972f95 100644
--- a/gcc/testsuite/gcc.dg/ira-shrinkwrap-prep-1.c
+++ b/gcc/testsuite/gcc.dg/ira-shrinkwrap-prep-1.c
@@ -26,4 +26,4 @@  bar (long a)
 
 /* { dg-final { scan-rtl-dump "Will split live ranges of parameters" "ira" } } */
 /* { dg-final { scan-rtl-dump "Split live-range of register" "ira" { xfail { ! aarch64*-*-* } } } } */
-/* { dg-final { scan-rtl-dump "Performing shrink-wrapping" "pro_and_epilogue" { xfail powerpc*-*-* } } } */
+/* { dg-final { scan-rtl-dump "Performing shrink-wrapping" "pro_and_epilogue" } } */
diff --git a/gcc/testsuite/gcc.dg/pr10474.c b/gcc/testsuite/gcc.dg/pr10474.c
index a4af536ec28..b5393d5b6e3 100644
--- a/gcc/testsuite/gcc.dg/pr10474.c
+++ b/gcc/testsuite/gcc.dg/pr10474.c
@@ -13,4 +13,4 @@  void f(int *i)
 }
 
 /* XFAIL due to PR70681.  */ 
-/* { dg-final { scan-rtl-dump "Performing shrink-wrapping" "pro_and_epilogue"  { xfail arm*-*-* powerpc*-*-* } } } */
+/* { dg-final { scan-rtl-dump "Performing shrink-wrapping" "pro_and_epilogue"  { xfail arm*-*-* } } } */