view gcc/testsuite/gcc.dg/pr51879-17.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-options "-O2 -ftree-tail-merge -fdump-tree-pre" } */

struct S {
  int i;
};

extern struct S foo (void);
extern int foo2 (void);

struct S s, s2;

int bar (int c) {
  int r;

  if (c)
    {
      s = foo ();
      r = foo2 ();
    }
  else
    {
      s2 = foo ();
      r = foo2 ();
    }

  return r;
}

/* { dg-final { scan-tree-dump-times "foo \\(" 2 "pre"} } */
/* { dg-final { scan-tree-dump-times "foo2 \\(" 2 "pre"} } */