diff options
author | Carrot Wei <carrot@google.com> | 2015-03-26 18:11:16 +0000 |
---|---|---|
committer | Wei Mi <wmi@google.com> | 2015-03-26 18:11:16 +0000 |
commit | 5314e561e12c664564a05f8acd8f805ba599a907 (patch) | |
tree | bfceb07b7e35bc373016cf73369cdcc6bd2ba596 | |
parent | 73de66b60f9d11b16b03b85d05f3e78966370151 (diff) |
Fix the problem in b/19277289 by avoiding calling walk_aliased_vdefs in O0 function.
gcc/
2015-03-26 Carrot Wei <carrot@google.com>
* ipa-inline-analysis.c: Early return.
gcc/testsuite
2015-03-26 Carrot Wei <carrot@google.com>
* testsuite/gcc.dg/19277289.c: New test.
git-svn-id: https://gcc.gnu.org/svn/gcc/branches/google/gcc-4_9@221700 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/ipa-inline-analysis.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/19277289.c | 21 |
2 files changed, 23 insertions, 0 deletions
diff --git a/gcc/ipa-inline-analysis.c b/gcc/ipa-inline-analysis.c index a512ec5b5bb..904a5219273 100644 --- a/gcc/ipa-inline-analysis.c +++ b/gcc/ipa-inline-analysis.c @@ -2169,6 +2169,8 @@ param_change_prob (gimple stmt, int i) return 0; if (!bb->frequency) return REG_BR_PROB_BASE; + if (!optimize) + return REG_BR_PROB_BASE; ao_ref_init (&refd, op); info.stmt = stmt; info.bb_set = BITMAP_ALLOC (NULL); diff --git a/gcc/testsuite/gcc.dg/19277289.c b/gcc/testsuite/gcc.dg/19277289.c new file mode 100644 index 00000000000..9f7703e37cc --- /dev/null +++ b/gcc/testsuite/gcc.dg/19277289.c @@ -0,0 +1,21 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -w" } */ + +struct xktime { + int tv; +}; +typedef struct xktime xktime_t; + +__attribute__((always_inline)) xktime_t xktime_set(void) +{ + return (xktime_t) { .tv = 0 }; +} + +#pragma GCC optimize ("O0") + +extern void foo (xktime_t); + +void LCD_WaitTE(void) +{ + foo (xktime_set()); +} |