diff options
author | Andrew Hsieh <andrewhsieh@google.com> | 2015-03-26 15:43:10 -0700 |
---|---|---|
committer | Andrew Hsieh <andrewhsieh@google.com> | 2015-03-26 15:43:10 -0700 |
commit | 7c97a89b191212146e0a723f7bf7507de26fd65e (patch) | |
tree | 8c30b42adc00e9f2888474772f1274a83be81dec /gcc-4.9/gcc/testsuite | |
parent | 9f57376006c7afb1561fe3e7a8d8be64f3196acd (diff) | |
download | toolchain_gcc-7c97a89b191212146e0a723f7bf7507de26fd65e.zip toolchain_gcc-7c97a89b191212146e0a723f7bf7507de26fd65e.tar.gz toolchain_gcc-7c97a89b191212146e0a723f7bf7507de26fd65e.tar.bz2 |
Backport a fix about gcc-4.9 crash at the presence of #pragma GCC optimize ("O0")
In google/google-4_9 branch
------------------------------------------------------------------------
r221700 | wmi | 2015-03-26 11:11:16 -0700 (Thu, 26 Mar 2015) | 13 lines
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.
Change-Id: I6bd7353b65fb918f9651dd737cbe3112fca1fa17
Diffstat (limited to 'gcc-4.9/gcc/testsuite')
-rw-r--r-- | gcc-4.9/gcc/testsuite/gcc.dg/19277289.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/19277289.c b/gcc-4.9/gcc/testsuite/gcc.dg/19277289.c new file mode 100644 index 0000000..9f7703e --- /dev/null +++ b/gcc-4.9/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()); +} |