From 2add94cd4415d64ea2a075abfa1ce74a9ee39053 Mon Sep 17 00:00:00 2001 From: Jan Hubicka Date: Sun, 5 Oct 2014 06:56:14 +0200 Subject: [PATCH] re PR ipa/61144 (Invalid optimizations for extern vars with local weak definitions) PR ipa/61144 * gcc.dg/tree-ssa/pr61144.c: New testcase. From-SVN: r215897 --- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.dg/tree-ssa/pr61144.c | 7 +++++++ 2 files changed, 12 insertions(+) create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/pr61144.c diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 4672a6830f7..39af7210829 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2014-10-04 Jan Hubicka + + PR ipa/61144 + * gcc.dg/tree-ssa/pr61144.c: New testcase. + 2014-10-04 Jan Hubicka * g++.dg/ipa/devirt-46.C: New testcase. diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr61144.c b/gcc/testsuite/gcc.dg/tree-ssa/pr61144.c new file mode 100644 index 00000000000..cd34b144e89 --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/pr61144.c @@ -0,0 +1,7 @@ +/* { dg-do compile } */ +/* { dg-require-weak "" } */ +/* { dg-options "-O2 -fdump-tree-optimized" } */ +static int dummy = 0; +extern int foo __attribute__((__weak__, __alias__("dummy"))); +int bar() { if (foo) return 1; return 0; } +/* { dg-final { scan-tree-dump-not "return 0" "optimized"} } */ -- 2.30.2