From: Richard Biener Date: Tue, 2 May 2017 11:27:15 +0000 (+0000) Subject: re PR tree-optimization/80591 (AArch64 kernel miscompilation starting with r246809) X-Git-Tag: upstream/12.2.0~39833 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=aee63acc76771bb7bec72073ca8a5a2efff2d6fd;p=platform%2Fupstream%2Fgcc.git re PR tree-optimization/80591 (AArch64 kernel miscompilation starting with r246809) 2017-05-02 Richard Biener PR tree-optimization/80591 Revert 2017-04-10 Richard Biener * tree-ssa-structalias.c (find_func_aliases): Properly handle asm inputs. * gcc.dg/torture/pr80591.c: New testcase. From-SVN: r247488 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5cbb7e7..e411cc3 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,14 @@ 2017-05-02 Richard Biener + PR tree-optimization/80591 + Revert + 2017-04-10 Richard Biener + + * tree-ssa-structalias.c (find_func_aliases): Properly handle + asm inputs. + +2017-05-02 Richard Biener + PR tree-optimization/80549 * tree-cfgcleanup.c (mfb_keep_latches): New helper. (cleanup_tree_cfg_noloop): Create forwarders to known loop diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 5c4b7df..84f2c30 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,10 @@ 2017-05-02 Richard Biener + PR tree-optimization/80591 + * gcc.dg/torture/pr80591.c: New testcase. + +2017-05-02 Richard Biener + PR tree-optimization/80549 * gcc.dg/torture/pr80549.c: New testcase. diff --git a/gcc/testsuite/gcc.dg/torture/pr80591.c b/gcc/testsuite/gcc.dg/torture/pr80591.c new file mode 100644 index 0000000..5958474 --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr80591.c @@ -0,0 +1,20 @@ +/* PR tree-optimization/80591 */ +/* { dg-do compile } */ +/* { dg-skip-if "" { *-*-* } "-flto" } */ +/* { dg-additional-options "-fdump-tree-optimized" } */ + +static inline __attribute__((always_inline)) int * +foo (void) +{ + __UINTPTR_TYPE__ sp; + asm ("" : "=r" (sp)); + return (int *) sp; +} + +void +bar (void) +{ + foo ()[0] += 26; +} + +/* { dg-final { scan-tree-dump "\\+ 26;" "optimized" } } */ diff --git a/gcc/tree-ssa-structalias.c b/gcc/tree-ssa-structalias.c index 7b1bf10..2394edf 100644 --- a/gcc/tree-ssa-structalias.c +++ b/gcc/tree-ssa-structalias.c @@ -4978,14 +4978,14 @@ find_func_aliases (struct function *fn, gimple *origt) make_escape_constraint (build_fold_addr_expr (op)); /* The asm may read global memory, so outputs may point to - any global or escaped memory. */ + any global memory. */ if (op) { auto_vec lhsc; struct constraint_expr rhsc, *lhsp; unsigned j; get_constraint_for (op, &lhsc); - rhsc.var = escaped_id; + rhsc.var = nonlocal_id; rhsc.offset = 0; rhsc.type = SCALAR; FOR_EACH_VEC_ELT (lhsc, j, lhsp)