view gcc/testsuite/gcc.dg/store_merging_4.c @ 144:8f4e72ab4e11

fix segmentation fault caused by nothing next cur_op to end
author Takahiro SHIMIZU <anatofuz@cr.ie.u-ryukyu.ac.jp>
date Sun, 23 Dec 2018 21:23:56 +0900
parents 04ced10e8804
children
line wrap: on
line source

/* { dg-do compile } */
/* { dg-require-effective-target store_merge } */
/* { dg-options "-O2 -fdump-tree-store-merging" } */

/* Check that we can merge interleaving stores that are guaranteed
   to be non-aliasing.  */

struct bar
{
  int a;
  char b;
  char c;
  short d;
  char e;
  char f;
  char g;
};

void
foozero (struct bar *restrict p, struct bar *restrict p2)
{
  p->b = 0xff;
  p2->b = 0xa;
  p->a = 0xfffff;
  p2->a = 0xab;
  p2->c = 0xc;
  p->c = 0xff;
  p2->d = 0xbf;
  p->d = 0xfff;
}

/* { dg-final { scan-tree-dump-times "Merging successful" 2 "store-merging" } } */