tree-optimization/113197 - bougs assert in PTA

Message ID 20240930071032.6E028136CB@imap1.dmz-prg2.suse.org
State Committed
Commit 02f4efe3c12cf7ef54e5a71b11044c15be5c7fab
Headers
Series tree-optimization/113197 - bougs assert in PTA |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_gcc_build--master-arm success Build passed
linaro-tcwg-bot/tcwg_gcc_check--master-arm success Test passed
linaro-tcwg-bot/tcwg_gcc_build--master-aarch64 success Build passed
linaro-tcwg-bot/tcwg_gcc_check--master-aarch64 success Test passed

Commit Message

Richard Biener Sept. 30, 2024, 7:10 a.m. UTC
  PTA asserts that EAF_NO_DIRECT_READ is not set when flags are
set consistently which doesn't make sense.  The following removes
the assert.

Bootstrap & regtest running on x86_64-unknown-linux-gnu.

Richard.

	PR tree-optimization/113197
	* tree-ssa-structalias.cc (handle_call_arg): Remove bougs
	assert.

	* gcc.dg/lto/pr113197_0.c: New testcase.
	* gcc.dg/lto/pr113197_1.c: Likewise.
---
 gcc/testsuite/gcc.dg/lto/pr113197_0.c | 15 +++++++++++++++
 gcc/testsuite/gcc.dg/lto/pr113197_1.c |  3 +++
 gcc/tree-ssa-structalias.cc           |  1 -
 3 files changed, 18 insertions(+), 1 deletion(-)
 create mode 100644 gcc/testsuite/gcc.dg/lto/pr113197_0.c
 create mode 100644 gcc/testsuite/gcc.dg/lto/pr113197_1.c
  

Patch

diff --git a/gcc/testsuite/gcc.dg/lto/pr113197_0.c b/gcc/testsuite/gcc.dg/lto/pr113197_0.c
new file mode 100644
index 00000000000..293c8207dee
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/pr113197_0.c
@@ -0,0 +1,15 @@ 
+/* { dg-lto-do link } */
+/* { dg-lto-options { { -O -flto -fpie } } } */
+/* { dg-extra-ld-options { -r -nostdlib -flinker-output=nolto-rel } } */
+
+enum a { b } register_dccp();
+void c();
+void __attribute__((noreturn)) exit_error(enum a d) {
+  __builtin_va_list va;
+  __builtin_va_end(va);
+  if (d)
+    c();
+  c();
+  __builtin_exit(1);
+}
+int main() { register_dccp(); }
diff --git a/gcc/testsuite/gcc.dg/lto/pr113197_1.c b/gcc/testsuite/gcc.dg/lto/pr113197_1.c
new file mode 100644
index 00000000000..30bf6f7e7c5
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/pr113197_1.c
@@ -0,0 +1,3 @@ 
+int a;
+void exit_error();
+void register_dccp() { exit_error(a); }
diff --git a/gcc/tree-ssa-structalias.cc b/gcc/tree-ssa-structalias.cc
index 54c4818998d..73ba5aa6195 100644
--- a/gcc/tree-ssa-structalias.cc
+++ b/gcc/tree-ssa-structalias.cc
@@ -4194,7 +4194,6 @@  handle_call_arg (gcall *stmt, tree arg, vec<ce_s> *results, int flags,
     {
       make_transitive_closure_constraints (tem);
       callarg_transitive = true;
-      gcc_checking_assert (!(flags & EAF_NO_DIRECT_READ));
     }
 
   /* If necessary, produce varinfo for indirect accesses to ARG.  */