summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg')
-rw-r--r--gcc/testsuite/gcc.dg/Warray-bounds-27.c35
-rw-r--r--gcc/testsuite/gcc.dg/Wattributes-8.c38
-rw-r--r--gcc/testsuite/gcc.dg/Wrestrict-6.c4
-rw-r--r--gcc/testsuite/gcc.dg/Wrestrict-7.c51
-rw-r--r--gcc/testsuite/gcc.dg/Wrestrict-8.c116
-rw-r--r--gcc/testsuite/gcc.dg/Wrestrict-9.c315
-rw-r--r--gcc/testsuite/gcc.dg/Wstringop-overflow-3.c1
-rw-r--r--gcc/testsuite/gcc.dg/builtin-unreachable-6.c2
-rw-r--r--gcc/testsuite/gcc.dg/graphite/pr84399.c23
-rw-r--r--gcc/testsuite/gcc.dg/lto/README24
-rw-r--r--gcc/testsuite/gcc.dg/pr56727-1.c5
-rw-r--r--gcc/testsuite/gcc.dg/pr56727-2.c6
-rw-r--r--gcc/testsuite/gcc.dg/pr81592.c20
-rw-r--r--gcc/testsuite/gcc.dg/pr82123.c12
-rw-r--r--gcc/testsuite/gcc.dg/pr83723.c20
-rw-r--r--gcc/testsuite/gcc.dg/pr84095.c14
-rw-r--r--gcc/testsuite/gcc.dg/pr84334.c12
-rw-r--r--gcc/testsuite/gcc.dg/pr84452.c14
-rw-r--r--gcc/testsuite/gcc.dg/pr84503-1.c68
-rw-r--r--gcc/testsuite/gcc.dg/pr84503-2.c5
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr84417.c9
-rw-r--r--gcc/testsuite/gcc.dg/vect/pr84357.c31
-rw-r--r--gcc/testsuite/gcc.dg/vect/pr84419.c21
-rw-r--r--gcc/testsuite/gcc.dg/vmx/extract-be-order.c3
-rw-r--r--gcc/testsuite/gcc.dg/vmx/extract-vsx-be-order.c3
-rw-r--r--gcc/testsuite/gcc.dg/vmx/insert-be-order.c3
-rw-r--r--gcc/testsuite/gcc.dg/vmx/insert-vsx-be-order.c3
-rw-r--r--gcc/testsuite/gcc.dg/vmx/ld-be-order.c3
-rw-r--r--gcc/testsuite/gcc.dg/vmx/ld-vsx-be-order.c3
-rw-r--r--gcc/testsuite/gcc.dg/vmx/lde-be-order.c3
-rw-r--r--gcc/testsuite/gcc.dg/vmx/ldl-be-order.c3
-rw-r--r--gcc/testsuite/gcc.dg/vmx/ldl-vsx-be-order.c3
-rw-r--r--gcc/testsuite/gcc.dg/vmx/merge-be-order.c3
-rw-r--r--gcc/testsuite/gcc.dg/vmx/merge-vsx-be-order.c3
-rw-r--r--gcc/testsuite/gcc.dg/vmx/mult-even-odd-be-order.c3
-rw-r--r--gcc/testsuite/gcc.dg/vmx/pack-be-order.c3
-rw-r--r--gcc/testsuite/gcc.dg/vmx/perm-be-order.c3
-rw-r--r--gcc/testsuite/gcc.dg/vmx/splat-be-order.c3
-rw-r--r--gcc/testsuite/gcc.dg/vmx/splat-vsx-be-order.c3
-rw-r--r--gcc/testsuite/gcc.dg/vmx/st-be-order.c3
-rw-r--r--gcc/testsuite/gcc.dg/vmx/st-vsx-be-order.c3
-rw-r--r--gcc/testsuite/gcc.dg/vmx/ste-be-order.c3
-rw-r--r--gcc/testsuite/gcc.dg/vmx/stl-be-order.c3
-rw-r--r--gcc/testsuite/gcc.dg/vmx/stl-vsx-be-order.c3
-rw-r--r--gcc/testsuite/gcc.dg/vmx/sum2s-be-order.c3
-rw-r--r--gcc/testsuite/gcc.dg/vmx/unpack-be-order.c3
-rw-r--r--gcc/testsuite/gcc.dg/vmx/vsums-be-order.c3
47 files changed, 886 insertions, 32 deletions
diff --git a/gcc/testsuite/gcc.dg/Warray-bounds-27.c b/gcc/testsuite/gcc.dg/Warray-bounds-27.c
new file mode 100644
index 00000000000..98c9439bbf3
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/Warray-bounds-27.c
@@ -0,0 +1,35 @@
+/* { dg-do compile }
+ { dg-options "-O2 -Wall -Wextra -Warray-bounds -Wrestrict" } */
+
+typedef __SIZE_TYPE__ size_t;
+
+extern void* memcpy (void* restrict, const void* restrict, size_t);
+
+extern void sink (void*, ...);
+
+struct Data {
+ size_t n;
+ void *p;
+};
+
+void test_copy (void)
+{
+ struct Data d;
+ sink (&d);
+
+ char dp1[sizeof d + 1];
+ char d2x[2 * sizeof d];
+ char d2xp1[2 * sizeof d + 1];
+
+ /* During development the following would incorrectly trigger:
+ warning: 'memcpy' forming offset [17, 25] is out of the bounds [0, 16]
+ of object ā€˜dā€™ with type 'struct Data' [-Warray-bounds]
+ that wasn't caught by the test suite. Make sure it is. */
+ memcpy (&dp1, d.p, sizeof dp1); /* { dg-bogus "\\\[-Warray-bounds" } */
+
+ /* Likewise. */
+ memcpy (&d2x, d.p, sizeof d2x); /* { dg-bogus "\\\[-Warray-bounds" } */
+ memcpy (&d2xp1, d.p, sizeof d2xp1); /* { dg-bogus "\\\[-Warray-bounds" } */
+
+ sink (&d, &dp1, &d2x, &d2xp1);
+}
diff --git a/gcc/testsuite/gcc.dg/Wattributes-8.c b/gcc/testsuite/gcc.dg/Wattributes-8.c
new file mode 100644
index 00000000000..a4b4c00c08f
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/Wattributes-8.c
@@ -0,0 +1,38 @@
+/* PR middle-end/84108 - incorrect -Wattributes warning for packed/aligned
+ conflict on struct members
+ { dg-do compile }
+ { dg-options "-Wall -Wattributes" } */
+
+#define ATTR(list) __attribute__ (list)
+#define ASSERT(e) _Static_assert (e, #e)
+
+/* GCC is inconsistent in how it treats attribute aligned between
+ variable and member declarations. Attribute aligned alone is
+ sufficient to reduce a variable's alignment requirement but
+ the attribute must be paired with packed to have the same
+ effect on a member. Worse, declaring a variable both aligned
+ and packed emits a warning. */
+
+/* Avoid exercising this since emitting a warning for these given
+ the requirement for members seems like a misfeature:
+ int a ATTR ((packed, aligned (2))); // -Wattributes
+ int b ATTR ((aligned (2), packed)); // -Wattributes
+ ASSERT (_Alignof (a) == 2);
+ ASSERT (_Alignof (b) == 2); */
+
+int c ATTR ((aligned (2))); // okay (reduces alignment)
+ASSERT (_Alignof (c) == 2);
+
+struct {
+ int a ATTR ((packed, aligned (2))); /* { dg-bogus "\\\[-Wattributes" } */
+ int b ATTR ((aligned (2), packed)); /* { dg-bogus "\\\[-Wattributes" } */
+
+ /* Avoid exercising this since the attribute has no effect yet
+ there is no warning.
+ int c ATTR ((aligned (2))); // missing warning? */
+} s;
+
+ASSERT (_Alignof (s.a) == 2);
+ASSERT (_Alignof (s.b) == 2);
+
+/* ASSERT (_Alignof (s.c) == 4); */
diff --git a/gcc/testsuite/gcc.dg/Wrestrict-6.c b/gcc/testsuite/gcc.dg/Wrestrict-6.c
index c1bb373c5cd..cc7185f0998 100644
--- a/gcc/testsuite/gcc.dg/Wrestrict-6.c
+++ b/gcc/testsuite/gcc.dg/Wrestrict-6.c
@@ -21,7 +21,7 @@ void warn_2_smax_p2 (void)
ptrdiff_t i = UR (2, DIFF_MAX + (size_t)2);
- strcpy (d, d + i); /* { dg-warning "accessing between 0 and 4 bytes at offsets 0 and \\\[2, -\[0-9\]+] may overlap up to 2 bytes at offset 2" } */
+ strcpy (d, d + i); /* { dg-warning "accessing between 0 and 4 bytes at offsets 0 and \\\[2, 7] may overlap up to 2 bytes at offset 2" } */
sink (d);
}
@@ -47,7 +47,7 @@ void warn_2u_smax_p2 (void)
size_t i = UR (2, DIFF_MAX + (size_t)2);
- strcpy (d, d + i); /* { dg-warning "accessing between 0 and 4 bytes at offsets 0 and \\\[2, -\[0-9\]+] may overlap up to 2 bytes at offset 2" } */
+ strcpy (d, d + i); /* { dg-warning "accessing between 0 and 4 bytes at offsets 0 and \\\[2, 7] may overlap up to 2 bytes at offset 2" } */
sink (d);
}
diff --git a/gcc/testsuite/gcc.dg/Wrestrict-7.c b/gcc/testsuite/gcc.dg/Wrestrict-7.c
new file mode 100644
index 00000000000..5be5e0bd051
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/Wrestrict-7.c
@@ -0,0 +1,51 @@
+/* PR tree-optimization/83698 - bogus offset in -Wrestrict messages for
+ strcat of unknown strings
+ { dg-do compile }
+ { dg-options "-O2 -Wrestrict -ftrack-macro-expansion=0" } */
+
+extern char* strcat (char*, const char*);
+
+void sink (char*);
+
+#define T(d, s) sink (strcat (d, s))
+
+extern char arr[];
+
+
+void test_strcat_array_cst_offset (void)
+{
+ T (arr, arr + 1); /* { dg-warning "accessing 2 or more bytes at offsets 0 and 1 may overlap 1 byte at offset 1" } */
+ T (arr, arr + 2); /* { dg-warning "accessing 3 or more bytes at offsets 0 and 2 may overlap 1 byte at offset 2" } */
+ T (arr, arr + 13); /* { dg-warning "accessing 14 or more bytes at offsets 0 and 13 may overlap 1 byte at offset 13" } */
+
+ T (arr + 1, arr); /* { dg-warning "accessing 2 or more bytes at offsets 1 and 0 may overlap 1 byte at offset 1" } */
+ T (arr + 17, arr + 11); /* { dg-warning "accessing 7 or more bytes at offsets 17 and 11 may overlap 1 byte at offset 17" } */
+ T (arr + 36, arr + 20); /* { dg-warning "accessing 17 or more bytes at offsets 36 and 20 may overlap 1 byte at offset 36" } */
+}
+
+void test_strcat_ptr_cst_offset (char *d)
+{
+ T (d - 12, d + 34); /* { dg-warning "accessing 47 or more bytes at offsets -12 and 34 may overlap 1 byte at offset 34" } */
+ T (d + 12, d + 34); /* { dg-warning "accessing 23 or more bytes at offsets 12 and 34 may overlap 1 byte at offset 34" } */
+ T (d + 20, d + 36); /* { dg-warning "accessing 17 or more bytes at offsets 20 and 36 may overlap 1 byte at offset 36" } */
+}
+
+void test_strcat_array_var_offset (int i, int j)
+{
+ T (arr + i, arr); /* { dg-warning "accessing 1 or more bytes at offsets \\\[0, \[0-9\]+] and 0 may overlap 1 byte at offset \\\[0, \[0-9\]+]" } */
+ T (arr, arr + j); /* { dg-warning "accessing 1 or more bytes at offsets 0 and \\\[0, \[0-9\]+] may overlap 1 byte at offset \\\[0, \[0-9\]+]" } */
+ T (arr + i, arr + j); /* { dg-warning "accessing 1 or more bytes at offsets \\\[0, \[0-9\]+] and \\\[0, \[0-9\]+] may overlap 1 byte at offset \\\[0, \[0-9\]+]" } */
+
+ T (arr + i, arr + 5); /* { dg-warning "accessing 6 or more bytes at offsets \\\[0, \[0-9\]+] and 5 may overlap 1 byte at offset \\\[5, \[0-9\]+]" } */
+ T (arr + 7, arr + j); /* { dg-warning "accessing 8 or more bytes at offsets 7 and \\\[0, \[0-9\]+] may overlap 1 byte at offset \\\[7, \[0-9\]+]" } */
+}
+
+void test_strcat_ptr_var_offset (char *d, int i, int j)
+{
+ T (d + i, d); /* { dg-warning "accessing \[0-9\]+ or more bytes at offsets \\\[-\[0-9\]+, \[0-9\]+] and 0 may overlap 1 byte at offset \\\[0, \[0-9\]+]" } */
+ T (d, d + j); /* { dg-warning "accessing \[0-9\]+ or more bytes at offsets 0 and \\\[-\[0-9\]+, \[0-9\]+] may overlap 1 byte at offset \\\[0, \[0-9\]+]" } */
+ T (d + i, d + j); /* { dg-warning "accessing 1 or more bytes at offsets \\\[-\[0-9\]+, \[0-9\]+] and \\\[-\[0-9\]+, \[0-9\]+] may overlap 1 byte at offset \\\[-\[0-9\]+, \[0-9\]+]" } */
+
+ T (d + i, d + 3); /* { dg-warning "accessing \[0-9\]+ or more bytes at offsets \\\[-\[0-9\]+, \[0-9\]+] and 3 may overlap 1 byte at offset \\\[3, \[0-9\]+]" } */
+ T (d + 9, d + j); /* { dg-warning "accessing \[0-9\]+ or more bytes at offsets 9 and \\\[-\[0-9\]+, \[0-9\]+] may overlap 1 byte at offset \\\[9, \[0-9\]+]" } */
+}
diff --git a/gcc/testsuite/gcc.dg/Wrestrict-8.c b/gcc/testsuite/gcc.dg/Wrestrict-8.c
new file mode 100644
index 00000000000..24946b08c3b
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/Wrestrict-8.c
@@ -0,0 +1,116 @@
+/* PR tree-optimization/84095 - false-positive -Wrestrict warnings for
+ memcpy within array
+ { dg-do compile }
+ { dg-options "-O2 -Wrestrict -ftrack-macro-expansion=0" } */
+
+typedef __SIZE_TYPE__ size_t;
+
+extern void* memcpy (void* restrict, const void* restrict, size_t);
+
+#define T(d, s, n) memcpy (d, s, n)
+
+struct S1 { char c; } a8_1[8];
+
+void test_1_dim_var (int i, int j)
+{
+ /* Variable destination index and constant source index. */
+ T (&a8_1[i], &a8_1[0], 1);
+ T (&a8_1[i], &a8_1[0], 2);
+ T (&a8_1[i], &a8_1[0], 3);
+ T (&a8_1[i], &a8_1[0], 4);
+
+ T (&a8_1[i], &a8_1[0], 5); /* { dg-warning "accessing 5 bytes at offsets \\\[0, 8] and 0 overlaps between 2 and 5 bytes at offset \\\[0, 3\\\]" } */
+ T (&a8_1[i], &a8_1[0], 6); /* { dg-warning "accessing 6 bytes at offsets \\\[0, 8] and 0 overlaps between 4 and 6 bytes at offset \\\[0, 2\\\]" } */
+ T (&a8_1[i], &a8_1[0], 7); /* { dg-warning "accessing 7 bytes at offsets \\\[0, 8] and 0 overlaps between 6 and 7 bytes at offset \\\[0, 1\\\]" } */
+ T (&a8_1[i], &a8_1[0], 8); /* { dg-warning "accessing 8 bytes at offsets \\\[0, 8] and 0 overlaps 8 bytes at offset 0" } */
+
+ /* The following is diagnosed by -Warray-bounds when it's enabled
+ rather than by -Wrestrict. */
+ T (&a8_1[i], &a8_1[0], 9); /* { dg-warning "accessing 9 bytes at offsets \\\[0, 8] and 0 overlaps 9 bytes at offset 0" } */
+
+ /* Same as above but with constant destination index and variable
+ source index. */
+ T (&a8_1[0], &a8_1[i], 1);
+ T (&a8_1[0], &a8_1[i], 2);
+ T (&a8_1[0], &a8_1[i], 3);
+ T (&a8_1[0], &a8_1[i], 4);
+
+ T (&a8_1[0], &a8_1[i], 5); /* { dg-warning "accessing 5 bytes at offsets 0 and \\\[0, 8] overlaps between 2 and 5 bytes at offset \\\[0, 3\\\]" } */
+ T (&a8_1[0], &a8_1[i], 6); /* { dg-warning "accessing 6 bytes at offsets 0 and \\\[0, 8] overlaps between 4 and 6 bytes at offset \\\[0, 2\\\]" } */
+ T (&a8_1[0], &a8_1[i], 7); /* { dg-warning "accessing 7 bytes at offsets 0 and \\\[0, 8] overlaps between 6 and 7 bytes at offset \\\[0, 1\\\]" } */
+ T (&a8_1[0], &a8_1[i], 8); /* { dg-warning "accessing 8 bytes at offsets 0 and \\\[0, 8] overlaps 8 bytes at offset 0" } */
+ T (&a8_1[0], &a8_1[i], 9); /* { dg-warning "accessing 9 bytes at offsets 0 and \\\[0, 8] overlaps 9 bytes at offset 0" } */
+
+
+ /* Variable destination and source indices. */
+ T (&a8_1[i], &a8_1[j], 1);
+ T (&a8_1[i], &a8_1[j], 2);
+ T (&a8_1[i], &a8_1[j], 3);
+ T (&a8_1[i], &a8_1[j], 4);
+
+ T (&a8_1[i], &a8_1[j], 5); /* { dg-warning "accessing 5 bytes at offsets \\\[0, 8] and \\\[0, 8] overlaps between 2 and 5 bytes at offset \\\[0, 3\\\]" } */
+ T (&a8_1[i], &a8_1[j], 6); /* { dg-warning "accessing 6 bytes at offsets \\\[0, 8] and \\\[0, 8] overlaps between 4 and 6 bytes at offset \\\[0, 2\\\]" } */
+ T (&a8_1[i], &a8_1[j], 7); /* { dg-warning "accessing 7 bytes at offsets \\\[0, 8] and \\\[0, 8] overlaps between 6 and 7 bytes at offset \\\[0, 1\\\]" } */
+ T (&a8_1[i], &a8_1[j], 8); /* { dg-warning "accessing 8 bytes at offsets \\\[0, 8] and \\\[0, 8] overlaps 8 bytes at offset 0" } */
+
+ /* The following is diagnosed by -Warray-bounds when it's enabled
+ rather than by -Wrestrict. */
+ T (&a8_1[i], &a8_1[j], 9); /* { dg-warning "accessing 9 bytes at offsets \\\[0, 8] and \\\[0, 8] overlaps 9 bytes at offset 0" } */
+}
+
+struct S4 { char a4[4]; } a2_4[2];
+
+void test_2_dim (int i, int j)
+{
+ T (&a2_4[i], &a2_4[0], 1);
+ T (&a2_4[i], &a2_4[0], 4);
+
+ T (&a2_4[i], &a2_4[0], 5); /* { dg-warning "accessing 5 bytes at offsets \\\[0, 8] and 0 overlaps between 2 and 5 bytes at offset \\\[0, 3]" } */
+ T (&a2_4[i], &a2_4[0], 6); /* { dg-warning "accessing 6 bytes at offsets \\\[0, 8] and 0 overlaps between 4 and 6 bytes at offset \\\[0, 2]" } */
+ T (&a2_4[i], &a2_4[0], 7); /* { dg-warning "accessing 7 bytes at offsets \\\[0, 8] and 0 overlaps between 6 and 7 bytes at offset \\\[0, 1]" } */
+ T (&a2_4[i], &a2_4[0], 8); /* { dg-warning "accessing 8 bytes at offsets \\\[0, 8] and 0 overlaps 8 bytes at offset 0" } */
+
+ T (a2_4[i].a4, a2_4[0].a4, 1);
+ T (a2_4[i].a4, a2_4[0].a4, 4);
+
+ T (a2_4[i].a4, a2_4[0].a4, 5); /* { dg-warning "accessing 5 bytes at offsets \\\[0, 8] and 0 overlaps between 2 and 5 bytes at offset \\\[0, 3]" } */
+ T (a2_4[i].a4, a2_4[0].a4, 8); /* { dg-warning "accessing 8 bytes at offsets \\\[0, 8] and 0 overlaps 8 bytes at offset 0" } */
+
+ T (a2_4[i].a4, a2_4[j].a4, 1);
+ T (a2_4[i].a4, a2_4[j].a4, 4);
+
+ /* The destination and source offsets printed below ignore the size
+ of the copy and only indicate the values that are valid for each
+ of the destination and source arguments on its own, without
+ considering the size of the overlapping access. */
+ T (a2_4[i].a4, a2_4[j].a4, 5); /* { dg-warning "accessing 5 bytes at offsets \\\[0, 8] and \\\[0, 8] overlaps between 2 and 5 bytes at offset \\\[0, 3]" } */
+ T (a2_4[i].a4, a2_4[j].a4, 8); /* { dg-warning "accessing 8 bytes at offsets \\\[0, 8] and \\\[0, 8] overlaps 8 bytes at offset 0" } */
+
+ /* Same as above but referencing the first elements of each array. */
+ T (&a2_4[i].a4[0], &a2_4[j].a4[0], 1);
+ T (&a2_4[i].a4[0], &a2_4[j].a4[0], 4);
+
+ T (&a2_4[i].a4[0], &a2_4[j].a4[0], 5); /* { dg-warning "accessing 5 bytes at offsets \\\[0, 8] and \\\[0, 8] overlaps between 2 and 5 bytes at offset \\\[0, 3]" } */
+ T (&a2_4[i].a4[0], &a2_4[j].a4[0], 8); /* { dg-warning "accessing 8 bytes at offsets \\\[0, 8] and \\\[0, 8] overlaps 8 bytes at offset 0" } */
+
+ T (&a2_4[i].a4[0], &a2_4[j].a4[1], 3);
+ T (&a2_4[i].a4[0], &a2_4[j].a4[2], 2);
+ T (&a2_4[i].a4[0], &a2_4[j].a4[3], 1);
+}
+
+struct { int i; } a2[2][8];
+
+void test_single_2_dim_major (int i)
+{
+ memcpy (&a2[i], &a2[0], sizeof *a2); /* { dg-bogus "\\\[-Wrestrict]" } */
+}
+
+void test_single_2_dim_minor (int i)
+{
+ memcpy (&a2[i][0], &a2[0][0], sizeof a2[0][0]); /* { dg-bogus "\\\[-Wrestrict]" } */
+}
+
+void test_single_2_dim_major_minor (int i, int j)
+{
+ memcpy (&a2[i][j], &a2[0][0], sizeof a2[0][0]); /* { dg-bogus "\\\[-Wrestrict]" } */
+}
diff --git a/gcc/testsuite/gcc.dg/Wrestrict-9.c b/gcc/testsuite/gcc.dg/Wrestrict-9.c
new file mode 100644
index 00000000000..5ad87401ed9
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/Wrestrict-9.c
@@ -0,0 +1,315 @@
+/* PR tree-optimization/84095 - false-positive -Wrestrict warnings for
+ strcpy within array
+ { dg-do compile }
+ { dg-options "-O2 -Wrestrict -ftrack-macro-expansion=0" } */
+
+typedef __SIZE_TYPE__ size_t;
+
+extern void* memcpy (void* restrict, const void* restrict, size_t);
+extern char* strcpy (char* restrict, const char* restrict);
+
+#define T(d, s) strcpy (d, s)
+
+struct MemArrays {
+ char pad[8];
+ char a2[3][9];
+ char a3[3][4][9];
+} a[2];
+
+struct NestedMemArrays {
+ struct MemArrays ma;
+ struct MemArrays ma1[2];
+} nma[2];
+
+/* Use a variable as the source of a copy to verify that VAR_DECL
+ is handled correctly when it's the source of GIMPLE assignment. */
+const char *str = "1234567";
+
+void test_obj_2_dim_const (void)
+{
+ const char *s = strcpy (a[0].a2[0], "1234567");
+
+ T (a[0].a2[1], s);
+ T (a[0].a2[2], s);
+
+ /* Ideally, the offsets in the warning below would be relative to
+ the beginning of the accessed array member. Unfortunately, when
+ the offset is represented as
+ MEM_REF (char[9], A, offsetof (struct MemArrays, A[0].A2[0]) + 1)
+ as it is in this instance it's difficult to determine the member
+ that is being accessed and tease out from the MEM_REF the offset
+ as it appears in the source. As a result, the warning mentions
+ the offset from the beginning of A instead. This is suboptimal
+ and should be fixed, either by printing the correct offsets or
+ by mentioning the base object that the offset is relative to. */
+ T (a[0].a2[0] + 1, s); /* { dg-warning "accessing 8 bytes at offsets \(1|9\) and \(0|8\) overlaps 7 bytes at offset \(1|9\)." } */
+ T (a[0].a2[1] + 2, s);
+ T (a[0].a2[2] + 3, s);
+
+ T (a[1].a2[0], s);
+ T (a[1].a2[1], s);
+ T (a[1].a2[2], s);
+
+ T (a[1].a2[0] + 1, s);
+ T (a[1].a2[1] + 2, s);
+ T (a[1].a2[2] + 3, s);
+}
+
+void test_obj_nested_2_dim_const (void)
+{
+ const char *s = strcpy (nma[0].ma.a2[0], str);
+
+ T (nma[0].ma.a2[1], s);
+ T (nma[0].ma.a2[2], s);
+
+ T (nma[0].ma.a2[0] + 1, s); /* { dg-warning "accessing 8 bytes at offsets 1 and 0 overlaps 7 bytes at offset 1" "bug " { xfail *-*-* } } */
+ T (nma[0].ma.a2[1] + 2, s);
+ T (nma[0].ma.a2[2] + 3, s);
+
+ T (nma[1].ma.a2[1], s);
+ T (nma[1].ma.a2[2], s);
+
+ T (nma[1].ma.a2[0] + 1, s);
+ T (nma[1].ma.a2[1] + 2, s);
+ T (nma[1].ma.a2[2] + 3, s);
+
+
+ T (nma[0].ma1[0].a2[1], s);
+ T (nma[0].ma1[0].a2[2], s);
+
+ T (nma[0].ma1[0].a2[0] + 1, s);
+ T (nma[0].ma1[0].a2[1] + 2, s);
+ T (nma[0].ma1[0].a2[2] + 3, s);
+
+ T (nma[1].ma1[0].a2[1], s);
+ T (nma[1].ma1[0].a2[2], s);
+
+ T (nma[1].ma1[0].a2[0] + 1, s);
+ T (nma[1].ma1[0].a2[1] + 2, s);
+ T (nma[1].ma1[0].a2[2] + 3, s);
+}
+
+void test_obj_2_dim_var (int i, int j)
+{
+ const char *s = memcpy (a[0].a2[0], "1234567", 8);
+
+ T (a[i].a2[0], s); /* { dg-bogus "\\\[-Wrestrict]" } */
+ T (a[i].a2[1], s);
+ T (a[i].a2[2], s);
+
+ T (a[i].a2[0] + 1, s);
+ T (a[i].a2[1] + 1, s);
+ T (a[i].a2[2] + 1, s);
+
+ T (a[0].a2[i], s); /* { dg-bogus "\\\[-Wrestrict]" } */
+ T (a[1].a2[i], s);
+
+ T (a[i].a2[0] + j, s);
+ T (a[i].a2[1] + j, s);
+ T (a[i].a2[2] + j, s);
+
+ T (a[0].a2[i] + 1, s);
+ T (a[1].a2[i] + 1, s);
+
+ T (a[0].a2[i] + j, s);
+ T (a[1].a2[i] + j, s);
+
+ if (i < 0 || 1 < i)
+ i = 1;
+
+ T (a[i].a2[0], s);
+ T (a[i].a2[1], s);
+ T (a[i].a2[2], s);
+
+ T (a[i].a2[0] + 1, s);
+ T (a[i].a2[1] + 1, s);
+ T (a[i].a2[2] + 1, s);
+
+ T (a[0].a2[i], s);
+ T (a[1].a2[i], s);
+
+ T (a[i].a2[0] + j, s);
+ T (a[i].a2[1] + j, s);
+ T (a[i].a2[2] + j, s);
+
+ T (a[0].a2[i] + 1, s);
+ T (a[1].a2[i] + 1, s);
+
+ T (a[0].a2[i] + j, s);
+ T (a[1].a2[i] + j, s);
+}
+
+void test_obj_nested_2_dim_var (int i, int j)
+{
+ const char *s = strcpy (nma[0].ma.a2[0], "1234567");
+
+ T (nma[i].ma.a2[0], s); /* { dg-bogus "\\\[-Wrestrict]" } */
+ T (nma[i].ma.a2[1], s);
+ T (nma[i].ma.a2[2], s);
+
+ T (nma[i].ma.a2[0] + 1, s);
+ T (nma[i].ma.a2[1] + 1, s);
+ T (nma[i].ma.a2[2] + 1, s);
+
+ T (nma[0].ma.a2[i], s); /* { dg-bogus "\\\[-Wrestrict]" } */
+ T (nma[1].ma.a2[i], s);
+
+ T (nma[i].ma.a2[0] + j, s);
+ T (nma[i].ma.a2[1] + j, s);
+ T (nma[i].ma.a2[2] + j, s);
+
+ T (nma[0].ma.a2[i] + 1, s);
+ T (nma[1].ma.a2[i] + 1, s);
+
+ T (nma[0].ma.a2[i] + j, s);
+ T (nma[1].ma.a2[i] + j, s);
+}
+
+void test_ref_2_dim_const (struct MemArrays *p)
+{
+ strcpy (p[0].a2[0], "1234567");
+ const char *s = p[0].a2[0];
+
+ T (p[0].a2[1], s);
+ T (p[0].a2[2], s);
+
+ T (p[1].a2[0], s);
+ T (p[1].a2[1], s);
+ T (p[1].a2[2], s);
+}
+
+void test_ref_2_dim_var (struct MemArrays *p, int i, int j)
+{
+ strcpy (p[0].a2[0], "1234567");
+ const char *s = p[0].a2[0];
+
+ T (p[i].a2[0], s); /* { dg-bogus "\\\[-Wrestrict]" } */
+ T (p[i].a2[1], s);
+ T (p[i].a2[2], s);
+
+ T (p[0].a2[i], s);
+ T (p[1].a2[i], s);
+
+ T (p[i].a2[0] + j, s);
+ T (p[i].a2[1] + j, s);
+ T (p[i].a2[2] + j, s);
+
+ T (p[0].a2[i] + j, s);
+ T (p[1].a2[i] + j, s);
+}
+
+void test_obj_3_dim_var (int i, int j)
+{
+ strcpy (a[0].a3[0][0], "1234567");
+ const char *s = a[0].a3[0][0];
+
+ T (a[0].a3[0][i], s);
+ T (a[0].a3[1][i], s);
+ T (a[0].a3[2][i], s);
+
+ T (a[1].a3[0][i], s);
+ T (a[1].a3[1][i], s);
+ T (a[1].a3[2][i], s);
+
+ T (a[0].a3[i][0], s); /* { dg-bogus "\\\[-Wrestrict\]" } */
+ T (a[0].a3[i][1], s);
+ T (a[0].a3[i][2], s);
+
+ T (a[1].a3[i][0], s);
+ T (a[1].a3[i][1], s);
+ T (a[1].a3[i][2], s);
+
+ T (a[i].a3[0][0], s); /* { dg-bogus "\\\[-Wrestrict\]" } */
+ T (a[i].a3[0][1], s);
+ T (a[i].a3[0][2], s);
+
+ T (a[i].a3[1][0], s);
+ T (a[i].a3[1][1], s);
+ T (a[i].a3[1][2], s);
+
+ T (a[i].a3[2][0], s);
+ T (a[i].a3[2][1], s);
+ T (a[i].a3[2][2], s);
+
+
+ T (a[0].a3[0][i] + 1, s);
+ T (a[0].a3[1][i] + 1, s);
+ T (a[0].a3[2][i] + 1, s);
+
+ T (a[1].a3[0][i] + 1, s);
+ T (a[1].a3[1][i] + 1, s);
+ T (a[1].a3[2][i] + 1, s);
+
+
+ T (a[0].a3[0][i] + j, s);
+ T (a[0].a3[1][i] + j, s);
+ T (a[0].a3[2][i] + j, s);
+
+ T (a[1].a3[0][i] + j, s);
+ T (a[1].a3[1][i] + j, s);
+ T (a[1].a3[2][i] + j, s);
+
+ T (a[0].a3[i][0] + j, s);
+ T (a[0].a3[i][1] + j, s);
+ T (a[0].a3[i][2] + j, s);
+
+ T (a[1].a3[i][0] + j, s);
+ T (a[1].a3[i][1] + j, s);
+ T (a[1].a3[i][2] + j, s);
+
+ T (a[i].a3[0][0] + j, s);
+ T (a[i].a3[0][1] + j, s);
+ T (a[i].a3[0][2] + j, s);
+
+ T (a[i].a3[1][0] + j, s);
+ T (a[i].a3[1][1] + j, s);
+ T (a[i].a3[1][2] + j, s);
+
+ T (a[i].a3[2][0] + j, s);
+ T (a[i].a3[2][1] + j, s);
+ T (a[i].a3[2][2] + j, s);
+}
+
+void test_obj_3_dim_const (struct MemArrays *p)
+{
+ strcpy (p[0].a3[0][0], "1234567");
+ const char *s = p[0].a3[0][0];
+
+ T (p[0].a3[0][1], s);
+ T (p[0].a3[0][2], s);
+ T (p[0].a3[0][3], s);
+
+ T (p[0].a3[0][1] + 1, s);
+ T (p[0].a3[0][2] + 1, s);
+ T (p[0].a3[0][3] + 1, s);
+
+ T (p[0].a3[1][0], s);
+ T (p[0].a3[1][1], s);
+ T (p[0].a3[1][2], s);
+ T (p[0].a3[1][3], s);
+
+ T (p[0].a3[1][0] + 1, s);
+ T (p[0].a3[1][1] + 1, s);
+ T (p[0].a3[1][2] + 1, s);
+ T (p[0].a3[1][3] + 1, s);
+
+ T (p[0].a3[2][0], s);
+ T (p[0].a3[2][1], s);
+ T (p[0].a3[2][2], s);
+ T (p[0].a3[2][3], s);
+
+ T (p[1].a3[0][0], s);
+ T (p[1].a3[0][1], s);
+ T (p[1].a3[0][2], s);
+ T (p[1].a3[0][3], s);
+
+ T (p[1].a3[1][0], s);
+ T (p[1].a3[1][1], s);
+ T (p[1].a3[1][2], s);
+ T (p[1].a3[1][3], s);
+
+ T (p[1].a3[2][0], s);
+ T (p[1].a3[2][1], s);
+ T (p[1].a3[2][2], s);
+ T (p[1].a3[2][3], s);
+}
diff --git a/gcc/testsuite/gcc.dg/Wstringop-overflow-3.c b/gcc/testsuite/gcc.dg/Wstringop-overflow-3.c
index 590184461a9..6c8cbf3898e 100644
--- a/gcc/testsuite/gcc.dg/Wstringop-overflow-3.c
+++ b/gcc/testsuite/gcc.dg/Wstringop-overflow-3.c
@@ -1,6 +1,7 @@
/* PR tree-optimization/84238 */
/* { dg-do compile } */
/* { dg-options "-O2" } */
+/* { dg-require-effective-target alloca } */
char a[1];
int b;
diff --git a/gcc/testsuite/gcc.dg/builtin-unreachable-6.c b/gcc/testsuite/gcc.dg/builtin-unreachable-6.c
index 1915dd13f42..b0504be89cc 100644
--- a/gcc/testsuite/gcc.dg/builtin-unreachable-6.c
+++ b/gcc/testsuite/gcc.dg/builtin-unreachable-6.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O2 -fdump-tree-fab1 -fno-tree-dominator-opts" } */
+/* { dg-options "-O2 -fdump-tree-fab1 -fno-tree-dominator-opts -fno-tree-vrp" } */
void
foo (int b, int c)
diff --git a/gcc/testsuite/gcc.dg/graphite/pr84399.c b/gcc/testsuite/gcc.dg/graphite/pr84399.c
new file mode 100644
index 00000000000..4b142df75a2
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/graphite/pr84399.c
@@ -0,0 +1,23 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -floop-nest-optimize -fno-tree-loop-im --param scev-max-expr-size=1" } */
+
+void
+h8 (int cv, int od)
+{
+ for (;;)
+ {
+ int ih = (__UINTPTR_TYPE__)&od;
+ if (cv == 0)
+ while (od < 1)
+ {
+ int lq;
+
+ for (lq = 0; lq < 3; ++lq)
+ for (ih = 0; ih < 4; ++ih)
+ od += lq;
+ }
+ while (ih < 1)
+ {
+ }
+ }
+}
diff --git a/gcc/testsuite/gcc.dg/lto/README b/gcc/testsuite/gcc.dg/lto/README
index 1a13dd92c62..6777c15766a 100644
--- a/gcc/testsuite/gcc.dg/lto/README
+++ b/gcc/testsuite/gcc.dg/lto/README
@@ -1,4 +1,20 @@
This directory contains tests for link-time optimization (LTO).
+
+=== Directives ===
+
+The LTO harness recognizes the following special DejaGnu directives:
+ * dg-lto-do - the equivalent of dg-do with a limited set of supported
+ arguments (see below),
+ * dg-lto-options - the equivalent of dg-options with additional syntax
+ to support different sets of options for different files compiled
+ as part of the same test case,
+ * dg-lto-warning - the equivalent of dg-warning for diagnostics expected
+ to be emitted at LTO link time,
+ * dg-lto-message - the equivakent of dg-message for informational notes
+ expected to be emitted at LTO link time.
+
+=== Test Names ===
+
Tests in this directory may span multiple files, so the naming of
the files is significant.
@@ -9,8 +25,8 @@ executable.
By default, each set of files will be compiled with list of
options listed in LTO_OPTIONS (../../lib/lto.exp), which can be
-overwritten in the shell environment or using the 'dg-lto-options'
-command in the main file of the set (i.e., the file with _0
+overridden in the shell environment or using the 'dg-lto-options'
+directive in the main file of the set (i.e., the file with _0
suffix).
For example, given the files a_0.C a_1.C a_2.C, they will be
@@ -24,7 +40,9 @@ $ g++ -o <executable> a_0.o a_1.o a_2.o
Tests that do not need more than one file are a special case
where there is a single file named 'foo_0.C'.
-The only supported dg-lto-do option are 'assemble', 'run' and 'link'.
+=== The dg-lto-do Directive ==
+
+The only supported dg-lto-do options are 'assemble', 'run' and 'link'.
Additionally, these can only be used in the main file. If
'assemble' is used, only the individual object files are
generated. If 'link' is used, the final executable is generated
diff --git a/gcc/testsuite/gcc.dg/pr56727-1.c b/gcc/testsuite/gcc.dg/pr56727-1.c
index ffc133545e7..a26edb2bf9b 100644
--- a/gcc/testsuite/gcc.dg/pr56727-1.c
+++ b/gcc/testsuite/gcc.dg/pr56727-1.c
@@ -1,6 +1,5 @@
/* { dg-do compile { target fpic } } */
/* { dg-options "-O2 -fPIC" } */
-/* { dg-final { scan-assembler-not "@(PLT|plt)" { target i?86-*-* x86_64-*-* powerpc*-*-* } } } */
#define define_func(type) \
void f_ ## type (type b) { f_ ## type (0); } \
@@ -21,3 +20,7 @@ int __attribute__((noinline, noclone)) foo_noinline(int n)
{
return (n == 1 || n == 2) ? 1 : foo_noinline(n-1) * foo_noinline(n-2);
}
+
+/* { dg-final { scan-assembler-not "@(PLT|plt)" { target i?86-*-* x86_64-*-* } } } */
+/* { dg-final { scan-assembler-not "@(PLT|plt)" { target { powerpc*-*-* && ilp32 } } } } */
+/* { dg-final { scan-assembler-not "bl \[a-z_\]*\n\\s*nop" { target { powerpc*-*-* && lp64 } } } } */
diff --git a/gcc/testsuite/gcc.dg/pr56727-2.c b/gcc/testsuite/gcc.dg/pr56727-2.c
index 62a74d1ea31..c54369ed25e 100644
--- a/gcc/testsuite/gcc.dg/pr56727-2.c
+++ b/gcc/testsuite/gcc.dg/pr56727-2.c
@@ -1,11 +1,11 @@
/* { dg-do compile { target fpic } } */
/* { dg-options "-O2 -fPIC" } */
/* { dg-require-alias "" } */
-/* { dg-final { scan-assembler "@(PLT|plt)" { target i?86-*-* x86_64-*-* powerpc*-*-linux* } } } */
__attribute__((noinline, noclone))
void f (short b)
{
+ __builtin_setjmp (0); /* Prevent tailcall */
f (0);
}
@@ -15,3 +15,7 @@ void h ()
{
g (0);
}
+
+/* { dg-final { scan-assembler "@(PLT|plt)" { target i?86-*-* x86_64-*-* } } } */
+/* { dg-final { scan-assembler "@(PLT|plt)" { target { powerpc*-*-linux* && ilp32 } } } } */
+/* { dg-final { scan-assembler "bl f\n\\s*nop" { target { powerpc*-*-linux* && lp64 } } } } */
diff --git a/gcc/testsuite/gcc.dg/pr81592.c b/gcc/testsuite/gcc.dg/pr81592.c
new file mode 100644
index 00000000000..a37703af497
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr81592.c
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -Wall -fno-strict-overflow -Wstrict-overflow=2 -fsanitize=signed-integer-overflow" } */
+
+#include <stdio.h>
+
+int proc_keys_show(long expiry, long now)
+{
+ unsigned long timo;
+ char xbuf[4];
+
+ if (now < expiry) {
+ timo = expiry - now;
+ if (timo < 60)
+ sprintf(xbuf, "%lus", timo);
+ }
+
+ return 0;
+}
+
+
diff --git a/gcc/testsuite/gcc.dg/pr82123.c b/gcc/testsuite/gcc.dg/pr82123.c
new file mode 100644
index 00000000000..34109f1aec4
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr82123.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -Wformat-overflow=1" } */
+
+void acpi_gpiochip_request_interrupt(unsigned short s)
+{
+ char name[3];
+ unsigned int pin = s;
+
+ if (pin <= 255)
+ __builtin_sprintf(name, "%02X", pin);
+}
+
diff --git a/gcc/testsuite/gcc.dg/pr83723.c b/gcc/testsuite/gcc.dg/pr83723.c
new file mode 100644
index 00000000000..a64fe9b56b9
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr83723.c
@@ -0,0 +1,20 @@
+/* PR rtl-optimization/83723 */
+/* { dg-do compile } */
+/* { dg-options "-g -O2" } */
+/* { dg-additional-options "-mfpmath=sse -msse2" { target i?86-*-* x86_64-*-* } } */
+/* { dg-additional-options "-fpie" { target pie } } */
+
+int foo (void);
+float bar (float);
+int *v;
+
+void
+baz (void)
+{
+ float a = bar (0.0);
+ bar (a);
+ if (v)
+ bar (1.0);
+ if (a < 1.0)
+ a = foo () / a;
+}
diff --git a/gcc/testsuite/gcc.dg/pr84095.c b/gcc/testsuite/gcc.dg/pr84095.c
new file mode 100644
index 00000000000..af2bc0e3f25
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr84095.c
@@ -0,0 +1,14 @@
+/* PR tree-optimization/84095 - false-positive -Wrestrict warnings for
+ memcpy within array
+ { dg-do compile }
+ { dg-options "-O2 -Wrestrict" } */
+
+struct { int i; } a[8];
+
+void f (void)
+{
+ int i;
+
+ for (i = 1; i < 8; i++)
+ __builtin_memcpy (&a[i], &a[0], sizeof(a[0])); /* { dg-bogus "\\\[-Wrestrict]" } */
+}
diff --git a/gcc/testsuite/gcc.dg/pr84334.c b/gcc/testsuite/gcc.dg/pr84334.c
new file mode 100644
index 00000000000..8cfde69bd82
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr84334.c
@@ -0,0 +1,12 @@
+/* PR tree-optimization/84334 */
+/* { dg-do compile } */
+/* { dg-options "-Ofast -frounding-math" } */
+
+float
+foo (void)
+{
+ float a = 9.999999974752427078783512115478515625e-7f;
+ float b = 1.999999994950485415756702423095703125e-6f;
+ float c = 4.999999873689375817775726318359375e-6f;
+ return a + b + c;
+}
diff --git a/gcc/testsuite/gcc.dg/pr84452.c b/gcc/testsuite/gcc.dg/pr84452.c
new file mode 100644
index 00000000000..6e961cb04e8
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr84452.c
@@ -0,0 +1,14 @@
+/* PR tree-optimization/84452 */
+/* { dg-do compile } */
+/* { dg-options "-Ofast" } */
+
+double pow (double, double) __attribute__((simd));
+double exp (double) __attribute__((simd));
+extern double a[1024], b[1024];
+
+void
+foo (void)
+{
+ for (int i = 0; i < 1024; ++i)
+ a[i] = pow (2.0, b[i]);
+}
diff --git a/gcc/testsuite/gcc.dg/pr84503-1.c b/gcc/testsuite/gcc.dg/pr84503-1.c
new file mode 100644
index 00000000000..03fb2fbd9a5
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr84503-1.c
@@ -0,0 +1,68 @@
+/* PR tree-optimization/84503 */
+/* { dg-do run } */
+/* { dg-options "-O3" } */
+
+typedef __SIZE_TYPE__ size_t;
+typedef __UINTPTR_TYPE__ uintptr_t;
+
+struct S { int a; unsigned short b; int c, d, e; long f, g, h; int i, j; };
+static struct S *k;
+static size_t l = 0;
+int m;
+
+static int
+bar (void)
+{
+ unsigned i;
+ int j;
+ if (k[0].c == 0)
+ {
+ ++m;
+ size_t n = l * 2;
+ struct S *o;
+ o = (struct S *) __builtin_realloc (k, sizeof (struct S) * n);
+ if (!o)
+ __builtin_exit (0);
+ k = o;
+ for (i = l; i < n; i++)
+ {
+ void *p = (void *) &k[i];
+ int q = 0;
+ size_t r = sizeof (struct S);
+ if ((((uintptr_t) p) % __alignof__ (long)) == 0
+ && r % sizeof (long) == 0)
+ {
+ long __attribute__ ((may_alias)) *s = (long *) p;
+ long *t = (long *) ((char *) s + r);
+ while (s < t)
+ *s++ = 0;
+ }
+ else
+ __builtin_memset (p, q, r);
+ k[i].c = i + 1;
+ k[i].a = -1;
+ }
+ k[n - 1].c = 0;
+ k[0].c = l;
+ l = n;
+ }
+ j = k[0].c;
+ k[0].c = k[j].c;
+ return j;
+}
+
+int
+main ()
+{
+ k = (struct S *) __builtin_malloc (sizeof (struct S));
+ if (!k)
+ __builtin_exit (0);
+ __builtin_memset (k, '\0', sizeof (struct S));
+ k->a = -1;
+ l = 1;
+ for (int i = 0; i < 15; ++i)
+ bar ();
+ if (m != 4)
+ __builtin_abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/pr84503-2.c b/gcc/testsuite/gcc.dg/pr84503-2.c
new file mode 100644
index 00000000000..76701f07938
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr84503-2.c
@@ -0,0 +1,5 @@
+/* PR tree-optimization/84503 */
+/* { dg-do run } */
+/* { dg-options "-O3 -fno-tree-vectorize -fno-ivopts" } */
+
+#include "pr84503-1.c"
diff --git a/gcc/testsuite/gcc.dg/torture/pr84417.c b/gcc/testsuite/gcc.dg/torture/pr84417.c
new file mode 100644
index 00000000000..9c2b023254b
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr84417.c
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target int32plus } */
+
+void fn1()
+{
+ __attribute__((__vector_size__(sizeof(double)))) double x;
+ double *a = (double *)&x;
+ *a + *(a + 8446744073709551615LL);
+}
diff --git a/gcc/testsuite/gcc.dg/vect/pr84357.c b/gcc/testsuite/gcc.dg/vect/pr84357.c
new file mode 100644
index 00000000000..cd3cc4a92ed
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/pr84357.c
@@ -0,0 +1,31 @@
+/* { dg-do compile } */
+/* { dg-additional-options "-Wall" } */
+
+#define COUNT 32
+
+typedef struct s1 {
+ unsigned char c;
+} s1;
+
+typedef struct s2
+{
+ char pad;
+ s1 arr[COUNT];
+} s2;
+
+typedef struct s3 {
+ s1 arr[COUNT];
+} s3;
+
+s2 * get_s2();
+s3 * gActiveS3;
+void foo()
+{
+ s3 * three = gActiveS3;
+ s2 * two = get_s2();
+
+ for (int i = 0; i < COUNT; i++)
+ {
+ two->arr[i].c = three->arr[i].c;
+ }
+}
diff --git a/gcc/testsuite/gcc.dg/vect/pr84419.c b/gcc/testsuite/gcc.dg/vect/pr84419.c
new file mode 100644
index 00000000000..4864f8eb934
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/pr84419.c
@@ -0,0 +1,21 @@
+#include <string.h>
+
+#define SIZE 400
+
+int foo[SIZE];
+char bar[SIZE];
+
+void __attribute__ ((noinline)) foo_func(void)
+{
+ int i;
+ for (i = 1; i < SIZE; i++)
+ if (bar[i])
+ foo[i] = 1;
+}
+
+int main()
+{
+ memset(bar, 1, sizeof(bar));
+ foo_func();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/vmx/extract-be-order.c b/gcc/testsuite/gcc.dg/vmx/extract-be-order.c
index 5c09471d99b..f03c356781a 100644
--- a/gcc/testsuite/gcc.dg/vmx/extract-be-order.c
+++ b/gcc/testsuite/gcc.dg/vmx/extract-be-order.c
@@ -1,4 +1,5 @@
-/* { dg-options "-maltivec=be -mabi=altivec -std=gnu99 -mno-vsx" } */
+/* Disable warnings to squelch deprecation message about -maltivec=be. */
+/* { dg-options "-maltivec=be -mabi=altivec -std=gnu99 -mno-vsx -w" } */
#include "harness.h"
diff --git a/gcc/testsuite/gcc.dg/vmx/extract-vsx-be-order.c b/gcc/testsuite/gcc.dg/vmx/extract-vsx-be-order.c
index 8c965f6fd66..509a7b62181 100644
--- a/gcc/testsuite/gcc.dg/vmx/extract-vsx-be-order.c
+++ b/gcc/testsuite/gcc.dg/vmx/extract-vsx-be-order.c
@@ -1,6 +1,7 @@
/* { dg-skip-if "" { powerpc*-*-darwin* } } */
/* { dg-require-effective-target powerpc_vsx_ok } */
-/* { dg-options "-maltivec=be -mabi=altivec -std=gnu99 -mvsx" } */
+/* Disable warnings to squelch deprecation message about -maltivec=be. */
+/* { dg-options "-maltivec=be -mabi=altivec -std=gnu99 -mvsx -w" } */
#include "harness.h"
diff --git a/gcc/testsuite/gcc.dg/vmx/insert-be-order.c b/gcc/testsuite/gcc.dg/vmx/insert-be-order.c
index 592ef28c0fc..7aa28f85b77 100644
--- a/gcc/testsuite/gcc.dg/vmx/insert-be-order.c
+++ b/gcc/testsuite/gcc.dg/vmx/insert-be-order.c
@@ -1,4 +1,5 @@
-/* { dg-options "-maltivec=be -mabi=altivec -std=gnu99 -mno-vsx" } */
+/* Disable warnings to squelch deprecation message about -maltivec=be. */
+/* { dg-options "-w -maltivec=be -mabi=altivec -std=gnu99 -mno-vsx" } */
#include "harness.h"
diff --git a/gcc/testsuite/gcc.dg/vmx/insert-vsx-be-order.c b/gcc/testsuite/gcc.dg/vmx/insert-vsx-be-order.c
index 6cb59dd8a63..569a86606c7 100644
--- a/gcc/testsuite/gcc.dg/vmx/insert-vsx-be-order.c
+++ b/gcc/testsuite/gcc.dg/vmx/insert-vsx-be-order.c
@@ -1,6 +1,7 @@
/* { dg-skip-if "" { powerpc*-*-darwin* } } */
/* { dg-require-effective-target powerpc_vsx_ok } */
-/* { dg-options "-maltivec=be -mabi=altivec -std=gnu99 -mvsx" } */
+/* Disable warnings to squelch deprecation message about -maltivec=be. */
+/* { dg-options "-w -maltivec=be -mabi=altivec -std=gnu99 -mvsx" } */
#include "harness.h"
diff --git a/gcc/testsuite/gcc.dg/vmx/ld-be-order.c b/gcc/testsuite/gcc.dg/vmx/ld-be-order.c
index 903b997c9a3..f7361cfd372 100644
--- a/gcc/testsuite/gcc.dg/vmx/ld-be-order.c
+++ b/gcc/testsuite/gcc.dg/vmx/ld-be-order.c
@@ -1,4 +1,5 @@
-/* { dg-options "-maltivec=be -mabi=altivec -std=gnu99 -mno-vsx" } */
+/* Disable warnings to squelch deprecation message about -maltivec=be. */
+/* { dg-options "-w -maltivec=be -mabi=altivec -std=gnu99 -mno-vsx" } */
#include "harness.h"
diff --git a/gcc/testsuite/gcc.dg/vmx/ld-vsx-be-order.c b/gcc/testsuite/gcc.dg/vmx/ld-vsx-be-order.c
index c870c55e856..f02366756b9 100644
--- a/gcc/testsuite/gcc.dg/vmx/ld-vsx-be-order.c
+++ b/gcc/testsuite/gcc.dg/vmx/ld-vsx-be-order.c
@@ -1,6 +1,7 @@
/* { dg-skip-if "" { powerpc*-*-darwin* } } */
/* { dg-require-effective-target powerpc_vsx_ok } */
-/* { dg-options "-maltivec=be -mabi=altivec -std=gnu99 -mvsx" } */
+/* Disable warnings to squelch deprecation message about -maltivec=be. */
+/* { dg-options "-w -maltivec=be -mabi=altivec -std=gnu99 -mvsx" } */
#include "harness.h"
diff --git a/gcc/testsuite/gcc.dg/vmx/lde-be-order.c b/gcc/testsuite/gcc.dg/vmx/lde-be-order.c
index 9a6d5bae52d..53c3b78a71d 100644
--- a/gcc/testsuite/gcc.dg/vmx/lde-be-order.c
+++ b/gcc/testsuite/gcc.dg/vmx/lde-be-order.c
@@ -1,4 +1,5 @@
-/* { dg-options "-maltivec=be -mabi=altivec -std=gnu99 -mno-vsx" } */
+/* Disable warnings to squelch deprecation message about -maltivec=be. */
+/* { dg-options "-w -maltivec=be -mabi=altivec -std=gnu99 -mno-vsx" } */
#include "harness.h"
diff --git a/gcc/testsuite/gcc.dg/vmx/ldl-be-order.c b/gcc/testsuite/gcc.dg/vmx/ldl-be-order.c
index 397849fe1f5..49ba48b0462 100644
--- a/gcc/testsuite/gcc.dg/vmx/ldl-be-order.c
+++ b/gcc/testsuite/gcc.dg/vmx/ldl-be-order.c
@@ -1,4 +1,5 @@
-/* { dg-options "-maltivec=be -mabi=altivec -std=gnu99 -mno-vsx" } */
+/* Disable warnings to squelch deprecation message about -maltivec=be. */
+/* { dg-options "-w -maltivec=be -mabi=altivec -std=gnu99 -mno-vsx" } */
#include "harness.h"
diff --git a/gcc/testsuite/gcc.dg/vmx/ldl-vsx-be-order.c b/gcc/testsuite/gcc.dg/vmx/ldl-vsx-be-order.c
index 222d1db0d75..edac6764fc2 100644
--- a/gcc/testsuite/gcc.dg/vmx/ldl-vsx-be-order.c
+++ b/gcc/testsuite/gcc.dg/vmx/ldl-vsx-be-order.c
@@ -1,6 +1,7 @@
/* { dg-skip-if "" { powerpc*-*-darwin* } } */
/* { dg-require-effective-target powerpc_vsx_ok } */
-/* { dg-options "-maltivec=be -mabi=altivec -std=gnu99 -mvsx" } */
+/* Disable warnings to squelch deprecation message about -maltivec=be. */
+/* { dg-options "-w -maltivec=be -mabi=altivec -std=gnu99 -mvsx" } */
#include "harness.h"
diff --git a/gcc/testsuite/gcc.dg/vmx/merge-be-order.c b/gcc/testsuite/gcc.dg/vmx/merge-be-order.c
index 2de888fa444..4cc0d4490e5 100644
--- a/gcc/testsuite/gcc.dg/vmx/merge-be-order.c
+++ b/gcc/testsuite/gcc.dg/vmx/merge-be-order.c
@@ -1,4 +1,5 @@
-/* { dg-options "-maltivec=be -mabi=altivec -std=gnu99 -mno-vsx" } */
+/* Disable warnings to squelch deprecation message about -maltivec=be. */
+/* { dg-options "-w -maltivec=be -mabi=altivec -std=gnu99 -mno-vsx" } */
#include "harness.h"
diff --git a/gcc/testsuite/gcc.dg/vmx/merge-vsx-be-order.c b/gcc/testsuite/gcc.dg/vmx/merge-vsx-be-order.c
index b01208d5f40..67193278ae6 100644
--- a/gcc/testsuite/gcc.dg/vmx/merge-vsx-be-order.c
+++ b/gcc/testsuite/gcc.dg/vmx/merge-vsx-be-order.c
@@ -1,6 +1,7 @@
/* { dg-skip-if "" { powerpc*-*-darwin* } } */
/* { dg-require-effective-target powerpc_vsx_ok } */
-/* { dg-options "-maltivec=be -mabi=altivec -std=gnu99 -mvsx" } */
+/* Disable warnings to squelch deprecation message about -maltivec=be. */
+/* { dg-options "-w -maltivec=be -mabi=altivec -std=gnu99 -mvsx" } */
#include "harness.h"
diff --git a/gcc/testsuite/gcc.dg/vmx/mult-even-odd-be-order.c b/gcc/testsuite/gcc.dg/vmx/mult-even-odd-be-order.c
index 6ba12d04634..84a89515b0d 100644
--- a/gcc/testsuite/gcc.dg/vmx/mult-even-odd-be-order.c
+++ b/gcc/testsuite/gcc.dg/vmx/mult-even-odd-be-order.c
@@ -1,4 +1,5 @@
-/* { dg-options "-maltivec=be -mabi=altivec -std=gnu99 -mno-vsx" } */
+/* Disable warnings to squelch deprecation message about -maltivec=be. */
+/* { dg-options "-w -maltivec=be -mabi=altivec -std=gnu99 -mno-vsx" } */
#include "harness.h"
diff --git a/gcc/testsuite/gcc.dg/vmx/pack-be-order.c b/gcc/testsuite/gcc.dg/vmx/pack-be-order.c
index c400fc882dd..3e71b3130a1 100644
--- a/gcc/testsuite/gcc.dg/vmx/pack-be-order.c
+++ b/gcc/testsuite/gcc.dg/vmx/pack-be-order.c
@@ -1,4 +1,5 @@
-/* { dg-options "-maltivec=be -mabi=altivec -std=gnu99 -mno-vsx" } */
+/* Disable warnings to squelch deprecation message about -maltivec=be. */
+/* { dg-options "-w -maltivec=be -mabi=altivec -std=gnu99 -mno-vsx" } */
#include "harness.h"
diff --git a/gcc/testsuite/gcc.dg/vmx/perm-be-order.c b/gcc/testsuite/gcc.dg/vmx/perm-be-order.c
index 604f63dc95f..3a7942840f5 100644
--- a/gcc/testsuite/gcc.dg/vmx/perm-be-order.c
+++ b/gcc/testsuite/gcc.dg/vmx/perm-be-order.c
@@ -1,4 +1,5 @@
-/* { dg-options "-maltivec=be -mabi=altivec -std=gnu99 -mno-vsx" } */
+/* Disable warnings to squelch deprecation message about -maltivec=be. */
+/* { dg-options "-w -maltivec=be -mabi=altivec -std=gnu99 -mno-vsx" } */
#include "harness.h"
diff --git a/gcc/testsuite/gcc.dg/vmx/splat-be-order.c b/gcc/testsuite/gcc.dg/vmx/splat-be-order.c
index e265ae4be20..96d086939ef 100644
--- a/gcc/testsuite/gcc.dg/vmx/splat-be-order.c
+++ b/gcc/testsuite/gcc.dg/vmx/splat-be-order.c
@@ -1,4 +1,5 @@
-/* { dg-options "-maltivec=be -mabi=altivec -std=gnu99 -mno-vsx" } */
+/* Disable warnings to squelch deprecation message about -maltivec=be. */
+/* { dg-options "-w -maltivec=be -mabi=altivec -std=gnu99 -mno-vsx" } */
#include "harness.h"
diff --git a/gcc/testsuite/gcc.dg/vmx/splat-vsx-be-order.c b/gcc/testsuite/gcc.dg/vmx/splat-vsx-be-order.c
index 620a31f7692..e0dca6b5dfb 100644
--- a/gcc/testsuite/gcc.dg/vmx/splat-vsx-be-order.c
+++ b/gcc/testsuite/gcc.dg/vmx/splat-vsx-be-order.c
@@ -1,6 +1,7 @@
/* { dg-skip-if "" { powerpc*-*-darwin* } } */
/* { dg-require-effective-target powerpc_vsx_ok } */
-/* { dg-options "-maltivec=be -mabi=altivec -std=gnu99 -mvsx" } */
+/* Disable warnings to squelch deprecation message about -maltivec=be. */
+/* { dg-options "-w -maltivec=be -mabi=altivec -std=gnu99 -mvsx" } */
#include "harness.h"
diff --git a/gcc/testsuite/gcc.dg/vmx/st-be-order.c b/gcc/testsuite/gcc.dg/vmx/st-be-order.c
index 1a7b01bb5a1..e1cd826665a 100644
--- a/gcc/testsuite/gcc.dg/vmx/st-be-order.c
+++ b/gcc/testsuite/gcc.dg/vmx/st-be-order.c
@@ -1,4 +1,5 @@
-/* { dg-options "-maltivec=be -mabi=altivec -std=gnu99 -mno-vsx" } */
+/* Disable warnings to squelch deprecation message about -maltivec=be. */
+/* { dg-options "-w -maltivec=be -mabi=altivec -std=gnu99 -mno-vsx" } */
#include "harness.h"
diff --git a/gcc/testsuite/gcc.dg/vmx/st-vsx-be-order.c b/gcc/testsuite/gcc.dg/vmx/st-vsx-be-order.c
index 48814462106..1ce8f41552e 100644
--- a/gcc/testsuite/gcc.dg/vmx/st-vsx-be-order.c
+++ b/gcc/testsuite/gcc.dg/vmx/st-vsx-be-order.c
@@ -1,6 +1,7 @@
/* { dg-skip-if "" { powerpc*-*-darwin* } } */
/* { dg-require-effective-target powerpc_vsx_ok } */
-/* { dg-options "-maltivec=be -mabi=altivec -std=gnu99 -mvsx" } */
+/* Disable warnings to squelch deprecation message about -maltivec=be. */
+/* { dg-options "-w -maltivec=be -mabi=altivec -std=gnu99 -mvsx" } */
#include "harness.h"
diff --git a/gcc/testsuite/gcc.dg/vmx/ste-be-order.c b/gcc/testsuite/gcc.dg/vmx/ste-be-order.c
index 75f2004f372..cfc6877af3c 100644
--- a/gcc/testsuite/gcc.dg/vmx/ste-be-order.c
+++ b/gcc/testsuite/gcc.dg/vmx/ste-be-order.c
@@ -1,4 +1,5 @@
-/* { dg-options "-maltivec=be -mabi=altivec -std=gnu99 -mno-vsx" } */
+/* Disable warnings to squelch deprecation message about -maltivec=be. */
+/* { dg-options "-w -maltivec=be -mabi=altivec -std=gnu99 -mno-vsx" } */
#include "harness.h"
diff --git a/gcc/testsuite/gcc.dg/vmx/stl-be-order.c b/gcc/testsuite/gcc.dg/vmx/stl-be-order.c
index 7f00a036499..28fd9e77454 100644
--- a/gcc/testsuite/gcc.dg/vmx/stl-be-order.c
+++ b/gcc/testsuite/gcc.dg/vmx/stl-be-order.c
@@ -1,4 +1,5 @@
-/* { dg-options "-maltivec=be -mabi=altivec -std=gnu99 -mno-vsx" } */
+/* Disable warnings to squelch deprecation message about -maltivec=be. */
+/* { dg-options "-w -maltivec=be -mabi=altivec -std=gnu99 -mno-vsx" } */
#include "harness.h"
diff --git a/gcc/testsuite/gcc.dg/vmx/stl-vsx-be-order.c b/gcc/testsuite/gcc.dg/vmx/stl-vsx-be-order.c
index 65e2f256d06..1abd3edefe9 100644
--- a/gcc/testsuite/gcc.dg/vmx/stl-vsx-be-order.c
+++ b/gcc/testsuite/gcc.dg/vmx/stl-vsx-be-order.c
@@ -1,6 +1,7 @@
/* { dg-skip-if "" { powerpc*-*-darwin* } } */
/* { dg-require-effective-target powerpc_vsx_ok } */
-/* { dg-options "-maltivec=be -mabi=altivec -std=gnu99 -mvsx" } */
+/* Disable warnings to squelch deprecation message about -maltivec=be. */
+/* { dg-options "-w -maltivec=be -mabi=altivec -std=gnu99 -mvsx" } */
#include "harness.h"
diff --git a/gcc/testsuite/gcc.dg/vmx/sum2s-be-order.c b/gcc/testsuite/gcc.dg/vmx/sum2s-be-order.c
index 0981cc1d52b..03c6faa0ca6 100644
--- a/gcc/testsuite/gcc.dg/vmx/sum2s-be-order.c
+++ b/gcc/testsuite/gcc.dg/vmx/sum2s-be-order.c
@@ -1,4 +1,5 @@
-/* { dg-options "-maltivec=be -mabi=altivec -std=gnu99 -mno-vsx" } */
+/* Disable warnings to squelch deprecation message about -maltivec=be. */
+/* { dg-options "-w -maltivec=be -mabi=altivec -std=gnu99 -mno-vsx" } */
#include "harness.h"
diff --git a/gcc/testsuite/gcc.dg/vmx/unpack-be-order.c b/gcc/testsuite/gcc.dg/vmx/unpack-be-order.c
index 6eb98f4cf72..0d65a4fafbb 100644
--- a/gcc/testsuite/gcc.dg/vmx/unpack-be-order.c
+++ b/gcc/testsuite/gcc.dg/vmx/unpack-be-order.c
@@ -1,4 +1,5 @@
-/* { dg-options "-maltivec=be -mabi=altivec -std=gnu99 -mno-vsx -Wno-shift-overflow" } */
+/* Disable warnings to squelch deprecation message about -maltivec=be. */
+/* { dg-options "-w -maltivec=be -mabi=altivec -std=gnu99 -mno-vsx -Wno-shift-overflow" } */
#include "harness.h"
diff --git a/gcc/testsuite/gcc.dg/vmx/vsums-be-order.c b/gcc/testsuite/gcc.dg/vmx/vsums-be-order.c
index e4a34e9f966..1f640e76112 100644
--- a/gcc/testsuite/gcc.dg/vmx/vsums-be-order.c
+++ b/gcc/testsuite/gcc.dg/vmx/vsums-be-order.c
@@ -1,4 +1,5 @@
-/* { dg-options "-maltivec=be -mabi=altivec -std=gnu99 -mno-vsx" } */
+/* Disable warnings to squelch deprecation message about -maltivec=be. */
+/* { dg-options "-w -maltivec=be -mabi=altivec -std=gnu99 -mno-vsx" } */
#include "harness.h"