re PR tree-optimization/80591 (AArch64 kernel miscompilation starting with r246809)
authorRichard Biener <rguenther@suse.de>
Tue, 2 May 2017 11:27:15 +0000 (11:27 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Tue, 2 May 2017 11:27:15 +0000 (11:27 +0000)
2017-05-02  Richard Biener  <rguenther@suse.de>

PR tree-optimization/80591
Revert
2017-04-10  Richard Biener  <rguenther@suse.de>

* tree-ssa-structalias.c (find_func_aliases): Properly handle
asm inputs.

* gcc.dg/torture/pr80591.c: New testcase.

From-SVN: r247488

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/torture/pr80591.c [new file with mode: 0644]
gcc/tree-ssa-structalias.c

index 5cbb7e77679ed7c2269f5f63e2cdeeed14920794..e411cc310be738a28ac7591aa329e761e5cf3043 100644 (file)
@@ -1,3 +1,12 @@
+2017-05-02  Richard Biener  <rguenther@suse.de>
+
+       PR tree-optimization/80591
+       Revert
+       2017-04-10  Richard Biener  <rguenther@suse.de>
+
+       * tree-ssa-structalias.c (find_func_aliases): Properly handle
+       asm inputs.
+
 2017-05-02  Richard Biener  <rguenther@suse.de>
 
        PR tree-optimization/80549
index 5c4b7dfdeaf39e318d1130be2a4393eedf222857..84f2c309f4cc11dcf383a68acbdbdc1b27732d81 100644 (file)
@@ -1,3 +1,8 @@
+2017-05-02  Richard Biener  <rguenther@suse.de>
+
+       PR tree-optimization/80591
+       * gcc.dg/torture/pr80591.c: New testcase.
+
 2017-05-02  Richard Biener  <rguenther@suse.de>
 
        PR tree-optimization/80549
diff --git a/gcc/testsuite/gcc.dg/torture/pr80591.c b/gcc/testsuite/gcc.dg/torture/pr80591.c
new file mode 100644 (file)
index 0000000..5958474
--- /dev/null
@@ -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" } } */
index 7b1bf10e1cfaeedf3e27209383cdf8f44ce268c7..2394edf38268d0fa2de95074dfba3eb40b5000f9 100644 (file)
@@ -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<ce_s, 2> 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)