aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2021-03-11 16:12:22 -0800
committerIan Lance Taylor <iant@golang.org>2021-03-11 16:12:22 -0800
commitbc636c218f2b28da06cd1404d5b35d1f8cc43fd1 (patch)
tree764937d8460563db6132d7c75e19b95ef3ea6ea8 /gcc/testsuite/gcc.dg
parent89d7be42db00cd0953e7d4584877cf50a56ed046 (diff)
parent7ad5a72c8bc6aa71a0d195ddfa207db01265fe0b (diff)
downloadgcc-bc636c218f2b28da06cd1404d5b35d1f8cc43fd1.zip
gcc-bc636c218f2b28da06cd1404d5b35d1f8cc43fd1.tar.gz
gcc-bc636c218f2b28da06cd1404d5b35d1f8cc43fd1.tar.bz2
Merge from trunk revision 7ad5a72c8bc6aa71a0d195ddfa207db01265fe0b.
Diffstat (limited to 'gcc/testsuite/gcc.dg')
-rw-r--r--gcc/testsuite/gcc.dg/Warray-bounds-69.c74
-rw-r--r--gcc/testsuite/gcc.dg/Wstringop-overflow-10.c6
-rw-r--r--gcc/testsuite/gcc.dg/Wstringop-overflow-47.c11
-rw-r--r--gcc/testsuite/gcc.dg/Wstringop-overflow-65.c98
-rw-r--r--gcc/testsuite/gcc.dg/Wstringop-overflow-66.c180
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/dot-output.c2
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/error-1.c66
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/error-2.c48
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/error-3.c11
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/feasibility-1.c16
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/pr93355-localealias-feasibility-2.c4
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/pr93355-localealias-feasibility-3.c8
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/pr93355-localealias-feasibility.c2
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/pr93355-localealias.c4
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/pr94047.c4
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/pr94596.c97
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/pr96841.c4
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/pr98969.c9
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/pr99193-1.c65
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/pr99193-2.c68
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/pr99193-3.c48
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/realloc-1.c55
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/unknown-fns-4.c2
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/zlib-2.c2
-rw-r--r--gcc/testsuite/gcc.dg/array-quals-1.c1
-rw-r--r--gcc/testsuite/gcc.dg/attr-assume_aligned-4.c4
-rw-r--r--gcc/testsuite/gcc.dg/attr-flatten-1.c15
-rw-r--r--gcc/testsuite/gcc.dg/cpp/line11.c6
-rw-r--r--gcc/testsuite/gcc.dg/cpp/line12.c6
-rw-r--r--gcc/testsuite/gcc.dg/debug/dwarf2/stacked-qualified-types-3.c3
-rw-r--r--gcc/testsuite/gcc.dg/fold-modpow2-2.c47
-rw-r--r--gcc/testsuite/gcc.dg/graphite/pr99085.c20
-rw-r--r--gcc/testsuite/gcc.dg/loop-9.c1
-rw-r--r--gcc/testsuite/gcc.dg/pr97172-2.c9
-rw-r--r--gcc/testsuite/gcc.dg/pr97172.c31
-rw-r--r--gcc/testsuite/gcc.dg/pr97954.c2
-rw-r--r--gcc/testsuite/gcc.dg/pr99104.c15
-rw-r--r--gcc/testsuite/gcc.dg/pr99122-1.c13
-rw-r--r--gcc/testsuite/gcc.dg/pr99122-2.c21
-rw-r--r--gcc/testsuite/gcc.dg/pr99122-3.c19
-rw-r--r--gcc/testsuite/gcc.dg/pr99136.c9
-rw-r--r--gcc/testsuite/gcc.dg/pr99224.c6
-rw-r--r--gcc/testsuite/gcc.dg/pr99323-1.c17
-rw-r--r--gcc/testsuite/gcc.dg/pr99323-2.c11
-rw-r--r--gcc/testsuite/gcc.dg/rtl/aarch64/multi-subreg-1.c1
-rw-r--r--gcc/testsuite/gcc.dg/stack-usage-1.c2
-rw-r--r--gcc/testsuite/gcc.dg/tree-prof/indir-call-prof-malloc.c2
-rw-r--r--gcc/testsuite/gcc.dg/tree-prof/pr97461.c2
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/pr99142.c14
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/strncpy-2.c4
-rw-r--r--gcc/testsuite/gcc.dg/vect/bb-slp-46.c4
-rw-r--r--gcc/testsuite/gcc.dg/vect/pr97428.c4
-rw-r--r--gcc/testsuite/gcc.dg/vect/pr99102.c20
-rw-r--r--gcc/testsuite/gcc.dg/vect/pr99253.c22
-rw-r--r--gcc/testsuite/gcc.dg/vect/slp-21.c4
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-complex-5.c2
56 files changed, 1174 insertions, 47 deletions
diff --git a/gcc/testsuite/gcc.dg/Warray-bounds-69.c b/gcc/testsuite/gcc.dg/Warray-bounds-69.c
new file mode 100644
index 0000000..5a95577
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/Warray-bounds-69.c
@@ -0,0 +1,74 @@
+/* Verify that storing a bigger vector into smaller space is diagnosed.
+ { dg-do compile }
+ { dg-options "-O2 -Warray-bounds" } */
+
+typedef __INT16_TYPE__ int16_t;
+typedef __attribute__ ((__vector_size__ (32))) char C32;
+
+typedef __attribute__ ((__vector_size__ (64))) int16_t I16_64;
+
+void sink (void*);
+
+
+void nowarn_c32 (char c)
+{
+ extern char nowarn_a32[32];
+
+ void *p = nowarn_a32;
+ *(C32*)p = (C32){ c };
+ sink (p);
+
+ char a32[32];
+ p = a32;
+ *(C32*)p = (C32){ c };
+ sink (p);
+}
+
+/* The invalid stores below are diagnosed by -Warray-bounds only
+ because it doesn't use compute_objsize(). If/when that changes
+ the function might need adjusting to avoid the hack put in place
+ to avoid false positives due to vectorization. */
+
+void warn_c32 (char c)
+{
+ extern char warn_a32[32]; // { dg-message "'warn_a32'" "note" }
+
+ void *p = warn_a32 + 1;
+ *(C32*)p = (C32){ c }; // { dg-warning "\\\[-Warray-bounds" }
+
+ /* Verify a local variable too. */
+ char a32[32]; // { dg-message "'a32'" }
+ p = a32 + 1;
+ *(C32*)p = (C32){ c }; // { dg-warning "\\\[-Warray-bounds" }
+ sink (p);
+}
+
+
+void nowarn_i16_64 (int16_t i)
+{
+ extern char nowarn_a64[64];
+
+ void *p = nowarn_a64;
+ I16_64 *q = (I16_64*)p;
+ *q = (I16_64){ i };
+
+ char a64[64];
+ q = (I16_64*)a64;
+ *q = (I16_64){ i };
+ sink (q);
+}
+
+void warn_i16_64 (int16_t i)
+{
+ extern char warn_a64[64]; // { dg-message "'warn_a64'" }
+
+ void *p = warn_a64 + 1;
+ I16_64 *q = (I16_64*)p;
+ *q = (I16_64){ i }; // { dg-warning "\\\[-Warray-bounds" }
+
+ char a64[64]; // { dg-message "'a64'" }
+ p = a64 + 1;
+ q = (I16_64*)p;
+ *q = (I16_64){ i }; // { dg-warning "\\\[-Warray-bounds" }
+ sink (p);
+}
diff --git a/gcc/testsuite/gcc.dg/Wstringop-overflow-10.c b/gcc/testsuite/gcc.dg/Wstringop-overflow-10.c
index 2e22130..bace08a 100644
--- a/gcc/testsuite/gcc.dg/Wstringop-overflow-10.c
+++ b/gcc/testsuite/gcc.dg/Wstringop-overflow-10.c
@@ -1,5 +1,7 @@
-/* { dg-do compile } */
-/* { dg-options "-O2 -Wstringop-overflow" } */
+/* PR tree-optimization/89500 - ICE: tree check: expected integer_cst,
+ have ssa_name in get_len
+ { dg-do compile }
+ { dg-options "-O2 -Wstringop-overflow -Wstringop-truncation" } */
void
foo (char *a)
diff --git a/gcc/testsuite/gcc.dg/Wstringop-overflow-47.c b/gcc/testsuite/gcc.dg/Wstringop-overflow-47.c
index cb2c329..9bfc84a 100644
--- a/gcc/testsuite/gcc.dg/Wstringop-overflow-47.c
+++ b/gcc/testsuite/gcc.dg/Wstringop-overflow-47.c
@@ -24,17 +24,22 @@ void nowarn_c32 (char c)
sink (p);
}
+/* The tests below fail as a result of the hack for PR 96963. However,
+ with -Wall, the invalid stores are diagnosed by -Warray-bounds which
+ runs before vectorization and so doesn't need the hack. If/when
+ -Warray changes to use compute_objsize() this will need adjusting. */
+
void warn_c32 (char c)
{
- extern char warn_a32[32]; // { dg-message "at offset 32 into destination object 'warn_a32' of size 32" "note" }
+ extern char warn_a32[32]; // { dg-message "at offset 32 into destination object 'warn_a32' of size 32" "pr97027" { xfail *-*-* } }
void *p = warn_a32 + 1;
- *(C32*)p = (C32){ c }; // { dg-warning "writing 1 byte into a region of size 0" }
+ *(C32*)p = (C32){ c }; // { dg-warning "writing 1 byte into a region of size 0" "pr97027" { xfail *-*-* } }
/* Verify a local variable too. */
char a32[32];
p = a32 + 1;
- *(C32*)p = (C32){ c }; // { dg-warning "writing 1 byte into a region of size 0" }
+ *(C32*)p = (C32){ c }; // { dg-warning "writing 1 byte into a region of size 0" "pr97027" { xfail *-*-* } }
sink (p);
}
diff --git a/gcc/testsuite/gcc.dg/Wstringop-overflow-65.c b/gcc/testsuite/gcc.dg/Wstringop-overflow-65.c
new file mode 100644
index 0000000..9f82d73
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/Wstringop-overflow-65.c
@@ -0,0 +1,98 @@
+/* PR middle-end/96963 - -Wstringop-overflow false positive with
+ -ftree-vectorize when assigning consecutive char struct members
+ { dg-do compile }
+ { dg-options "-O2 -Wall -ftree-vectorize" } */
+
+void sink (void*);
+
+struct Char
+{
+ int i;
+ char c, d, e, f;
+ char a[2], b[2];
+};
+
+void nowarn_char_assign (struct Char *p)
+{
+ sink (&p->c);
+
+ /* Verify the bogus warning triggered by the tree-ssa-strlen.c pass
+ is not issued. */
+ p->c = 1; // { dg-bogus "\\\[-Wstringop-overflow" }
+ p->d = 2;
+ p->e = 3;
+ p->f = 4;
+}
+
+void nowarn_char_array_assign (struct Char *p)
+{
+ sink (p->a);
+
+ p->a[0] = 1; // { dg-bogus "\\\[-Wstringop-overflow" }
+ p->a[1] = 2;
+ p->b[0] = 3;
+ p->b[1] = 4;
+}
+
+void warn_char_array_assign_interior (struct Char *p)
+{
+ sink (p->a);
+
+ p->a[0] = 1;
+ p->a[1] = 2;
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Warray-bounds"
+ /* Warnings are only suppressed for trailing arrays. Verify
+ one is issued for an interior array. */
+ p->a[2] = 5; // { dg-warning "\\\[-Wstringop-overflow" }
+#pragma GCC diagnostic pop
+}
+
+void warn_char_array_assign_trailing (struct Char *p)
+{
+ /* This is separated from warn_char_array_assign_interior because
+ otherwise GCC removes the store to p->a[2] as dead since it's
+ overwritten by p->b[0]. */
+ sink (p->b);
+
+ p->b[0] = 3;
+ p->b[1] = 4;
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Warray-bounds"
+ /* Warnings are only suppressed for trailing arrays with at most
+ one element. Verify one is issued for a two-element array. */
+ p->b[2] = 5; // { dg-warning "\\\[-Wstringop-overflow" }
+#pragma GCC diagnostic pop
+}
+
+
+/* Also verify there's no warning for other types than char (even though
+ the problem was limited to chars and -Wstringop-overflow should only
+ trigger for character accesses). */
+
+struct Short
+{
+ int i;
+ short c, d, e, f;
+ short a[2], b[2];
+};
+
+void nowarn_short_assign (struct Short *p)
+{
+ sink (&p->c);
+
+ p->c = 1;
+ p->d = 2;
+ p->e = 3;
+ p->f = 4;
+}
+
+void nowarn_short_array_assign (struct Short *p)
+{
+ sink (p->a);
+
+ p->a[0] = 1;
+ p->a[1] = 2;
+ p->b[0] = 3;
+ p->b[1] = 4;
+}
diff --git a/gcc/testsuite/gcc.dg/Wstringop-overflow-66.c b/gcc/testsuite/gcc.dg/Wstringop-overflow-66.c
new file mode 100644
index 0000000..0ecf511
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/Wstringop-overflow-66.c
@@ -0,0 +1,180 @@
+/* PR middle-end/97631 - bogus "writing one too many bytes" warning for
+ memcpy with strlen argument
+ { dg-do compile }
+ { dg-options "-O2 -Wall" } */
+
+#define NOIPA __attribute__ ((noipa))
+
+typedef __SIZE_TYPE__ size_t;
+
+extern void* malloc (size_t);
+extern void* memcpy (void*, const void*, size_t);
+extern void* memmove (void*, const void*, size_t);
+extern void* memset (void*, int, size_t);
+extern char* strcpy (char*, const char*);
+extern char* strncpy (char*, const char*, size_t);
+extern size_t strlen (const char*);
+
+
+NOIPA char* nowarn_strcpy (char *s)
+{
+ size_t n = strlen (s);
+ char *d = malloc (n + 1);
+ strcpy (d, s);
+ return d;
+}
+
+
+NOIPA char* warn_strcpy (char *s)
+{
+ size_t n = strlen (s);
+ char *d = malloc (n);
+ strcpy (d, s); // { dg-warning "\\\[-Wstringop-overflow" }
+ return d;
+}
+
+NOIPA char* warn_strcpy_nz (char *s)
+{
+ size_t n = strlen (s);
+ if (n == 0)
+ return 0;
+
+ char *d = malloc (n);
+ strcpy (d, s); // { dg-warning "\\\[-Wstringop-overflow" }
+ return d;
+}
+
+NOIPA char* warn_strcpy_nn (char *s)
+{
+ size_t n = strlen (s);
+ char *d = malloc (n);
+ if (!d)
+ return 0;
+
+ strcpy (d, s); // { dg-warning "\\\[-Wstringop-overflow" }
+ return d;
+}
+
+NOIPA char* warn_strcpy_nz_nn (char *s)
+{
+ size_t n = strlen (s);
+ if (n == 0)
+ return 0;
+
+ char *d = malloc (n);
+ if (!d)
+ return 0;
+
+ strcpy (d, s); // { dg-warning "\\\[-Wstringop-overflow" }
+ return d;
+}
+
+
+NOIPA char* nowarn_strncpy_1 (char *s)
+{
+ /* There's no overflow or truncation below so verify there is no
+ warning either. */
+ size_t n = strlen (s) + 1;
+ char *d = malloc (n);
+ strncpy (d, s, n);
+ return d;
+}
+
+
+NOIPA char* warn_strncpy (char *s)
+{
+ size_t n = strlen (s);
+ char *d = malloc (n);
+ strncpy (d, s, n); // { dg-warning "\\\[-Wstringop-truncation" }
+ return d;
+}
+
+NOIPA char* warn_strncpy_p1 (char *s)
+{
+ size_t n = strlen (s);
+ char *d = malloc (n + 1);
+ strncpy (d, s, n); // { dg-warning "\\\[-Wstringop-truncation" }
+ return d;
+}
+
+NOIPA char* warn_strncpy_nz (char *s)
+{
+ size_t n = strlen (s);
+ if (n == 0)
+ return 0;
+
+ char *d = malloc (n);
+ strncpy (d, s, n); // { dg-warning "\\\[-Wstringop-truncation" }
+ return d;
+
+}
+
+
+NOIPA char* nowarn_memcpy (char *s)
+{
+ size_t n = strlen (s);
+ char *d = malloc (n);
+ memcpy (d, s, n); // { dg-bogus "\\\[-Wstringop-overflow" }
+ return d;
+}
+
+NOIPA char* nowarn_memcpy_nz (char *s)
+{
+ size_t n = strlen (s);
+ if (n == 0)
+ return 0;
+
+ char *d = malloc (n);
+ memcpy (d, s, n); // { dg-bogus "\\\[-Wstringop-overflow" }
+ return d;
+}
+
+NOIPA char* nowarn_memcpy_nn (char *s)
+{
+ size_t n = strlen (s);
+ char *d = malloc (n);
+ if (!d)
+ return 0;
+
+ memcpy (d, s, n); // { dg-bogus "\\\[-Wstringop-overflow" }
+ return d;
+}
+
+NOIPA char* nowarn_memcpy_nn_nz (char *s)
+{
+ size_t n = strlen (s);
+ if (n == 0)
+ return 0;
+
+ char *d = malloc (n);
+ if (!d)
+ return 0;
+
+ memcpy (d, s, n); // { dg-bogus "\\\[-Wstringop-overflow" }
+ return d;
+
+}
+
+
+NOIPA char* nowarn_memmove (char *s)
+{
+ size_t n = strlen (s);
+ if (n == 0)
+ return 0;
+
+ char *d = malloc (n);
+ memmove (d, s, n); // { dg-bogus "\\\[-Wstringop-overflow" }
+ return d;
+}
+
+
+NOIPA char* nowarn_memset (char *s, int c)
+{
+ size_t n = strlen (s);
+ if (n == 0)
+ return 0;
+
+ char *d = malloc (n);
+ memset (d, c, n); // { dg-bogus "\\\[-Wstringop-overflow" }
+ return d;
+}
diff --git a/gcc/testsuite/gcc.dg/analyzer/dot-output.c b/gcc/testsuite/gcc.dg/analyzer/dot-output.c
index ff418b1..03405cd 100644
--- a/gcc/testsuite/gcc.dg/analyzer/dot-output.c
+++ b/gcc/testsuite/gcc.dg/analyzer/dot-output.c
@@ -2,7 +2,7 @@
by .dot. */
/* { dg-require-dot "" } */
-/* { dg-additional-options "-fdump-analyzer-callgraph -fdump-analyzer-exploded-graph -fdump-analyzer-state-purge -fdump-analyzer-supergraph" } */
+/* { dg-additional-options "-fdump-analyzer-callgraph -fdump-analyzer-exploded-graph -fdump-analyzer-state-purge -fdump-analyzer-supergraph -fdump-analyzer-feasibility" } */
#include <stdlib.h>
diff --git a/gcc/testsuite/gcc.dg/analyzer/error-1.c b/gcc/testsuite/gcc.dg/analyzer/error-1.c
new file mode 100644
index 0000000..f82a4cd
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/analyzer/error-1.c
@@ -0,0 +1,66 @@
+#include "analyzer-decls.h"
+
+extern int errno;
+
+extern void error (int __status, int __errnum, const char *__format, ...)
+ __attribute__ ((__format__ (__printf__, 3, 4)));
+
+extern void error_at_line (int __status, int __errnum, const char *__fname,
+ unsigned int __lineno, const char *__format, ...)
+ __attribute__ ((__format__ (__printf__, 5, 6)));
+
+/* When status is an unknown param. */
+
+void test_1 (int st)
+{
+ error (st, errno, "test");
+ __analyzer_eval (st == 0); /* { dg-warning "TRUE" } */
+}
+
+/* When status is known zero. */
+
+void test_2 (int st)
+{
+ error (0, errno, "test");
+ __analyzer_dump_path (); /* { dg-message "here" } */
+}
+
+/* When status is a non-zero known constant. */
+
+void test_3 (int st)
+{
+ error (1, errno, "test");
+ __analyzer_dump_path (); /* { dg-bogus "here" } */
+}
+
+/* When status has been tested against zero. */
+
+void test_4 (int st)
+{
+ if (st)
+ {
+ error (st, errno, "nonzero branch");
+ __analyzer_dump_path (); /* { dg-bogus "here" } */
+ }
+ else
+ {
+ error (st, errno, "zero branch");
+ __analyzer_dump_path (); /* { dg-message "here" } */
+ }
+}
+
+/* Similarly for error_at_line. */
+
+void test_5 (int st)
+{
+ error_at_line (st, errno, __FILE__, __LINE__, "test");
+ __analyzer_eval (st == 0); /* { dg-warning "TRUE" } */
+}
+
+/* Non-trivial format string. */
+
+void test_6 (int st, const char *str)
+{
+ error (st, errno, "test: %s", str);
+ __analyzer_eval (st == 0); /* { dg-warning "TRUE" } */
+}
diff --git a/gcc/testsuite/gcc.dg/analyzer/error-2.c b/gcc/testsuite/gcc.dg/analyzer/error-2.c
new file mode 100644
index 0000000..138ab9d
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/analyzer/error-2.c
@@ -0,0 +1,48 @@
+#define NULL ((void*)0)
+typedef __SIZE_TYPE__ size_t;
+
+extern int errno;
+
+extern void free (void *);
+char *strdup (const char *)
+ __attribute__((malloc (free)));
+
+extern size_t strlen (const char *__s)
+ __attribute__ ((__nothrow__ , __leaf__))
+ __attribute__ ((__pure__))
+ __attribute__ ((__nonnull__ (1)));
+
+extern void error (int __status, int __errnum, const char *__format, ...)
+ __attribute__ ((__format__ (__printf__, 3, 4)));
+
+extern void error_at_line (int __status, int __errnum, const char *__fname,
+ unsigned int __lineno, const char *__format, ...)
+ __attribute__ ((__format__ (__printf__, 5, 6)));
+
+/* PR analyzer/99196; extract taken from
+ https://github.com/libguestfs/libguestfs/blob/f19fd566f6387ce7e4d82409528c9dde374d25e0/daemon/tar.c#L108
+ (which is GPLv2 or later). */
+
+extern char *read_whole_file (const char *error_file, size_t *out);
+
+#define EXIT_FAILURE 1
+
+char *read_error_file (const char *error_file)
+{
+ size_t len;
+ char *str;
+
+ str = read_whole_file (error_file, &len);
+ if (str == NULL) {
+ str = strdup ("(no error)");
+ if (str == NULL)
+ error (EXIT_FAILURE, errno, "strdup");
+ len = strlen (str); /* { dg-bogus "NULL" } */
+ }
+
+ /* Remove trailing \n character if any. */
+ if (len > 0 && str[len-1] == '\n')
+ str[--len] = '\0';
+
+ return str; /* caller frees */
+}
diff --git a/gcc/testsuite/gcc.dg/analyzer/error-3.c b/gcc/testsuite/gcc.dg/analyzer/error-3.c
new file mode 100644
index 0000000..b6ab6c8
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/analyzer/error-3.c
@@ -0,0 +1,11 @@
+/* Verify that we gracefully handle error functions that don't match
+ the signature of GNU's <error.h>. */
+
+extern void error (void);
+extern void error_at_line (void);
+
+void test_1 (void)
+{
+ error ();
+ error_at_line ();
+}
diff --git a/gcc/testsuite/gcc.dg/analyzer/feasibility-1.c b/gcc/testsuite/gcc.dg/analyzer/feasibility-1.c
index c968444..83ec1ca 100644
--- a/gcc/testsuite/gcc.dg/analyzer/feasibility-1.c
+++ b/gcc/testsuite/gcc.dg/analyzer/feasibility-1.c
@@ -55,8 +55,7 @@ int test_6 (int a, int b)
{
if (!problem)
problem = 2;
- __analyzer_dump_path (); /* { dg-message "path" "" { xfail *-*-* } } */
- /* XFAIL is PR analyzer/96374. */
+ __analyzer_dump_path (); /* { dg-message "path" } */
}
return problem;
}
@@ -86,3 +85,16 @@ int test_6a (int a, int b, void *ptr)
}
return problem;
}
+
+/* After state-merging, the shortest path skips the loop,
+ but the shortest feasible path enters it. */
+
+void test_7 (int n)
+{
+ int entered_loop = 0;
+ int i;
+ for (i = 0; i < n; i++)
+ entered_loop = 1;
+ if (entered_loop)
+ __analyzer_dump_path (); /* { dg-message "path" } */
+}
diff --git a/gcc/testsuite/gcc.dg/analyzer/pr93355-localealias-feasibility-2.c b/gcc/testsuite/gcc.dg/analyzer/pr93355-localealias-feasibility-2.c
index 1afc6df..1484297 100644
--- a/gcc/testsuite/gcc.dg/analyzer/pr93355-localealias-feasibility-2.c
+++ b/gcc/testsuite/gcc.dg/analyzer/pr93355-localealias-feasibility-2.c
@@ -25,7 +25,5 @@ _nl_expand_alias (void)
++locale_alias_path;
if (start < locale_alias_path)
- __analyzer_dump_path (); /* { dg-message "path" "" { xfail *-*-* } } */
- /* XFAIL: PR analyzer/96374
- Use -fno-analyzer-feasibility to see the path. */
+ __analyzer_dump_path (); /* { dg-message "path" } */
}
diff --git a/gcc/testsuite/gcc.dg/analyzer/pr93355-localealias-feasibility-3.c b/gcc/testsuite/gcc.dg/analyzer/pr93355-localealias-feasibility-3.c
index a864831..50d3388 100644
--- a/gcc/testsuite/gcc.dg/analyzer/pr93355-localealias-feasibility-3.c
+++ b/gcc/testsuite/gcc.dg/analyzer/pr93355-localealias-feasibility-3.c
@@ -41,9 +41,7 @@ read_alias_file (const char *fname, char *cp)
{
FILE *fp;
- fp = fopen (fname, "r"); /* { dg-message "opened here" "" { xfail *-*-* } } */
- /* XFAIL: PR analyzer/96374
- Use -fno-analyzer-feasibility to see the path. */
+ fp = fopen (fname, "r"); /* { dg-message "opened here" } */
if (fp == NULL)
return 0;
@@ -54,9 +52,7 @@ read_alias_file (const char *fname, char *cp)
++cp;
if (cp[0] != '\0')
- return 42; /* { dg-warning "leak of FILE 'fp'" "" { xfail *-*-* } } */
- /* XFAIL: PR analyzer/96374
- Use -fno-analyzer-feasibility to see the path. */
+ return 42; /* { dg-warning "leak of FILE 'fp'" } */
fclose(fp);
diff --git a/gcc/testsuite/gcc.dg/analyzer/pr93355-localealias-feasibility.c b/gcc/testsuite/gcc.dg/analyzer/pr93355-localealias-feasibility.c
index 0d470d6..1a34d05 100644
--- a/gcc/testsuite/gcc.dg/analyzer/pr93355-localealias-feasibility.c
+++ b/gcc/testsuite/gcc.dg/analyzer/pr93355-localealias-feasibility.c
@@ -3,8 +3,6 @@
Adapted from intl/localealias.c, with all #includes removed. */
/* { dg-do "compile" } */
-/* { dg-additional-options "-fno-analyzer-feasibility" } */
-/* TODO: remove the need for this option. */
/* Handle aliases for locale names.
Copyright (C) 1995-1999, 2000-2001, 2003 Free Software Foundation, Inc.
diff --git a/gcc/testsuite/gcc.dg/analyzer/pr93355-localealias.c b/gcc/testsuite/gcc.dg/analyzer/pr93355-localealias.c
index 043e45f..88d0fc1 100644
--- a/gcc/testsuite/gcc.dg/analyzer/pr93355-localealias.c
+++ b/gcc/testsuite/gcc.dg/analyzer/pr93355-localealias.c
@@ -3,8 +3,8 @@
Adapted from intl/localealias.c, with all #includes removed. */
/* { dg-do "compile" } */
-/* { dg-additional-options "-Wno-analyzer-too-complex -fno-analyzer-feasibility" } */
-/* TODO: remove the need for these options. */
+/* { dg-additional-options "-Wno-analyzer-too-complex" } */
+/* TODO: remove the need for this option. */
/* { dg-require-effective-target alloca } */
/* Handle aliases for locale names.
diff --git a/gcc/testsuite/gcc.dg/analyzer/pr94047.c b/gcc/testsuite/gcc.dg/analyzer/pr94047.c
index d989a25..5107ec0 100644
--- a/gcc/testsuite/gcc.dg/analyzer/pr94047.c
+++ b/gcc/testsuite/gcc.dg/analyzer/pr94047.c
@@ -1,7 +1,3 @@
-/* { dg-additional-options "-Wno-analyzer-too-complex" } */
-/* TODO: the above ought not to be necessary, but currently is due to a
- state explosion within the for loop. */
-
typedef struct list
{
struct list *next;
diff --git a/gcc/testsuite/gcc.dg/analyzer/pr94596.c b/gcc/testsuite/gcc.dg/analyzer/pr94596.c
new file mode 100644
index 0000000..055d209
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/analyzer/pr94596.c
@@ -0,0 +1,97 @@
+/* Minimized/hacked up from openvswitch lib/conntrack.c, which had this license
+ header: */
+/*
+ * Copyright (c) 2015-2019 Nicira, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at:
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+typedef __SIZE_TYPE__ size_t;
+#define NULL ((void *)0)
+#define false 0
+
+#define OBJECT_OFFSETOF(OBJECT, MEMBER)\
+ __builtin_offsetof(typeof(*(OBJECT)), MEMBER)
+
+#define OBJECT_CONTAINING(POINTER, OBJECT, MEMBER) \
+ ((typeof(OBJECT)) (void *) \
+ ((char *) (POINTER) - OBJECT_OFFSETOF(OBJECT, MEMBER)))
+
+#define ASSIGN_CONTAINER(OBJECT, POINTER, MEMBER) \
+ ((OBJECT) = OBJECT_CONTAINING(POINTER, OBJECT, MEMBER), (void) 0)
+
+#define INIT_CONTAINER(OBJECT, POINTER, MEMBER) \
+ ((OBJECT) = NULL, ASSIGN_CONTAINER(OBJECT, POINTER, MEMBER))
+
+#define HMAP_FOR_EACH_POP(NODE, MEMBER, HMAP) \
+ for (size_t bucket__ = 0; \
+ INIT_CONTAINER(NODE, hmap_pop_helper__(HMAP, &bucket__), MEMBER), \
+ (NODE != OBJECT_CONTAINING(NULL, NODE, MEMBER)) \
+ || ((NODE = NULL), false);)
+
+struct hmap {
+ struct hmap_node **buckets;
+ struct hmap_node *one;
+ size_t mask;
+ size_t n;
+};
+
+struct hmap_node {
+ size_t hash;
+ struct hmap_node *next;
+};
+
+static inline void hmap_remove(struct hmap *, struct hmap_node *);
+
+struct hmap_node *
+hmap_pop_helper__(struct hmap *hmap, size_t *bucket) {
+
+ for (; *bucket <= hmap->mask; (*bucket)++) {
+ struct hmap_node *node = hmap->buckets[*bucket];
+
+ if (node) {
+ hmap_remove(hmap, node);
+ return node;
+ }
+ }
+
+ return NULL;
+}
+
+static inline void
+hmap_remove(struct hmap *hmap, struct hmap_node *node)
+{
+ struct hmap_node **bucket = &hmap->buckets[node->hash & hmap->mask];
+ while (*bucket != node) {
+ bucket = &(*bucket)->next;
+ }
+ *bucket = node->next;
+ hmap->n--;
+}
+
+struct conntrack {
+ struct hmap zone_limits;
+};
+
+struct zone_limit {
+ struct hmap_node node;
+};
+
+void
+conntrack_destroy(struct conntrack *ct)
+{
+ struct zone_limit *zl;
+ HMAP_FOR_EACH_POP (zl, node, &ct->zone_limits) {
+ __builtin_free(zl);
+ }
+}
diff --git a/gcc/testsuite/gcc.dg/analyzer/pr96841.c b/gcc/testsuite/gcc.dg/analyzer/pr96841.c
index d9d35f3..8546661 100644
--- a/gcc/testsuite/gcc.dg/analyzer/pr96841.c
+++ b/gcc/testsuite/gcc.dg/analyzer/pr96841.c
@@ -1,4 +1,4 @@
-/* { dg-additional-options "-O1 -Wno-builtin-declaration-mismatch" } */
+/* { dg-additional-options "-Wno-analyzer-too-complex -O1 -Wno-builtin-declaration-mismatch" } */
int
l8 (void);
@@ -18,6 +18,6 @@ bv (__SIZE_TYPE__ ny)
{
*mf = 0;
(*mf)[ny] = (int *) malloc (sizeof (int));
- th ((*mf)[ny]); /* { dg-warning "leak" } */
+ th ((*mf)[ny]);
}
}
diff --git a/gcc/testsuite/gcc.dg/analyzer/pr98969.c b/gcc/testsuite/gcc.dg/analyzer/pr98969.c
index 8298f26..7e1587d 100644
--- a/gcc/testsuite/gcc.dg/analyzer/pr98969.c
+++ b/gcc/testsuite/gcc.dg/analyzer/pr98969.c
@@ -8,7 +8,7 @@ test_1 (long int i)
{
struct foo *f = (struct foo *)i;
f->expr = __builtin_malloc (1024);
-} /* { dg-bogus "leak" "PR analyzer/98969" { xfail *-*-* } } */
+} /* { dg-bogus "leak" } */
void
test_2 (long int i)
@@ -16,3 +16,10 @@ test_2 (long int i)
__builtin_free (((struct foo *)i)->expr);
__builtin_free (((struct foo *)i)->expr); /* { dg-warning "double-'free' of '\\*\\(\\(struct foo \\*\\)i\\)\\.expr'" } */
}
+
+void
+test_3 (void *p)
+{
+ void **q = (void **)p;
+ *q = __builtin_malloc (1024);
+}
diff --git a/gcc/testsuite/gcc.dg/analyzer/pr99193-1.c b/gcc/testsuite/gcc.dg/analyzer/pr99193-1.c
new file mode 100644
index 0000000..c6179e9
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/analyzer/pr99193-1.c
@@ -0,0 +1,65 @@
+/* Verify absence of false positive from -Wanalyzer-mismatching-deallocation
+ on realloc(3).
+ Based on https://github.com/libguestfs/libguestfs/blob/f19fd566f6387ce7e4d82409528c9dde374d25e0/daemon/command.c#L115
+ which is GPLv2 or later. */
+
+typedef __SIZE_TYPE__ size_t;
+typedef __builtin_va_list va_list;
+
+#define NULL ((void *)0)
+
+extern void *malloc (size_t __size)
+ __attribute__ ((__nothrow__ , __leaf__))
+ __attribute__ ((__malloc__))
+ __attribute__ ((__alloc_size__ (1)));
+extern void perror (const char *__s);
+extern void *realloc (void *__ptr, size_t __size)
+ __attribute__ ((__nothrow__ , __leaf__))
+ __attribute__ ((__warn_unused_result__))
+ __attribute__ ((__alloc_size__ (2)));
+
+extern void guestfs_int_cleanup_free (void *ptr);
+extern int commandrvf (char **stdoutput, char **stderror, unsigned flags,
+ char const* const *argv);
+#define CLEANUP_FREE __attribute__((cleanup(guestfs_int_cleanup_free)))
+
+int
+commandrf (char **stdoutput, char **stderror, unsigned flags,
+ const char *name, ...)
+{
+ va_list args;
+ CLEANUP_FREE const char **argv = NULL;
+ char *s;
+ int i, r;
+
+ /* Collect the command line arguments into an array. */
+ i = 2;
+ argv = malloc (sizeof (char *) * i);
+
+ if (argv == NULL) {
+ perror ("malloc");
+ return -1;
+ }
+ argv[0] = (char *) name;
+ argv[1] = NULL;
+
+ __builtin_va_start (args, name);
+
+ while ((s = __builtin_va_arg (args, char *)) != NULL) {
+ const char **p = realloc (argv, sizeof (char *) * (++i)); /* { dg-bogus "'free'" } */
+ if (p == NULL) {
+ perror ("realloc");
+ __builtin_va_end (args);
+ return -1;
+ }
+ argv = p;
+ argv[i-2] = s;
+ argv[i-1] = NULL;
+ }
+
+ __builtin_va_end (args);
+
+ r = commandrvf (stdoutput, stderror, flags, argv);
+
+ return r;
+}
diff --git a/gcc/testsuite/gcc.dg/analyzer/pr99193-2.c b/gcc/testsuite/gcc.dg/analyzer/pr99193-2.c
new file mode 100644
index 0000000..40e6181
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/analyzer/pr99193-2.c
@@ -0,0 +1,68 @@
+/* Verify absence of false positive from -Wanalyzer-mismatching-deallocation
+ on realloc(3).
+ Based on https://github.com/libguestfs/libguestfs/blob/f19fd566f6387ce7e4d82409528c9dde374d25e0/df/main.c#L404
+ which is GPLv2 or later. */
+
+typedef __SIZE_TYPE__ size_t;
+typedef __builtin_va_list va_list;
+
+#define NULL ((void *)0)
+
+extern void free (void *);
+extern void *realloc (void *__ptr, size_t __size)
+ __attribute__ ((__nothrow__ , __leaf__))
+ __attribute__ ((__warn_unused_result__))
+ __attribute__ ((__alloc_size__ (2)));
+char *strdup (const char *)
+ __attribute__((malloc (free)));
+
+extern void error (int __status, int __errnum, const char *__format, ...)
+ __attribute__ ((__format__ (__printf__, 3, 4)));
+
+extern int errno;
+
+struct drv
+{
+ struct drv *next;
+};
+
+#define EXIT_FAILURE 1
+
+static char *
+single_drive_display_name (struct drv *)
+{
+ char *result = strdup ("placeholder");
+ if (!result)
+ __builtin_abort ();
+ return result;
+}
+
+char *
+make_display_name (struct drv *drvs)
+{
+ char *ret;
+
+ if (drvs->next == NULL)
+ ret = single_drive_display_name (drvs);
+ else {
+ size_t pluses = 0;
+ size_t i, len;
+
+ while (drvs->next != NULL) {
+ drvs = drvs->next;
+ pluses++;
+ }
+
+ ret = single_drive_display_name (drvs);
+ len = __builtin_strlen (ret);
+
+ ret = realloc (ret, len + pluses + 1); /* { dg-bogus "'free'" } */
+ if (ret == NULL)
+ error (EXIT_FAILURE, errno, "realloc");
+ for (i = len; i < len + pluses; ++i)
+ ret[i] = '+';
+ ret[i] = '\0';
+ }
+
+ return ret;
+}
diff --git a/gcc/testsuite/gcc.dg/analyzer/pr99193-3.c b/gcc/testsuite/gcc.dg/analyzer/pr99193-3.c
new file mode 100644
index 0000000..3e7ffd6
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/analyzer/pr99193-3.c
@@ -0,0 +1,48 @@
+/* Verify absence of false positive from -Wanalyzer-mismatching-deallocation
+ on realloc(3).
+ Based on https://github.com/libguestfs/libguestfs/blob/f19fd566f6387ce7e4d82409528c9dde374d25e0/daemon/debug.c#L115
+ which is GPLv2 or later. */
+
+typedef __SIZE_TYPE__ size_t;
+typedef __builtin_va_list va_list;
+
+#define NULL ((void *)0)
+
+extern void free (void *);
+extern void *realloc (void *__ptr, size_t __size)
+ __attribute__ ((__nothrow__ , __leaf__))
+ __attribute__ ((__warn_unused_result__))
+ __attribute__ ((__alloc_size__ (2)));
+extern char *strdup (const char *)
+ __attribute__((malloc (free)));
+extern char *strcat (char *__restrict __dest, const char *__restrict __src)
+ __attribute__ ((__nothrow__ , __leaf__))
+ __attribute__ ((__nonnull__ (1, 2)));
+
+static char *
+debug_help (const char **cmds, size_t argc, char *const *const argv)
+{
+ size_t len, i;
+ char *r, *p;
+
+ r = strdup ("Commands supported:");
+ if (!r) {
+ return NULL;
+ }
+
+ len = __builtin_strlen (r);
+ for (i = 0; cmds[i] != NULL; ++i) {
+ len += __builtin_strlen (cmds[i]) + 1;
+ p = realloc (r, len + 1); /* { dg-bogus "'free'" } */
+ if (p == NULL) {
+ free (r);
+ return NULL;
+ }
+ r = p;
+
+ strcat (r, " ");
+ strcat (r, cmds[i]);
+ }
+
+ return r;
+}
diff --git a/gcc/testsuite/gcc.dg/analyzer/realloc-1.c b/gcc/testsuite/gcc.dg/analyzer/realloc-1.c
new file mode 100644
index 0000000..a6c6bfc
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/analyzer/realloc-1.c
@@ -0,0 +1,55 @@
+typedef __SIZE_TYPE__ size_t;
+
+#define NULL ((void *)0)
+
+extern void *malloc (size_t __size)
+ __attribute__ ((__nothrow__ , __leaf__))
+ __attribute__ ((__malloc__))
+ __attribute__ ((__alloc_size__ (1)));
+extern void *realloc (void *__ptr, size_t __size)
+ __attribute__ ((__nothrow__ , __leaf__))
+ __attribute__ ((__warn_unused_result__))
+ __attribute__ ((__alloc_size__ (2)));
+extern void free (void *__ptr)
+ __attribute__ ((__nothrow__ , __leaf__));
+
+void *test_1 (void *ptr)
+{
+ return realloc (ptr, 1024);
+}
+
+void *test_2 (void *ptr)
+{
+ void *p = malloc (1024);
+ p = realloc (p, 4096);
+ /* TODO: should warn about the leak when the above call fails (PR analyzer/99260). */
+ free (p);
+}
+
+void *test_3 (void *ptr)
+{
+ void *p = malloc (1024);
+ void *q = realloc (p, 4096);
+ if (q)
+ free (q);
+ else
+ free (p);
+}
+
+void *test_4 (void)
+{
+ return realloc (NULL, 1024);
+}
+
+int *test_5 (int *p)
+{
+ *p = 42;
+ int *q = realloc (p, sizeof(int) * 4);
+ *q = 43; /* { dg-warning "possibly-NULL 'q'" "PR analyzer/99260" { xfail *-*-* } } */
+ return q;
+}
+
+void test_6 (size_t sz)
+{
+ void *p = realloc (NULL, sz);
+} /* { dg-warning "leak of 'p'" } */
diff --git a/gcc/testsuite/gcc.dg/analyzer/unknown-fns-4.c b/gcc/testsuite/gcc.dg/analyzer/unknown-fns-4.c
index 3d8f82e..bd1ab1e 100644
--- a/gcc/testsuite/gcc.dg/analyzer/unknown-fns-4.c
+++ b/gcc/testsuite/gcc.dg/analyzer/unknown-fns-4.c
@@ -10,6 +10,6 @@ void test (void)
got = 1;
else
if (got)
- __analyzer_dump_path (); /* { dg-message "path" "" { xfail *-*-* } } */
+ __analyzer_dump_path (); /* { dg-message "path" } */
}
}
diff --git a/gcc/testsuite/gcc.dg/analyzer/zlib-2.c b/gcc/testsuite/gcc.dg/analyzer/zlib-2.c
index d0b587c..62163a0 100644
--- a/gcc/testsuite/gcc.dg/analyzer/zlib-2.c
+++ b/gcc/testsuite/gcc.dg/analyzer/zlib-2.c
@@ -1,5 +1,3 @@
-/* { dg-additional-options "-Wno-analyzer-too-complex" } */
-
typedef void * (*alloc_func)(void * opaque, unsigned items, unsigned size);
typedef void (*free_func)(void * opaque, void * address);
diff --git a/gcc/testsuite/gcc.dg/array-quals-1.c b/gcc/testsuite/gcc.dg/array-quals-1.c
index 5d9170e..2c04164 100644
--- a/gcc/testsuite/gcc.dg/array-quals-1.c
+++ b/gcc/testsuite/gcc.dg/array-quals-1.c
@@ -4,6 +4,7 @@
/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
/* { dg-do compile } */
/* { dg-options "-Wno-discarded-array-qualifiers" } */
+/* { dg-additional-options "-fno-pie" { target pie } } */
/* The MMIX port always switches to the .data section at the end of a file. */
/* { dg-final { scan-assembler-not "\\.data(?!\\.rel\\.ro)" { xfail powerpc*-*-aix* mmix-*-* x86_64-*-mingw* } } } */
/* { dg-final { scan-assembler-symbol-section {^_?a$} {^\.(const|rodata|srodata)|\[RO\]} } } */
diff --git a/gcc/testsuite/gcc.dg/attr-assume_aligned-4.c b/gcc/testsuite/gcc.dg/attr-assume_aligned-4.c
index 2571ab8..f6eb6dc 100644
--- a/gcc/testsuite/gcc.dg/attr-assume_aligned-4.c
+++ b/gcc/testsuite/gcc.dg/attr-assume_aligned-4.c
@@ -8,7 +8,7 @@ A (1) void fv_1 (void); /* { dg-warning ".assume_aligned. attribute ignore
A (1) int fi_1 (void); /* { dg-warning ".assume_aligned. attribute ignored on a function returning .int." } */
-A (-1) void* fpv_m1 (void); /* { dg-warning ".assume_aligned. attribute argument -1 is not a power of 2" } */
+A (-1) void* fpv_m1 (void); /* { dg-warning ".assume_aligned. attribute argument -1 is not positive" } */
A (0) void* fpv_0 (void); /* { dg-warning ".assume_aligned. attribute argument 0 is not a power of 2" } */
@@ -23,7 +23,7 @@ A (16385) void* fpv_16kp1 (void); /* { dg-warning ".assume_aligned. attribute
A (32767) void* fpv_32km1 (void); /* { dg-warning ".assume_aligned. attribute argument 32767 is not a power of 2" } */
-A (4, -1) void* fpv_4_m1 (void); /* { dg-warning ".assume_aligned. attribute argument -1 is not in the range \\\[0, 3]" } */
+A (4, -1) void* fpv_4_m1 (void); /* { dg-warning ".assume_aligned. attribute argument -1 is not positive" } */
A (4, 0) void* fpv_4_0 (void);
A (4, 1) void* fpv_4_1 (void);
diff --git a/gcc/testsuite/gcc.dg/attr-flatten-1.c b/gcc/testsuite/gcc.dg/attr-flatten-1.c
index ecb08fc..68a194c 100644
--- a/gcc/testsuite/gcc.dg/attr-flatten-1.c
+++ b/gcc/testsuite/gcc.dg/attr-flatten-1.c
@@ -10,9 +10,20 @@ int fn1(int p1)
}
__attribute__((flatten))
__attribute__((alias("fn1")))
-int fn4(int p1); /* { dg-warning "ignored" } */
+int fn4(int p1);
+
+/* Again, but this time the target doesn't have the attribute. */
+int fn1a(int p1)
+{
+ int a = fn2(p1);
+ return fn3(a);
+}
+__attribute__((flatten))
+__attribute__((alias("fn1a")))
+int fn4a(int p1); /* { dg-warning "ignored" } */
+
int
test ()
{
- return fn4(1);
+ return fn4(1)+fn4a(1);
}
diff --git a/gcc/testsuite/gcc.dg/cpp/line11.c b/gcc/testsuite/gcc.dg/cpp/line11.c
new file mode 100644
index 0000000..67c6583
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/cpp/line11.c
@@ -0,0 +1,6 @@
+/* PR c/99325 */
+/* { dg-do preprocess } */
+/* { dg-options "-pedantic" } */
+
+#line 4294967295 /* { dg-warning "line number out of range" } */
+#pragma message "foo"
diff --git a/gcc/testsuite/gcc.dg/cpp/line12.c b/gcc/testsuite/gcc.dg/cpp/line12.c
new file mode 100644
index 0000000..c2e88f6
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/cpp/line12.c
@@ -0,0 +1,6 @@
+/* PR c/99325 */
+/* { dg-do preprocess } */
+/* { dg-options "-pedantic" } */
+
+#line 9223372036854775807 /* { dg-warning "line number out of range" } */
+#pragma message "foo"
diff --git a/gcc/testsuite/gcc.dg/debug/dwarf2/stacked-qualified-types-3.c b/gcc/testsuite/gcc.dg/debug/dwarf2/stacked-qualified-types-3.c
index efa3fa0..98ee116 100644
--- a/gcc/testsuite/gcc.dg/debug/dwarf2/stacked-qualified-types-3.c
+++ b/gcc/testsuite/gcc.dg/debug/dwarf2/stacked-qualified-types-3.c
@@ -31,4 +31,5 @@ char * _Atomic restrict h;
char * _Atomic i;
char * restrict j;
-/* { dg-final { scan-assembler-times "DIE \\(\[^\n\]*\\) DW_TAG_(?:const|volatile|atomic|restrict)_type" 8 } } */
+/* The xfail is due to PR66668. */
+/* { dg-final { scan-assembler-times "DIE \\(\[^\n\]*\\) DW_TAG_(?:const|volatile|atomic|restrict)_type" 8 { xfail cris-*-* } } } */
diff --git a/gcc/testsuite/gcc.dg/fold-modpow2-2.c b/gcc/testsuite/gcc.dg/fold-modpow2-2.c
new file mode 100644
index 0000000..803d527
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/fold-modpow2-2.c
@@ -0,0 +1,47 @@
+/* PR tree-optimization/99079 */
+/* { dg-do compile { target { lp64 || ilp32 } } } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+unsigned int
+foo1 (unsigned int a, unsigned int b)
+{
+ return a % (1 << b);
+}
+
+int
+foo2 (int b)
+{
+ return 371 % (1U << b);
+}
+
+long long
+foo3 (int b)
+{
+ return 371LL % (1U << b);
+}
+
+unsigned long long
+foo4 (unsigned long long a, int b)
+{
+ return a % (1U << b);
+}
+
+unsigned
+foo5 (unsigned a, int b)
+{
+ return a % (unsigned) (1ULL << b);
+}
+
+int
+foo6 (int b)
+{
+ return 371 % (int) (1ULL << b);
+}
+
+long long
+foo7 (int b)
+{
+ return 371LL % (1 << b);
+}
+
+/* { dg-final { scan-tree-dump-not " % " "optimized" } } */
diff --git a/gcc/testsuite/gcc.dg/graphite/pr99085.c b/gcc/testsuite/gcc.dg/graphite/pr99085.c
new file mode 100644
index 0000000..dc1c935
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/graphite/pr99085.c
@@ -0,0 +1,20 @@
+/* PR target/99085 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fgraphite-identity -fsel-sched-pipelining -fselective-scheduling2" } */
+
+void
+foo (int m, int n, int o, int i)
+{
+ long double a2[m];
+ int c2[n][o];
+ int j, k;
+
+ while (i < m)
+ a2[i++] = 13.132L;
+
+ for (j = 0; j < n; j++)
+ for (k = 0; k < o; k++)
+ c2[j][k] = 1;
+
+ __builtin_abort ();
+}
diff --git a/gcc/testsuite/gcc.dg/loop-9.c b/gcc/testsuite/gcc.dg/loop-9.c
index 12f790a..44f7206 100644
--- a/gcc/testsuite/gcc.dg/loop-9.c
+++ b/gcc/testsuite/gcc.dg/loop-9.c
@@ -1,5 +1,6 @@
/* { dg-do compile } */
/* { dg-options "-O1 -fdump-rtl-loop2_invariant" } */
+/* { dg-additional-options "-fno-pie" { target pie } } */
void
f (double *a)
diff --git a/gcc/testsuite/gcc.dg/pr97172-2.c b/gcc/testsuite/gcc.dg/pr97172-2.c
new file mode 100644
index 0000000..99cc6c2
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr97172-2.c
@@ -0,0 +1,9 @@
+/* PR middle-end/97172 - ICE: tree code ‘ssa_name’ is not supported in LTO
+ streams
+ { dg-do link }
+ { dg-options "-Wall -flto -fpic -shared" }
+ { dg-require-effective-target fpic }
+ { dg-require-effective-target shared }
+ { dg-require-effective-target lto } */
+
+#include "pr97172.c"
diff --git a/gcc/testsuite/gcc.dg/pr97172.c b/gcc/testsuite/gcc.dg/pr97172.c
index ab5b2e9..8ae6342 100644
--- a/gcc/testsuite/gcc.dg/pr97172.c
+++ b/gcc/testsuite/gcc.dg/pr97172.c
@@ -30,21 +30,52 @@ void fnp1_np1_np1 (int a[n + 1][n + 1][n + 1]);
void gn (int a[n]) { fn (a); }
void gnp1 (int a[n + 1]) { fnp1 (a); }
+void gnd2p1 (int a[n / 2 + 1]) { fnp1 (a); }
void gx_n (int a[][n]) { fx_n (a); }
void gx_np1 (int a[][n + 1]) { fx_np1 (a); }
+void gx_nd2p1 (int a[][n / 2 + 1]) { fx_np1 (a); }
void g2_n (int a[2][n]) { f2_n (a); }
void g2_np1 (int a[2][n + 1]) { f2_np1 (a); }
+void g2_nd2p1 (int a[2][n / 2 + 1]) { f2_np1 (a); }
void gn_3 (int a[n][3]) { fn_3 (a); }
void gnp1_3 (int a[n + 1][3]) { fnp1_3 (a); }
+void gnd2p1_3 (int a[n / 2 + 1][3]) { fnp1_3 (a); }
void gn_n (int a[n][n]) { fn_n (a); }
void gn_np1 (int a[n][n + 1]) { fn_np1 (a); }
void gnp1_np1 (int a[n + 1][n + 1]) { fnp1_np1 (a); }
+void gnd2p1_nd2p1 (int a[n / 2 + 1][n / 2 + 1]) { fnp1_np1 (a); }
void gn_n_n (int a[n][n][n]) { fn_n_n (a); }
void gn_n_np1 (int a[n][n][n + 1]) { fn_n_np1 (a); }
void gn_np1_np1 (int a[n][n + 1][n + 1]) { fn_np1_np1 (a); }
void gnp1_np1_np1 (int a[n + 1][n + 1][n + 1]) { fnp1_np1_np1 (a); }
+void gnd2p1_nd2p1_nd2p1 (int a[n / 2 + 1][n / 2 + 1][n / 2 + 1])
+{ fnp1_np1_np1 (a); }
+
+
+void fna3_1 (int n,
+ int a[n / 2 + 1],
+ int b[n / 2 + 1],
+ int c[n / 2 + 1]);
+
+void gna3_1 (int n,
+ int a[n / 2 + 1],
+ int b[n / 2 + 1],
+ int c[n / 2 + 1]) { fna3_1 (n, a, b, c); }
+
+void fna3_2_3_4 (int n,
+ int a[n / 2 + 1][n / 2 + 2],
+ int b[n / 2 + 1][n / 2 + 2][n / 2 + 3],
+ int c[n / 2 + 1][n / 2 + 2][n / 2 + 3][n / 2 + 4]);
+
+void gna3_2_3_4 (int n,
+ int a[n / 2 + 1][n / 2 + 2],
+ int b[n / 2 + 1][n / 2 + 2][n / 2 + 3],
+ int c[n / 2 + 1][n / 2 + 2][n / 2 + 3][n / 2 + 4])
+{
+ fna3_2_3_4 (n, a, b, c);
+}
diff --git a/gcc/testsuite/gcc.dg/pr97954.c b/gcc/testsuite/gcc.dg/pr97954.c
index 178e1d2..0be60f5 100644
--- a/gcc/testsuite/gcc.dg/pr97954.c
+++ b/gcc/testsuite/gcc.dg/pr97954.c
@@ -1,5 +1,5 @@
/* PR rtl-optimization/97954 */
-/* { dg-do compile } */
+/* { dg-do compile { target lra } } */
/* { dg-options "-O2" } */
int
diff --git a/gcc/testsuite/gcc.dg/pr99104.c b/gcc/testsuite/gcc.dg/pr99104.c
new file mode 100644
index 0000000..807e1da
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr99104.c
@@ -0,0 +1,15 @@
+/* PR target/99104 */
+/* { dg-do compile { target int128 } } */
+/* { dg-options "-O2 -fsel-sched-pipelining -fselective-scheduling2 -funroll-loops" } */
+
+__int128 a;
+int b;
+int foo (void);
+
+int __attribute__ ((simd))
+bar (void)
+{
+ a = ~a;
+ if (foo ())
+ b = 0;
+}
diff --git a/gcc/testsuite/gcc.dg/pr99122-1.c b/gcc/testsuite/gcc.dg/pr99122-1.c
new file mode 100644
index 0000000..5dfc0a8
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr99122-1.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -g -w" } */
+
+void f ()
+{
+ int n = 5;
+ struct { char a[n]; } x;
+ g (x, x);
+}
+int g (double x, double y)
+{
+ return __builtin_isgreater (x, y);
+}
diff --git a/gcc/testsuite/gcc.dg/pr99122-2.c b/gcc/testsuite/gcc.dg/pr99122-2.c
new file mode 100644
index 0000000..2b10542
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr99122-2.c
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -g -w" } */
+
+static int foo ();
+
+int
+bar (int n)
+{
+ struct S { char a[n]; } x;
+ __builtin_memset (x.a, 0, n);
+ return foo (n, x);
+}
+
+static inline int
+foo (int n, struct T { char a[n]; } b)
+{
+ int r = 0, i;
+ for (i = 0; i < n; i++)
+ r += b.a[i];
+ return r;
+}
diff --git a/gcc/testsuite/gcc.dg/pr99122-3.c b/gcc/testsuite/gcc.dg/pr99122-3.c
new file mode 100644
index 0000000..6aa5b29
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr99122-3.c
@@ -0,0 +1,19 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -g -fno-ipa-cp -w" } */
+
+static int foo ();
+
+int
+bar (int n)
+{
+ return foo (n, 2.0);
+}
+
+static inline int
+foo (int n, struct T { char a[n]; } b)
+{
+ int r = 0, i;
+ for (i = 0; i < n; i++)
+ r += b.a[i];
+ return r;
+}
diff --git a/gcc/testsuite/gcc.dg/pr99136.c b/gcc/testsuite/gcc.dg/pr99136.c
new file mode 100644
index 0000000..1bd8446
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr99136.c
@@ -0,0 +1,9 @@
+/* PR c/99136 */
+/* { dg-do compile } */
+/* { dg-options "-w -fexcess-precision=standard" } */
+
+void
+foo (double x)
+{
+ return 1.0 / x;
+}
diff --git a/gcc/testsuite/gcc.dg/pr99224.c b/gcc/testsuite/gcc.dg/pr99224.c
new file mode 100644
index 0000000..f6e9ac8
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr99224.c
@@ -0,0 +1,6 @@
+/* { dg-do compile } */
+
+void f (char *c, ...)
+{
+ __builtin_next_arg (*c); /* { dg-warning "not last named argument" } */
+}
diff --git a/gcc/testsuite/gcc.dg/pr99323-1.c b/gcc/testsuite/gcc.dg/pr99323-1.c
new file mode 100644
index 0000000..6fe1400
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr99323-1.c
@@ -0,0 +1,17 @@
+/* Verify that fix-it printing doesn't ICE when there are multiple
+ fix-it hints on a very long line after LINE_MAP_MAX_COLUMN_NUMBER. */
+
+/* { dg-options "-Wall -no-integrated-cpp -fdiagnostics-show-caret" } */
+/* { dg-allow-blank-lines-in-output 1 } */
+/* { dg-prune-output ".*" } */
+
+typedef struct {
+} REFERENCE;
+#define LIM2() LIM1()
+#define LIM3() LIM2() LIM2() LIM2() LIM2() LIM2() LIM2()
+#define LIM4() \
+ LIM3() LIM3() LIM3() LIM3() LIM3() LIM3() LIM3() LIM3() LIM3() LIM3()
+#define LIM5() \
+ LIM4() LIM4() LIM4() LIM4() LIM4() LIM4() LIM4() LIM4() LIM4() LIM4()
+#define LIM1() DEF(),
+REFERENCE references[] = {LIM5()};
diff --git a/gcc/testsuite/gcc.dg/pr99323-2.c b/gcc/testsuite/gcc.dg/pr99323-2.c
new file mode 100644
index 0000000..d4075b6
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr99323-2.c
@@ -0,0 +1,11 @@
+/* Verify that fix-it printing doesn't ICE when there are multiple
+ fix-it hints on a very long line after LINE_MAP_MAX_COLUMN_NUMBER. */
+
+/* { dg-options "-Wall -fdiagnostics-show-caret" } */
+/* { dg-allow-blank-lines-in-output 1 } */
+/* { dg-prune-output ".*" } */
+
+typedef struct {
+} REFERENCE;
+
+REFERENCE references[] = {DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(), DEF(),}
diff --git a/gcc/testsuite/gcc.dg/rtl/aarch64/multi-subreg-1.c b/gcc/testsuite/gcc.dg/rtl/aarch64/multi-subreg-1.c
index d7be559..af53de2 100644
--- a/gcc/testsuite/gcc.dg/rtl/aarch64/multi-subreg-1.c
+++ b/gcc/testsuite/gcc.dg/rtl/aarch64/multi-subreg-1.c
@@ -1,3 +1,4 @@
+/* { dg-do compile { target aarch64-*-* } } */
/* { dg-additional-options "-O -fdump-rtl-cse1-all" } */
__int128 __RTL (startwith ("vregs")) foo (void)
diff --git a/gcc/testsuite/gcc.dg/stack-usage-1.c b/gcc/testsuite/gcc.dg/stack-usage-1.c
index be1254a..93cfe7c 100644
--- a/gcc/testsuite/gcc.dg/stack-usage-1.c
+++ b/gcc/testsuite/gcc.dg/stack-usage-1.c
@@ -103,6 +103,8 @@
#define SIZE 252
#elif defined (__csky__)
# define SIZE 252
+#elif defined (__CRIS__)
+# define SIZE 252
#else
# define SIZE 256
#endif
diff --git a/gcc/testsuite/gcc.dg/tree-prof/indir-call-prof-malloc.c b/gcc/testsuite/gcc.dg/tree-prof/indir-call-prof-malloc.c
index 454e224..7bda4ae 100644
--- a/gcc/testsuite/gcc.dg/tree-prof/indir-call-prof-malloc.c
+++ b/gcc/testsuite/gcc.dg/tree-prof/indir-call-prof-malloc.c
@@ -1,4 +1,4 @@
-/* { dg-options "-O2 -ldl" } */
+/* { dg-options "-O2 -ldl -fprofile-correction" } */
#define _GNU_SOURCE
#include <stdio.h>
diff --git a/gcc/testsuite/gcc.dg/tree-prof/pr97461.c b/gcc/testsuite/gcc.dg/tree-prof/pr97461.c
index 213fac9..f684be4d 100644
--- a/gcc/testsuite/gcc.dg/tree-prof/pr97461.c
+++ b/gcc/testsuite/gcc.dg/tree-prof/pr97461.c
@@ -1,5 +1,5 @@
/* PR gcov-profile/97461 */
-/* { dg-options "-O2 -ldl" } */
+/* { dg-options "-O2 -ldl -fprofile-correction" } */
#define _GNU_SOURCE
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr99142.c b/gcc/testsuite/gcc.dg/tree-ssa/pr99142.c
new file mode 100644
index 0000000..1781a89
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr99142.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+/* { dg-final { scan-tree-dump-not " >= 0\\)" "optimized" } } */
+int f(int a, int *b, int *d)
+{
+ int c = __builtin_clz(a);
+
+ *b = c;
+
+ if (c != 0)
+ *d = c;
+
+ return c;
+}
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/strncpy-2.c b/gcc/testsuite/gcc.dg/tree-ssa/strncpy-2.c
index 2ef9cd6..e2216ab 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/strncpy-2.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/strncpy-2.c
@@ -1,6 +1,6 @@
/* PR tree-optimization/83075 - Invalid strncpy optimization */
/* { dg-do run } */
-/* { dg-options "-O2 -Wstringop-overflow" } */
+/* { dg-options "-O2 -Wstringop-truncation" } */
typedef __SIZE_TYPE__ size_t;
@@ -8,7 +8,7 @@ __attribute__((noipa)) size_t
foo (char *p, char *q, size_t *r)
{
size_t n0 = __builtin_strlen (p);
- __builtin_strncpy (q, p, n0); /* { dg-warning "specified bound depends on the length" } */
+ __builtin_strncpy (q, p, n0); /* { dg-warning "\\\[-Wstringop-truncation" } */
size_t n1 = __builtin_strlen (p);
*r = n0;
return n1;
diff --git a/gcc/testsuite/gcc.dg/vect/bb-slp-46.c b/gcc/testsuite/gcc.dg/vect/bb-slp-46.c
index 8daa5c1..98b2906 100644
--- a/gcc/testsuite/gcc.dg/vect/bb-slp-46.c
+++ b/gcc/testsuite/gcc.dg/vect/bb-slp-46.c
@@ -24,5 +24,5 @@ int foo ()
/* { dg-final { scan-tree-dump "optimized: basic block" "slp2" } } */
/* { dg-final { scan-tree-dump "extracting lane for live stmt" "slp2" } } */
/* { dg-final { scan-tree-dump-times "extracting lane for live stmt" 2 "slp2" { xfail *-*-* } } } */
-/* { dg-final { scan-tree-dump-times " \\+ " 3 "optimized" } } */
-/* { dg-final { scan-tree-dump-times " \\+ " 2 "optimized" { xfail *-*-* } } } */
+/* { dg-final { scan-tree-dump-not "tem3_\[0-9\]\+ = " "optimized" } } */
+/* { dg-final { scan-tree-dump-not "tem0_\[0-9\]\+ = " "optimized" { xfail *-*-* } } } */
diff --git a/gcc/testsuite/gcc.dg/vect/pr97428.c b/gcc/testsuite/gcc.dg/vect/pr97428.c
index 49d5373..bbd743a 100644
--- a/gcc/testsuite/gcc.dg/vect/pr97428.c
+++ b/gcc/testsuite/gcc.dg/vect/pr97428.c
@@ -40,5 +40,7 @@ void foo_i2(dcmlx4_t dst[], const dcmlx_t src[], int n)
load and store groups. */
/* { dg-final { scan-tree-dump "Detected interleaving load of size 8" "vect" } } */
/* { dg-final { scan-tree-dump "Detected interleaving store of size 16" "vect" } } */
-/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 2 "vect" } } */
+/* We're not able to peel & apply re-aligning to make accesses well-aligned for !vect_hw_misalign,
+ but we could by peeling the stores for alignment and applying re-aligning loads. */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 2 "vect" { xfail { ! vect_hw_misalign } } } } */
/* { dg-final { scan-tree-dump-not "gap of 6 elements" "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/pr99102.c b/gcc/testsuite/gcc.dg/vect/pr99102.c
new file mode 100644
index 0000000..62d4d33
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/pr99102.c
@@ -0,0 +1,20 @@
+/* { dg-options "-O2 -ftree-vectorize" } */
+/* { dg-additional-options "-msve-vector-bits=256" { target aarch64_sve256_hw } } */
+long a[44];
+short d, e = -7;
+__attribute__((noipa)) void b(char f, short j, short k, unsigned l) {
+ for (int g = 0; g < 9; g += f)
+ for (int b = 0; b < 90; b -= k)
+ for (int h = 0; h < f; h++)
+ for (short i = 0; i < 15; i += 4)
+ if (!l)
+ a[i] = j;
+}
+int main() {
+ for (long c = 0; c < 2; ++c)
+ a[c] = 7;
+ b(9, d, e, 5);
+ if (!a[0])
+ __builtin_abort();
+}
+/* { dg-final { scan-tree-dump "MASK_SCATTER_STORE" "vect" { target aarch64_sve256_hw } } } */
diff --git a/gcc/testsuite/gcc.dg/vect/pr99253.c b/gcc/testsuite/gcc.dg/vect/pr99253.c
new file mode 100644
index 0000000..9e33450
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/pr99253.c
@@ -0,0 +1,22 @@
+/* { dg-do run } */
+
+#include "tree-vect.h"
+
+int a = 0;
+static int b = 0;
+long c = 0;
+
+int
+main()
+{
+ check_vect ();
+ for (int d = 0; d < 8; d++)
+ {
+ a ^= c;
+ b = a;
+ a ^= 1;
+ }
+ if (a != 0 || b != 1)
+ __builtin_abort();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/vect/slp-21.c b/gcc/testsuite/gcc.dg/vect/slp-21.c
index 117d65c..bf8f434 100644
--- a/gcc/testsuite/gcc.dg/vect/slp-21.c
+++ b/gcc/testsuite/gcc.dg/vect/slp-21.c
@@ -210,7 +210,7 @@ int main (void)
Not all vect_perm targets support that, and it's a bit too specific to have
its own effective-target selector, so we just test targets directly. */
-/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 4 "vect" { target { aarch64*-*-* arm*-*-* } } } } */
-/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 2 "vect" { target { vect_strided4 && { ! { aarch64*-*-* arm*-*-* } } } } } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 4 "vect" { target { aarch64*-*-* arm*-*-* powerpc64*-*-* } } } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 2 "vect" { target { vect_strided4 && { ! { aarch64*-*-* arm*-*-* powerpc64*-*-* } } } } } } */
/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 0 "vect" { target { ! { vect_strided4 } } } } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-complex-5.c b/gcc/testsuite/gcc.dg/vect/vect-complex-5.c
index 0648637..81fdb67c 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-complex-5.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-complex-5.c
@@ -40,4 +40,4 @@ main (void)
return 0;
}
-/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 2 "vect" } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 2 "vect" { xfail { ! vect_hw_misalign } } } } */