Blame SOURCES/gcc11-pr105331.patch

694bc6
2022-04-21  Jakub Jelinek  <jakub@redhat.com>
694bc6
694bc6
	PR target/105331
694bc6
	* config/i386/i386.c (ix86_gimplify_va_arg): Mark va_arg_tmp
694bc6
	temporary TREE_ADDRESSABLE before trying to gimplify ADDR_EXPR
694bc6
	of it.
694bc6
694bc6
	* gcc.dg/pr105331.c: New test.
694bc6
694bc6
--- gcc/config/i386/i386.c.jj	2022-04-12 09:20:07.566662842 +0200
694bc6
+++ gcc/config/i386/i386.c	2022-04-21 12:03:32.201951522 +0200
694bc6
@@ -4891,6 +4891,7 @@ ix86_gimplify_va_arg (tree valist, tree
694bc6
 	{
694bc6
 	  int i, prev_size = 0;
694bc6
 	  tree temp = create_tmp_var (type, "va_arg_tmp");
694bc6
+	  TREE_ADDRESSABLE (temp) = 1;
694bc6
 
694bc6
 	  /* addr = &tem;; */
694bc6
 	  t = build1 (ADDR_EXPR, build_pointer_type (type), temp);
694bc6
--- gcc/testsuite/gcc.dg/pr105331.c.jj	2022-04-21 12:09:34.398906718 +0200
694bc6
+++ gcc/testsuite/gcc.dg/pr105331.c	2022-04-21 12:09:07.304283903 +0200
694bc6
@@ -0,0 +1,11 @@
694bc6
+/* PR target/105331 */
694bc6
+/* { dg-do compile } */
694bc6
+/* { dg-options "-O -Wuninitialized" } */
694bc6
+
694bc6
+#include <stdarg.h>
694bc6
+
694bc6
+int
694bc6
+foo (va_list *va)
694bc6
+{
694bc6
+  return va_arg (*va, double _Complex);	/* { dg-bogus "may be used uninitialized" } */
694bc6
+}