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/20081223-1.c5
-rw-r--r--gcc/testsuite/gcc.dg/Wstrict-aliasing-bogus-vla-1.c10
-rw-r--r--gcc/testsuite/gcc.dg/autopar/outer-1.c33
-rw-r--r--gcc/testsuite/gcc.dg/autopar/outer-2.c33
-rw-r--r--gcc/testsuite/gcc.dg/autopar/outer-3.c33
-rw-r--r--gcc/testsuite/gcc.dg/autopar/outer-4.c37
-rw-r--r--gcc/testsuite/gcc.dg/autopar/outer-5.c50
-rw-r--r--gcc/testsuite/gcc.dg/autopar/outer-6.c51
-rw-r--r--gcc/testsuite/gcc.dg/cleanup-13.c319
-rw-r--r--gcc/testsuite/gcc.dg/cpp/include6.c14
-rw-r--r--gcc/testsuite/gcc.dg/cpp/separate-1.c4
-rw-r--r--gcc/testsuite/gcc.dg/cpp/spacing1.c1
-rw-r--r--gcc/testsuite/gcc.dg/debug/dwarf2/inline3.c22
-rw-r--r--gcc/testsuite/gcc.dg/debug/dwarf2/pr41445-1.c18
-rw-r--r--gcc/testsuite/gcc.dg/debug/dwarf2/pr41445-2.c9
-rw-r--r--gcc/testsuite/gcc.dg/debug/dwarf2/pr41445-3.c18
-rw-r--r--gcc/testsuite/gcc.dg/debug/dwarf2/pr41445-4.c9
-rw-r--r--gcc/testsuite/gcc.dg/debug/dwarf2/pr41445-5.c14
-rw-r--r--gcc/testsuite/gcc.dg/debug/dwarf2/pr41445-6.c8
-rw-r--r--gcc/testsuite/gcc.dg/debug/dwarf2/pr41543.c14
-rw-r--r--gcc/testsuite/gcc.dg/debug/dwarf2/pr41695.c18
-rw-r--r--gcc/testsuite/gcc.dg/debug/pr41264-1.c36
-rw-r--r--gcc/testsuite/gcc.dg/debug/pr41343-1.c20
-rw-r--r--gcc/testsuite/gcc.dg/debug/pr41717.c10
-rw-r--r--gcc/testsuite/gcc.dg/debug/pr41893-1.c13
-rw-r--r--gcc/testsuite/gcc.dg/debug/pr41893-2.c10
-rw-r--r--gcc/testsuite/gcc.dg/debug/vta-1.c34
-rw-r--r--gcc/testsuite/gcc.dg/debug/vta-2.c21
-rw-r--r--gcc/testsuite/gcc.dg/debug/vta-3.c17
-rw-r--r--gcc/testsuite/gcc.dg/guality/guality.exp77
-rw-r--r--gcc/testsuite/gcc.dg/guality/pr41447-1.c26
-rw-r--r--gcc/testsuite/gcc.dg/guality/pr41616-1.c20
-rw-r--r--gcc/testsuite/gcc.dg/inline-33.c2
-rw-r--r--gcc/testsuite/gcc.dg/ipa/ipa-1.c2
-rw-r--r--gcc/testsuite/gcc.dg/ipa/ipa-2.c2
-rw-r--r--gcc/testsuite/gcc.dg/ipa/ipa-3.c2
-rw-r--r--gcc/testsuite/gcc.dg/ipa/ipa-4.c2
-rw-r--r--gcc/testsuite/gcc.dg/ipa/ipa-5.c2
-rw-r--r--gcc/testsuite/gcc.dg/ipa/ipa-7.c2
-rw-r--r--gcc/testsuite/gcc.dg/ipa/ipacost-2.c2
-rw-r--r--gcc/testsuite/gcc.dg/lto/20080908_0.c16
-rw-r--r--gcc/testsuite/gcc.dg/lto/20080917_0.c29
-rw-r--r--gcc/testsuite/gcc.dg/lto/20080924_0.c9
-rw-r--r--gcc/testsuite/gcc.dg/lto/20081024_0.c26
-rw-r--r--gcc/testsuite/gcc.dg/lto/20081109_0.c3
-rw-r--r--gcc/testsuite/gcc.dg/lto/20081111_0.c11
-rw-r--r--gcc/testsuite/gcc.dg/lto/20081111_1.c7
-rw-r--r--gcc/testsuite/gcc.dg/lto/20081112_0.c14
-rw-r--r--gcc/testsuite/gcc.dg/lto/20081112_1.c13
-rw-r--r--gcc/testsuite/gcc.dg/lto/20081115_0.c32
-rw-r--r--gcc/testsuite/gcc.dg/lto/20081115_1.c11
-rw-r--r--gcc/testsuite/gcc.dg/lto/20081115_2.c5
-rw-r--r--gcc/testsuite/gcc.dg/lto/20081118_0.c28
-rw-r--r--gcc/testsuite/gcc.dg/lto/20081118_1.c13
-rw-r--r--gcc/testsuite/gcc.dg/lto/20081118_2.c11
-rw-r--r--gcc/testsuite/gcc.dg/lto/20081120-1_0.c5
-rw-r--r--gcc/testsuite/gcc.dg/lto/20081120-1_1.c3
-rw-r--r--gcc/testsuite/gcc.dg/lto/20081120-2_0.c3
-rw-r--r--gcc/testsuite/gcc.dg/lto/20081120-2_1.c2
-rw-r--r--gcc/testsuite/gcc.dg/lto/20081125_0.c6
-rw-r--r--gcc/testsuite/gcc.dg/lto/20081125_1.c4
-rw-r--r--gcc/testsuite/gcc.dg/lto/20081126_0.c8
-rw-r--r--gcc/testsuite/gcc.dg/lto/20081201-1_0.c33
-rw-r--r--gcc/testsuite/gcc.dg/lto/20081201-1_1.c13
-rw-r--r--gcc/testsuite/gcc.dg/lto/20081201-1_2.c7
-rw-r--r--gcc/testsuite/gcc.dg/lto/20081201-2_0.c16
-rw-r--r--gcc/testsuite/gcc.dg/lto/20081201-2_1.c5
-rw-r--r--gcc/testsuite/gcc.dg/lto/20081202-1_0.c11
-rw-r--r--gcc/testsuite/gcc.dg/lto/20081202-1_1.c10
-rw-r--r--gcc/testsuite/gcc.dg/lto/20081202-2_0.c13
-rw-r--r--gcc/testsuite/gcc.dg/lto/20081202-2_1.c16
-rw-r--r--gcc/testsuite/gcc.dg/lto/20081204-1_0.c7
-rw-r--r--gcc/testsuite/gcc.dg/lto/20081204-1_1.c5
-rw-r--r--gcc/testsuite/gcc.dg/lto/20081204-2_0.c5
-rw-r--r--gcc/testsuite/gcc.dg/lto/20081210-1_0.c21
-rw-r--r--gcc/testsuite/gcc.dg/lto/20081212-1_0.c4
-rw-r--r--gcc/testsuite/gcc.dg/lto/20081222_0.c11
-rw-r--r--gcc/testsuite/gcc.dg/lto/20081222_0.h1
-rw-r--r--gcc/testsuite/gcc.dg/lto/20081222_1.c16
-rw-r--r--gcc/testsuite/gcc.dg/lto/20081224_0.c9
-rw-r--r--gcc/testsuite/gcc.dg/lto/20081224_0.h3
-rw-r--r--gcc/testsuite/gcc.dg/lto/20081224_1.c2
-rw-r--r--gcc/testsuite/gcc.dg/lto/20090116_0.c12
-rw-r--r--gcc/testsuite/gcc.dg/lto/20090120_0.c14
-rw-r--r--gcc/testsuite/gcc.dg/lto/20090126-1_0.c7
-rw-r--r--gcc/testsuite/gcc.dg/lto/20090126-2_0.c7
-rw-r--r--gcc/testsuite/gcc.dg/lto/20090206-1_0.c10
-rw-r--r--gcc/testsuite/gcc.dg/lto/20090206-2_0.c18
-rw-r--r--gcc/testsuite/gcc.dg/lto/20090210_0.c6
-rw-r--r--gcc/testsuite/gcc.dg/lto/20090210_1.c22
-rw-r--r--gcc/testsuite/gcc.dg/lto/20090213_0.c11
-rw-r--r--gcc/testsuite/gcc.dg/lto/20090213_1.c6
-rw-r--r--gcc/testsuite/gcc.dg/lto/20090218-1_0.c4
-rw-r--r--gcc/testsuite/gcc.dg/lto/20090218-1_1.c9
-rw-r--r--gcc/testsuite/gcc.dg/lto/20090218-2_0.c3
-rw-r--r--gcc/testsuite/gcc.dg/lto/20090218-2_1.c19
-rw-r--r--gcc/testsuite/gcc.dg/lto/20090218_0.c7
-rw-r--r--gcc/testsuite/gcc.dg/lto/20090218_1.c6
-rw-r--r--gcc/testsuite/gcc.dg/lto/20090218_2.c6
-rw-r--r--gcc/testsuite/gcc.dg/lto/20090218_3.c3
-rw-r--r--gcc/testsuite/gcc.dg/lto/20090219_0.c28
-rw-r--r--gcc/testsuite/gcc.dg/lto/20090312_0.c43
-rw-r--r--gcc/testsuite/gcc.dg/lto/20090312_1.c9
-rw-r--r--gcc/testsuite/gcc.dg/lto/20090313_0.c9
-rw-r--r--gcc/testsuite/gcc.dg/lto/20090706-1_0.c42
-rw-r--r--gcc/testsuite/gcc.dg/lto/20090706-2_0.c16
-rw-r--r--gcc/testsuite/gcc.dg/lto/20090717_0.c4
-rw-r--r--gcc/testsuite/gcc.dg/lto/20090717_1.c11
-rw-r--r--gcc/testsuite/gcc.dg/lto/20090729_0.c4
-rw-r--r--gcc/testsuite/gcc.dg/lto/20090729_1.c4
-rw-r--r--gcc/testsuite/gcc.dg/lto/20090812_0.c11
-rw-r--r--gcc/testsuite/gcc.dg/lto/20090812_1.c26
-rw-r--r--gcc/testsuite/gcc.dg/lto/20090914-1_0.c13
-rw-r--r--gcc/testsuite/gcc.dg/lto/20090914-2_0.c12
-rw-r--r--gcc/testsuite/gcc.dg/lto/20091005-1_0.c3
-rw-r--r--gcc/testsuite/gcc.dg/lto/20091005-1_1.c2
-rw-r--r--gcc/testsuite/gcc.dg/lto/20091005-2_0.c11
-rw-r--r--gcc/testsuite/gcc.dg/lto/20091006-1_0.c14
-rw-r--r--gcc/testsuite/gcc.dg/lto/20091006-1_1.c2
-rw-r--r--gcc/testsuite/gcc.dg/lto/20091006-2_0.c4
-rw-r--r--gcc/testsuite/gcc.dg/lto/20091006-2_1.c1
-rw-r--r--gcc/testsuite/gcc.dg/lto/20091006-2_2.c1
-rw-r--r--gcc/testsuite/gcc.dg/lto/20091013-1_0.c21
-rw-r--r--gcc/testsuite/gcc.dg/lto/20091013-1_1.c111
-rw-r--r--gcc/testsuite/gcc.dg/lto/20091013-1_2.c220
-rw-r--r--gcc/testsuite/gcc.dg/lto/20091014-1_0.c4
-rw-r--r--gcc/testsuite/gcc.dg/lto/20091015-1_0.c5
-rw-r--r--gcc/testsuite/gcc.dg/lto/20091015-1_1.c4
-rw-r--r--gcc/testsuite/gcc.dg/lto/20091015-1_2.c5
-rw-r--r--gcc/testsuite/gcc.dg/lto/20091015-1_a.h2
-rw-r--r--gcc/testsuite/gcc.dg/lto/20091015-1_b.h2
-rw-r--r--gcc/testsuite/gcc.dg/lto/20091016-1_0.c13
-rw-r--r--gcc/testsuite/gcc.dg/lto/20091016-1_1.c18
-rw-r--r--gcc/testsuite/gcc.dg/lto/20091016-1_a.h6
-rw-r--r--gcc/testsuite/gcc.dg/lto/20091017-1_0.c15
-rw-r--r--gcc/testsuite/gcc.dg/lto/20091017-1_1.c6
-rw-r--r--gcc/testsuite/gcc.dg/lto/20091020-1_0.c8
-rw-r--r--gcc/testsuite/gcc.dg/lto/20091020-1_1.c15
-rw-r--r--gcc/testsuite/gcc.dg/lto/20091020-2_0.c18
-rw-r--r--gcc/testsuite/gcc.dg/lto/20091020-2_1.c5
-rw-r--r--gcc/testsuite/gcc.dg/lto/20091020-3_0.c20
-rw-r--r--gcc/testsuite/gcc.dg/lto/20091027-1_0.c11
-rw-r--r--gcc/testsuite/gcc.dg/lto/20091027-1_1.c9
-rw-r--r--gcc/testsuite/gcc.dg/lto/README35
-rw-r--r--gcc/testsuite/gcc.dg/lto/lto.exp57
-rw-r--r--gcc/testsuite/gcc.dg/noncompile/pr40033-1.c7
-rw-r--r--gcc/testsuite/gcc.dg/plugin/one_time_plugin.c6
-rw-r--r--gcc/testsuite/gcc.dg/plugin/selfassign.c2
-rw-r--r--gcc/testsuite/gcc.dg/pr41340.c68
-rw-r--r--gcc/testsuite/gcc.dg/pr41345.c14
-rw-r--r--gcc/testsuite/gcc.dg/pr41573.c15
-rw-r--r--gcc/testsuite/gcc.dg/pr41574.c15
-rw-r--r--gcc/testsuite/gcc.dg/pr41762.c31
-rw-r--r--gcc/testsuite/gcc.dg/pr41783.c20
-rw-r--r--gcc/testsuite/gcc.dg/pr41837.c38
-rw-r--r--gcc/testsuite/gcc.dg/pr41841.c22
-rw-r--r--gcc/testsuite/gcc.dg/pr41842.c8
-rw-r--r--gcc/testsuite/gcc.dg/pr41935.c25
-rw-r--r--gcc/testsuite/gcc.dg/pr41963.c36
-rw-r--r--gcc/testsuite/gcc.dg/raw-string-1.c101
-rw-r--r--gcc/testsuite/gcc.dg/raw-string-2.c109
-rw-r--r--gcc/testsuite/gcc.dg/raw-string-3.c53
-rw-r--r--gcc/testsuite/gcc.dg/raw-string-4.c28
-rw-r--r--gcc/testsuite/gcc.dg/raw-string-5.c23
-rw-r--r--gcc/testsuite/gcc.dg/raw-string-6.c5
-rw-r--r--gcc/testsuite/gcc.dg/raw-string-7.c23
-rw-r--r--gcc/testsuite/gcc.dg/tls/pie-1.c6
-rw-r--r--gcc/testsuite/gcc.dg/torture/builtin-math-6.c49
-rw-r--r--gcc/testsuite/gcc.dg/torture/ipa-pta-1.c26
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr23821.c29
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr26515.c27
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr38948.c101
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr41555.c119
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/foldstring-1.c6
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/inline-3.c3
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/ipa-cp-1.c30
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/local-pure-const.c3
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/pr41497.c27
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/restrict-1.c20
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/restrict-2.c14
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/restrict-4.c19
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-23.c2
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-24.c9
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-26.c27
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/useless-1.c6
-rw-r--r--gcc/testsuite/gcc.dg/utf-badconcat2.c15
-rw-r--r--gcc/testsuite/gcc.dg/utf-dflt2.c12
-rw-r--r--gcc/testsuite/gcc.dg/utf8-1.c45
-rw-r--r--gcc/testsuite/gcc.dg/utf8-2.c26
-rw-r--r--gcc/testsuite/gcc.dg/vect/costmodel/i386/costmodel-vect-31.c6
-rw-r--r--gcc/testsuite/gcc.dg/vect/costmodel/i386/costmodel-vect-33.c2
-rw-r--r--gcc/testsuite/gcc.dg/vect/costmodel/x86_64/costmodel-vect-31.c5
-rw-r--r--gcc/testsuite/gcc.dg/vect/costmodel/x86_64/costmodel-vect-33.c2
-rw-r--r--gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-31.c5
-rw-r--r--gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-64.c5
-rw-r--r--gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-66.c5
-rw-r--r--gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-68.c5
-rw-r--r--gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-69.c5
-rw-r--r--gcc/testsuite/gcc.dg/vect/slp-25.c5
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-109.c2
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-26.c6
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-28.c4
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-33.c4
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-42.c4
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-44.c5
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-50.c6
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-54.c5
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-56.c2
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-58.c5
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-60.c2
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-70.c5
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-87.c5
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-88.c5
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-89.c5
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-91.c3
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-92.c5
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-93.c5
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-95.c5
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-96.c2
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-multitypes-1.c8
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-multitypes-3.c2
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-multitypes-4.c4
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-multitypes-6.c2
223 files changed, 3668 insertions, 285 deletions
diff --git a/gcc/testsuite/gcc.dg/20081223-1.c b/gcc/testsuite/gcc.dg/20081223-1.c
new file mode 100644
index 00000000000..3c36955c9e3
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/20081223-1.c
@@ -0,0 +1,5 @@
+/* { dg-do compile } */
+/* { dg-options "-fwhopr" { target lto } } */
+
+typedef struct foo_ foo_t;
+foo_t bar; /* { dg-error "storage size of 'bar' isn't known" } */
diff --git a/gcc/testsuite/gcc.dg/Wstrict-aliasing-bogus-vla-1.c b/gcc/testsuite/gcc.dg/Wstrict-aliasing-bogus-vla-1.c
new file mode 100644
index 00000000000..e9f63d36872
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/Wstrict-aliasing-bogus-vla-1.c
@@ -0,0 +1,10 @@
+/* PR 41673: bogus -Wstrict-aliasing warning from VLA dereference. */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99 -O2 -Wall" } */
+
+int main(int argc, char *argv[])
+{
+ float x[argc];
+ float y[argc];
+ return 0 == __builtin_memcpy(y, x, argc * sizeof(*x));
+}
diff --git a/gcc/testsuite/gcc.dg/autopar/outer-1.c b/gcc/testsuite/gcc.dg/autopar/outer-1.c
new file mode 100644
index 00000000000..913d390f684
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/autopar/outer-1.c
@@ -0,0 +1,33 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-parallelize-loops=4 -fdump-tree-parloops-details -fdump-tree-optimized" } */
+
+void abort (void);
+
+void parloop (int N)
+{
+ int i, j;
+ int x[10000][10000];
+
+ for (i = 0; i < N; i++)
+ for (j = 0; j < N; j++)
+ x[i][j] = i + j + 3;
+
+ for (i = 0; i < N; i++)
+ for (j = 0; j < N; j++)
+ if (x[i][j] != i + j + 3)
+ abort ();
+}
+
+int main(void)
+{
+ parloop(10000);
+
+ return 0;
+}
+
+
+/* Check that outer loop is parallelized. */
+/* { dg-final { scan-tree-dump-times "parallelizing outer loop" 1 "parloops" } } */
+/* { dg-final { scan-tree-dump-times "loopfn" 5 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "parloops" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc/testsuite/gcc.dg/autopar/outer-2.c b/gcc/testsuite/gcc.dg/autopar/outer-2.c
new file mode 100644
index 00000000000..351b3499e89
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/autopar/outer-2.c
@@ -0,0 +1,33 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-parallelize-loops=4 -fdump-tree-parloops-details -fdump-tree-optimized" } */
+
+void abort (void);
+
+void parloop (int N)
+{
+ int i, j,ii;
+ int x[400][10][400];
+
+for (ii = 0; ii < N; ii++)
+ for (i = 0; i < N; i++)
+ for (j = 0; j < N; j++)
+ x[i][j][ii] = ii+i + j + 3;
+
+for (ii = 0; ii < N; ii++)
+ for (i = 0; i < N;i++)
+ for (j = 0; j < N; j++)
+ if (x[i][j][ii] != ii+i + j + 3)
+ abort ();
+}
+
+int main(void)
+{
+ parloop(400);
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "parallelizing outer loop" 1 "parloops" } } */
+/* { dg-final { scan-tree-dump-times "loopfn" 5 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "parloops" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc/testsuite/gcc.dg/autopar/outer-3.c b/gcc/testsuite/gcc.dg/autopar/outer-3.c
new file mode 100644
index 00000000000..2f1033f9830
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/autopar/outer-3.c
@@ -0,0 +1,33 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-parallelize-loops=4 -fdump-tree-parloops-details -fdump-tree-optimized" } */
+
+void abort (void);
+
+void parloop (int N)
+{
+ int i, j;
+ int x[500][500];
+
+ for (i = 0; i < N; i++)
+ for (j = 0; j < i; j++)
+ x[i][j] = i + j + 3;
+
+ for (i = 0; i < N; i++)
+ for (j = 0; j < i; j++)
+ if (x[i][j] != i + j + 3)
+ abort ();
+}
+
+int main(void)
+{
+ parloop(500);
+
+ return 0;
+}
+
+
+/* Check that outer loop is parallelized. */
+/* { dg-final { scan-tree-dump-times "parallelizing outer loop" 1 "parloops" } } */
+/* { dg-final { scan-tree-dump-times "loopfn" 5 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "parloops" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc/testsuite/gcc.dg/autopar/outer-4.c b/gcc/testsuite/gcc.dg/autopar/outer-4.c
new file mode 100644
index 00000000000..56f6123385d
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/autopar/outer-4.c
@@ -0,0 +1,37 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-parallelize-loops=4 -fdump-tree-parloops-details -fdump-tree-optimized" } */
+
+void abort (void);
+
+int g_sum=0;
+int x[500][500];
+
+__attribute__((noinline))
+void parloop (int N)
+{
+ int i, j;
+ int sum;
+
+ /* Double reduction is currently not supported, outer loop is not
+ parallelized. Inner reduction is detected, inner loop is
+ parallelized. */
+ sum = 0;
+ for (i = 0; i < N; i++)
+ for (j = 0; j < N; j++)
+ sum += x[i][j];
+
+ g_sum = sum;
+}
+
+int main(void)
+{
+ parloop(500);
+
+ return 0;
+}
+
+
+/* { dg-final { scan-tree-dump-times "parallelizing outer loop" 1 "parloops" { xfail *-*-* } } } */
+/* { dg-final { scan-tree-dump-times "loopfn" 5 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "parloops" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc/testsuite/gcc.dg/autopar/outer-5.c b/gcc/testsuite/gcc.dg/autopar/outer-5.c
new file mode 100644
index 00000000000..3a542988c26
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/autopar/outer-5.c
@@ -0,0 +1,50 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-parallelize-loops=4 -fdump-tree-parloops-details -fdump-tree-optimized" } */
+
+void abort (void);
+
+int x[500][500];
+int y[500];
+int g_sum=0;
+
+__attribute__((noinline))
+void init (int i, int j)
+{
+ x[i][j]=1;
+}
+
+__attribute__((noinline))
+void parloop (int N)
+{
+ int i, j;
+ int sum;
+
+ /* Inner cycle is currently not supported, outer loop is not
+ parallelized. Inner reduction is detected, inner loop is
+ parallelized. */
+ for (i = 0; i < N; i++)
+ {
+ sum = 0;
+ for (j = 0; j < N; j++)
+ sum += x[i][j];
+ y[i]=sum;
+ }
+ g_sum = sum;
+}
+
+int main(void)
+{
+ int i,j;
+ for (i = 0; i < 500; i++)
+ for (j = 0; j < 500; j++)
+ init(i, j);
+
+ parloop(500);
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "parallelizing outer loop" 1 "parloops" { xfail *-*-* } } } */
+/* { dg-final { scan-tree-dump-times "loopfn" 5 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "parloops" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc/testsuite/gcc.dg/autopar/outer-6.c b/gcc/testsuite/gcc.dg/autopar/outer-6.c
new file mode 100644
index 00000000000..6e027d2f69a
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/autopar/outer-6.c
@@ -0,0 +1,51 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-parallelize-loops=4 -fdump-tree-parloops-details -fdump-tree-optimized" } */
+
+void abort (void);
+
+int x[500][500];
+int y[500];
+int g_sum=0;
+
+__attribute__((noinline))
+void init (int i, int j)
+{
+ x[i][j]=1;
+}
+
+__attribute__((noinline))
+void parloop (int N)
+{
+ int i, j;
+ int sum;
+
+ /* Outer loop reduction, outerloop is parallelized. */
+ sum=0;
+ for (i = 0; i < N; i++)
+ {
+ for (j = 0; j < N; j++)
+ y[i]=x[i][j];
+ sum += y[i];
+ }
+ g_sum = sum;
+}
+
+int main(void)
+{
+ int i,j;
+ for (i = 0; i < 500; i++)
+ for (j = 0; j < 500; j++)
+ init(i, j);
+
+ parloop(500);
+
+ return 0;
+}
+
+
+/* Check that outer loop is parallelized. */
+/* { dg-final { scan-tree-dump-times "parallelizing outer loop" 1 "parloops" } } */
+/* { dg-final { scan-tree-dump-times "parallelizing inner loop" 0 "parloops" } } */
+/* { dg-final { scan-tree-dump-times "loopfn" 5 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "parloops" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc/testsuite/gcc.dg/cleanup-13.c b/gcc/testsuite/gcc.dg/cleanup-13.c
new file mode 100644
index 00000000000..0a5a9e9153e
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/cleanup-13.c
@@ -0,0 +1,319 @@
+/* HP-UX libunwind.so doesn't provide _UA_END_OF_STACK */
+/* { dg-do run } */
+/* { dg-options "-fexceptions" } */
+/* { dg-skip-if "" { "ia64-*-hpux11.*" } { "*" } { "" } } */
+/* Verify DW_OP_* handling in the unwinder. */
+
+#include <unwind.h>
+#include <stdlib.h>
+#include <string.h>
+
+/* #define OP_addr(x) 0x06, ... */
+#define OP_deref 0x06,
+#define SLEB128(x) (x)&0x7f /* Assume here the value is -0x40 ... 0x3f. */
+#define ULEB128(x) (x)&0x7f /* Assume here the value is 0 ... 0x7f. */
+#define VAL1(x) (x)&0xff
+#if defined (__BIG_ENDIAN__)
+#define VAL2(x) ((x)>>8)&0xff,(x)&0xff
+#define VAL4(x) ((x)>>24)&0xff,((x)>>16)&0xff,((x)>>8)&0xff,(x)&0xff
+#define VAL8(x) ((x)>>56)&0xff,((x)>>48)&0xff,((x)>>40)&0xff,((x)>>32)&0xff,((x)>>24)&0xff,((x)>>16)&0xff,((x)>>8)&0xff,(x)&0xff
+#elif defined(__LITTLE_ENDIAN__) || defined(__x86_64__) || defined(__i386__)
+#define VAL2(x) (x)&0xff,((x)>>8)&0xff
+#define VAL4(x) (x)&0xff,((x)>>8)&0xff,((x)>>16)&0xff,((x)>>24)&0xff
+#define VAL8(x) (x)&0xff,((x)>>8)&0xff,((x)>>16)&0xff,((x)>>24)&0xff,((x)>>32)&0xff,((x)>>40)&0xff,((x)>>48)&0xff,((x)>>56)&0xff
+#endif
+#define OP_const1u(x) 0x08,VAL1(x),
+#define OP_const1s(x) 0x09,VAL1(x),
+#define OP_const2u(x) 0x0a,VAL2(x),
+#define OP_const2s(x) 0x0b,VAL2(x),
+#define OP_const4u(x) 0x0c,VAL4(x),
+#define OP_const4s(x) 0x0d,VAL4(x),
+#define OP_const8u(x) 0x0e,VAL8(x),
+#define OP_const8s(x) 0x0f,VAL8(x),
+#define OP_constu(x) 0x10,ULEB128(x),
+#define OP_consts(x) 0x11,SLEB128(x),
+#define OP_dup 0x12,
+#define OP_drop 0x13,
+#define OP_over 0x14,
+#define OP_pick(x) 0x15,VAL1(x),
+#define OP_swap 0x16,
+#define OP_rot 0x17,
+#define OP_xderef 0x18,
+#define OP_abs 0x19,
+#define OP_and 0x1a,
+#define OP_div 0x1b,
+#define OP_minus 0x1c,
+#define OP_mod 0x1d,
+#define OP_mul 0x1e,
+#define OP_neg 0x1f,
+#define OP_not 0x20,
+#define OP_or 0x21,
+#define OP_plus 0x22,
+#define OP_plus_uconst(x) 0x23,ULEB128(x),
+#define OP_shl 0x24,
+#define OP_shr 0x25,
+#define OP_shra 0x26,
+#define OP_xor 0x27,
+#define OP_bra(x) 0x28,VAL2(x),
+#define OP_eq 0x29,
+#define OP_ge 0x2a,
+#define OP_gt 0x2b,
+#define OP_le 0x2c,
+#define OP_lt 0x2d,
+#define OP_ne 0x2e,
+#define OP_skip(x) 0x2f,VAL2(x),
+#define OP_lit0 0x30,
+#define OP_lit1 0x31,
+#define OP_lit2 0x32,
+#define OP_lit3 0x33,
+#define OP_lit4 0x34,
+#define OP_lit5 0x35,
+#define OP_lit6 0x36,
+#define OP_lit7 0x37,
+#define OP_lit8 0x38,
+#define OP_lit9 0x39,
+#define OP_lit10 0x3a,
+#define OP_lit11 0x3b,
+#define OP_lit12 0x3c,
+#define OP_lit13 0x3d,
+#define OP_lit14 0x3e,
+#define OP_lit15 0x3f,
+#define OP_lit16 0x40,
+#define OP_lit17 0x41,
+#define OP_lit18 0x42,
+#define OP_lit19 0x43,
+#define OP_lit20 0x44,
+#define OP_lit21 0x45,
+#define OP_lit22 0x46,
+#define OP_lit23 0x47,
+#define OP_lit24 0x48,
+#define OP_lit25 0x49,
+#define OP_lit26 0x4a,
+#define OP_lit27 0x4b,
+#define OP_lit28 0x4c,
+#define OP_lit29 0x4d,
+#define OP_lit30 0x4e,
+#define OP_lit31 0x4f,
+#define OP_reg0 0x50,
+#define OP_reg1 0x51,
+#define OP_reg2 0x52,
+#define OP_reg3 0x53,
+#define OP_reg4 0x54,
+#define OP_reg5 0x55,
+#define OP_reg6 0x56,
+#define OP_reg7 0x57,
+#define OP_reg8 0x58,
+#define OP_reg9 0x59,
+#define OP_reg10 0x5a,
+#define OP_reg11 0x5b,
+#define OP_reg12 0x5c,
+#define OP_reg13 0x5d,
+#define OP_reg14 0x5e,
+#define OP_reg15 0x5f,
+#define OP_reg16 0x60,
+#define OP_reg17 0x61,
+#define OP_reg18 0x62,
+#define OP_reg19 0x63,
+#define OP_reg20 0x64,
+#define OP_reg21 0x65,
+#define OP_reg22 0x66,
+#define OP_reg23 0x67,
+#define OP_reg24 0x68,
+#define OP_reg25 0x69,
+#define OP_reg26 0x6a,
+#define OP_reg27 0x6b,
+#define OP_reg28 0x6c,
+#define OP_reg29 0x6d,
+#define OP_reg30 0x6e,
+#define OP_reg31 0x6f,
+#define OP_breg0(x) 0x70,SLEB128(x),
+#define OP_breg1(x) 0x71,SLEB128(x),
+#define OP_breg2(x) 0x72,SLEB128(x),
+#define OP_breg3(x) 0x73,SLEB128(x),
+#define OP_breg4(x) 0x74,SLEB128(x),
+#define OP_breg5(x) 0x75,SLEB128(x),
+#define OP_breg6(x) 0x76,SLEB128(x),
+#define OP_breg7(x) 0x77,SLEB128(x),
+#define OP_breg8(x) 0x78,SLEB128(x),
+#define OP_breg9(x) 0x79,SLEB128(x),
+#define OP_breg10(x) 0x7a,SLEB128(x),
+#define OP_breg11(x) 0x7b,SLEB128(x),
+#define OP_breg12(x) 0x7c,SLEB128(x),
+#define OP_breg13(x) 0x7d,SLEB128(x),
+#define OP_breg14(x) 0x7e,SLEB128(x),
+#define OP_breg15(x) 0x7f,SLEB128(x),
+#define OP_breg16(x) 0x80,SLEB128(x),
+#define OP_breg17(x) 0x81,SLEB128(x),
+#define OP_breg18(x) 0x82,SLEB128(x),
+#define OP_breg19(x) 0x83,SLEB128(x),
+#define OP_breg20(x) 0x84,SLEB128(x),
+#define OP_breg21(x) 0x85,SLEB128(x),
+#define OP_breg22(x) 0x86,SLEB128(x),
+#define OP_breg23(x) 0x87,SLEB128(x),
+#define OP_breg24(x) 0x88,SLEB128(x),
+#define OP_breg25(x) 0x89,SLEB128(x),
+#define OP_breg26(x) 0x8a,SLEB128(x),
+#define OP_breg27(x) 0x8b,SLEB128(x),
+#define OP_breg28(x) 0x8c,SLEB128(x),
+#define OP_breg29(x) 0x8d,SLEB128(x),
+#define OP_breg30(x) 0x8e,SLEB128(x),
+#define OP_breg31(x) 0x8f,SLEB128(x),
+#define OP_regx(x) 0x90,SLEB128(x),
+#define OP_fbreg(x) 0x91,SLEB128(x),
+#define OP_bregx(x,y) 0x92,ULEB128(x),SLEB128(y),
+#define OP_piece(x) 0x93,ULEB128(x),
+#define OP_deref_size(x) 0x94,VAL1(x),
+#define OP_xderef_size(x) 0x95,VAL1(x),
+#define OP_nop 0x96,
+#define OP_nop_termination 0x96
+#define OP_push_object_address 0x97,
+#define OP_call2(x) 0x98,VAL2(x),
+#define OP_call4(x) 0x99,VAL4(x),
+/* #define OP_call_ref(x) 0x9a,... */
+#define OP_form_tls_address(x) 0x9b,
+#define OP_call_frame_cfa 0x9c,
+#define OP_bit_piece(x) 0x9d,ULEB128(x),
+/* #define OP_implicit_value(x...) 0x9e,... */
+#define OP_stack_value 0x9f,
+#define OP_GNU_push_tls_address 0xe0,
+/* #define OP_GNU_encoded_addr(x...) 0xf1, */
+
+#define ASSERT_TOS_NON0 OP_bra(3) OP_skip(-3)
+#define ASSERT_TOS_0 OP_lit0 OP_eq ASSERT_TOS_NON0
+
+/* Initially there is CFA value on the stack, we want to
+ keep it there at the end. */
+#define CFI_PROGRAM \
+OP_lit0 OP_nop ASSERT_TOS_0 \
+OP_lit1 ASSERT_TOS_NON0 \
+OP_lit1 OP_const1u(1) OP_eq ASSERT_TOS_NON0 \
+OP_lit16 OP_const2u(16) OP_eq ASSERT_TOS_NON0 \
+OP_lit31 OP_const4u(31) OP_ne ASSERT_TOS_0 \
+OP_lit1 OP_neg OP_const1s(-1) OP_eq ASSERT_TOS_NON0 \
+OP_lit16 OP_neg OP_const2s(-16) OP_ne ASSERT_TOS_0 \
+OP_lit31 OP_const4s(-31) OP_neg OP_ne ASSERT_TOS_0 \
+OP_lit7 OP_dup OP_plus_uconst(2) OP_lit9 OP_eq ASSERT_TOS_NON0 \
+ OP_lit7 OP_eq ASSERT_TOS_NON0 \
+OP_lit20 OP_lit1 OP_drop OP_lit20 OP_eq ASSERT_TOS_NON0 \
+OP_lit17 OP_lit19 OP_over OP_lit17 OP_eq ASSERT_TOS_NON0 \
+ OP_lit19 OP_eq ASSERT_TOS_NON0 OP_lit17 OP_eq ASSERT_TOS_NON0 \
+OP_lit1 OP_lit2 OP_lit3 OP_lit4 OP_pick(2) OP_lit2 OP_eq ASSERT_TOS_NON0\
+ OP_lit4 OP_eq ASSERT_TOS_NON0 OP_lit3 OP_eq ASSERT_TOS_NON0 \
+ OP_pick(0) OP_lit2 OP_eq ASSERT_TOS_NON0 \
+ OP_lit2 OP_eq ASSERT_TOS_NON0 OP_lit1 OP_eq ASSERT_TOS_NON0 \
+OP_lit6 OP_lit12 OP_swap OP_lit6 OP_eq ASSERT_TOS_NON0 \
+ OP_lit12 OP_eq ASSERT_TOS_NON0 \
+OP_lit7 OP_lit8 OP_lit9 OP_rot OP_lit8 OP_eq ASSERT_TOS_NON0 \
+ OP_lit7 OP_eq ASSERT_TOS_NON0 OP_lit9 OP_eq ASSERT_TOS_NON0 \
+OP_lit7 OP_abs OP_lit7 OP_eq ASSERT_TOS_NON0 \
+OP_const1s(-123) OP_abs OP_const1u(123) OP_eq ASSERT_TOS_NON0 \
+OP_lit3 OP_lit6 OP_and OP_lit2 OP_eq ASSERT_TOS_NON0 \
+OP_lit3 OP_lit6 OP_or OP_lit7 OP_eq ASSERT_TOS_NON0 \
+OP_lit17 OP_lit2 OP_minus OP_lit15 OP_eq ASSERT_TOS_NON0 \
+OP_const1s(-6) OP_const1s(-2) OP_div OP_lit3 OP_eq ASSERT_TOS_NON0 \
+OP_const1s(-6) OP_const1s(-4) OP_mod OP_const1s(-2) \
+ OP_eq ASSERT_TOS_NON0 \
+OP_lit16 OP_lit31 OP_plus_uconst(1) OP_mul OP_const2u(512) \
+ OP_eq ASSERT_TOS_NON0 \
+OP_lit5 OP_not OP_lit31 OP_and OP_lit26 OP_eq ASSERT_TOS_NON0 \
+OP_lit12 OP_lit31 OP_plus OP_const1u(43) OP_eq ASSERT_TOS_NON0 \
+OP_const1s(-6) OP_lit2 OP_plus OP_const1s(-4) OP_eq ASSERT_TOS_NON0 \
+OP_const1s(-6) OP_plus_uconst(3) OP_const1s(-3) OP_eq ASSERT_TOS_NON0 \
+OP_lit16 OP_lit4 OP_shl OP_const2u(256) OP_eq ASSERT_TOS_NON0 \
+OP_lit16 OP_lit3 OP_shr OP_lit2 OP_eq ASSERT_TOS_NON0 \
+OP_const1s(-16) OP_lit3 OP_shra OP_const1s(-2) OP_eq ASSERT_TOS_NON0 \
+OP_lit3 OP_lit6 OP_xor OP_lit5 OP_eq ASSERT_TOS_NON0 \
+OP_lit3 OP_lit6 OP_le ASSERT_TOS_NON0 \
+OP_lit3 OP_lit3 OP_le ASSERT_TOS_NON0 \
+OP_lit6 OP_lit3 OP_le ASSERT_TOS_0 \
+OP_lit3 OP_lit6 OP_lt ASSERT_TOS_NON0 \
+OP_lit3 OP_lit3 OP_lt ASSERT_TOS_0 \
+OP_lit6 OP_lit3 OP_lt ASSERT_TOS_0 \
+OP_lit3 OP_lit6 OP_ge ASSERT_TOS_0 \
+OP_lit3 OP_lit3 OP_ge ASSERT_TOS_NON0 \
+OP_lit6 OP_lit3 OP_ge ASSERT_TOS_NON0 \
+OP_lit3 OP_lit6 OP_gt ASSERT_TOS_0 \
+OP_lit3 OP_lit3 OP_gt ASSERT_TOS_0 \
+OP_lit6 OP_lit3 OP_gt ASSERT_TOS_NON0 \
+OP_const1s(-6) OP_lit1 OP_shr OP_lit0 OP_gt ASSERT_TOS_NON0 \
+OP_const1s(-6) OP_lit1 OP_shra OP_lit0 OP_lt ASSERT_TOS_NON0
+
+#define CFI_ESCAPE_VAL_2(VALUES...) #VALUES
+#define CFI_ESCAPE_VAL_1(VALUES...) CFI_ESCAPE_VAL_2(VALUES)
+#define CFI_ESCAPE_VAL(VALUES...) CFI_ESCAPE_VAL_1(VALUES)
+#define CFI_ESCAPE do { } while (0)
+#define CFI_ARCH_PROGRAM OP_nop_termination
+#ifdef __GCC_HAVE_DWARF2_CFI_ASM
+#if defined (__x86_64__)
+#undef CFI_ESCAPE
+#undef CFI_ARCH_PROGRAM
+#define CFI_ARCH_PROGRAM CFI_PROGRAM OP_lit8 OP_minus OP_nop_termination
+unsigned char cfi_arch_program[] = { CFI_ARCH_PROGRAM };
+extern char verify_it[sizeof (cfi_arch_program) - 0x80 < 0x3f80 ? 1 : -1];
+/* DW_CFA_expression %rip, uleb128(l2-l1), l1: program DW_OP_lit8 DW_OP_minus DW_OP_nop l2: */
+#define CFI_ESCAPE \
+ asm volatile (".cfi_escape 0x10, 0x10, (%P0&0x7f)+0x80, %P0>>7, " \
+ CFI_ESCAPE_VAL (CFI_ARCH_PROGRAM) \
+ : : "i" (sizeof (cfi_arch_program)))
+#elif defined (__i386__)
+#undef CFI_ESCAPE
+#undef CFI_ARCH_PROGRAM
+#define CFI_ARCH_PROGRAM CFI_PROGRAM OP_lit4 OP_minus OP_nop_termination
+unsigned char cfi_arch_program[] = { CFI_ARCH_PROGRAM };
+extern char verify_it[sizeof (cfi_arch_program) - 0x80 < 0x3f80 ? 1 : -1];
+/* DW_CFA_expression %eip, uleb128(l2-l1), l1: program DW_OP_lit4 DW_OP_minus DW_OP_nop l2: */
+#define CFI_ESCAPE \
+ asm volatile (".cfi_escape 0x10, 8, (%P0&0x7f)+0x80, %P0>>7, " \
+ CFI_ESCAPE_VAL (CFI_ARCH_PROGRAM) \
+ : : "i" (sizeof (cfi_arch_program)))
+#endif
+#endif
+static _Unwind_Reason_Code
+force_unwind_stop (int version, _Unwind_Action actions,
+ _Unwind_Exception_Class exc_class,
+ struct _Unwind_Exception *exc_obj,
+ struct _Unwind_Context *context,
+ void *stop_parameter)
+{
+ if (actions & _UA_END_OF_STACK)
+ abort ();
+ return _URC_NO_REASON;
+}
+
+static void force_unwind ()
+{
+ struct _Unwind_Exception *exc = malloc (sizeof (*exc));
+ memset (&exc->exception_class, 0, sizeof (exc->exception_class));
+ exc->exception_cleanup = 0;
+
+#ifndef __USING_SJLJ_EXCEPTIONS__
+ _Unwind_ForcedUnwind (exc, force_unwind_stop, 0);
+#else
+ _Unwind_SjLj_ForcedUnwind (exc, force_unwind_stop, 0);
+#endif
+
+ abort ();
+}
+
+static void handler (void *p __attribute__((unused)))
+{
+ exit (0);
+}
+
+__attribute__((noinline)) static void callme ()
+{
+ CFI_ESCAPE;
+ force_unwind ();
+}
+
+__attribute__((noinline)) static void doit ()
+{
+ char dummy __attribute__((cleanup (handler)));
+ callme ();
+}
+
+int main()
+{
+ doit ();
+ abort ();
+}
diff --git a/gcc/testsuite/gcc.dg/cpp/include6.c b/gcc/testsuite/gcc.dg/cpp/include6.c
new file mode 100644
index 00000000000..2bb1320daa2
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/cpp/include6.c
@@ -0,0 +1,14 @@
+/* { dg-do preprocess } */
+/* { dg-options "-std=gnu99" } */
+
+#include <stddef.h>
+#include "stddef.h"
+#include L"stddef.h" /* { dg-error "include expects" } */
+#include u"stddef.h" /* { dg-error "include expects" } */
+#include U"stddef.h" /* { dg-error "include expects" } */
+#include u8"stddef.h" /* { dg-error "include expects" } */
+#include R"[stddef.h]" /* { dg-error "include expects" } */
+#include LR"[stddef.h]" /* { dg-error "include expects" } */
+#include uR"[stddef.h]" /* { dg-error "include expects" } */
+#include UR"[stddef.h]" /* { dg-error "include expects" } */
+#include u8R"[stddef.h]" /* { dg-error "include expects" } */
diff --git a/gcc/testsuite/gcc.dg/cpp/separate-1.c b/gcc/testsuite/gcc.dg/cpp/separate-1.c
index 6814a0fa2d0..33d910b3c00 100644
--- a/gcc/testsuite/gcc.dg/cpp/separate-1.c
+++ b/gcc/testsuite/gcc.dg/cpp/separate-1.c
@@ -8,8 +8,8 @@
#define FOO()
-int FOO( /* { dg-error "parse error|syntax error|expected" "error on this line" } */
- ), bar;
+int FOO(
+ ), bar; /* { dg-error "parse error|syntax error|expected" "error on this line" } */
int baz FOO /* { dg-error "parse error|syntax error|expected" "error on this line" } */
;
diff --git a/gcc/testsuite/gcc.dg/cpp/spacing1.c b/gcc/testsuite/gcc.dg/cpp/spacing1.c
index 2d70f869d21..c21a6b5159b 100644
--- a/gcc/testsuite/gcc.dg/cpp/spacing1.c
+++ b/gcc/testsuite/gcc.dg/cpp/spacing1.c
@@ -1,6 +1,7 @@
/* Copyright (C) 2000, 2001, 2003 Free Software Foundation, Inc. */
/* { dg-do preprocess } */
+/* { dg-options "-P" } */
/* This tests correct spacing of macro expansion output, as well as
the line it falls on. This is quite subtle; it involves newlines
diff --git a/gcc/testsuite/gcc.dg/debug/dwarf2/inline3.c b/gcc/testsuite/gcc.dg/debug/dwarf2/inline3.c
new file mode 100644
index 00000000000..feafb33e829
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/debug/dwarf2/inline3.c
@@ -0,0 +1,22 @@
+/* Verify that only one DW_AT_const_value is emitted for baz,
+ not for baz abstract DIE and again inside of
+ DW_TAG_inlined_subroutine. */
+/* { dg-options "-O2 -g -dA" } */
+/* { dg-do compile } */
+/* { dg-final { scan-assembler-times " DW_AT_const_value" 1 } } */
+
+struct A { const long i; const long j; };
+
+static inline long
+foo (void)
+{
+ const struct A baz = { .i = 2, .j = 21 };
+ asm volatile ("" : : : "memory");
+ return baz.i * baz.j;
+}
+
+int
+main ()
+{
+ return foo () - 42;
+}
diff --git a/gcc/testsuite/gcc.dg/debug/dwarf2/pr41445-1.c b/gcc/testsuite/gcc.dg/debug/dwarf2/pr41445-1.c
new file mode 100644
index 00000000000..452c0f6808f
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/debug/dwarf2/pr41445-1.c
@@ -0,0 +1,18 @@
+/* PR preprocessor/41445 */
+/* Test that token after multi-line function-like macro use
+ gets correct locus even when preprocessing separately. */
+/* { dg-do compile } */
+/* { dg-options "-save-temps -g -O0 -dA -fno-merge-debug-strings" } */
+
+#define A(a,b)
+int varh;A(1,
+
+
+
+ 2)int vari;
+int varj;
+
+/* { dg-final { scan-assembler "DW_TAG_variable\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*\"varh\[^\\r\\n\]*DW_AT_name(\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*DW_AT_)*\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*\[^0-9a-fA-FxX](0x)?8\[^0-9a-fA-FxX]\[^\\r\\n\]*DW_AT_decl_line" } } */
+/* { dg-final { scan-assembler "DW_TAG_variable\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*\"vari\[^\\r\\n\]*DW_AT_name(\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*DW_AT_)*\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*\[^0-9a-fA-FxX](0xc|12)\[^0-9a-fA-FxX]\[^\\r\\n\]*DW_AT_decl_line" } } */
+/* { dg-final { scan-assembler "DW_TAG_variable\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*\"varj\[^\\r\\n\]*DW_AT_name(\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*DW_AT_)*\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*\[^0-9a-fA-FxX](0xd|13)\[^0-9a-fA-FxX]\[^\\r\\n\]*DW_AT_decl_line" } } */
+/* { dg-final { cleanup-saved-temps } } */
diff --git a/gcc/testsuite/gcc.dg/debug/dwarf2/pr41445-2.c b/gcc/testsuite/gcc.dg/debug/dwarf2/pr41445-2.c
new file mode 100644
index 00000000000..d2ee408ac9d
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/debug/dwarf2/pr41445-2.c
@@ -0,0 +1,9 @@
+/* PR preprocessor/41445 */
+/* { dg-do compile } */
+/* { dg-options "-g -O0 -dA -fno-merge-debug-strings" } */
+
+#include "pr41445-1.c"
+
+/* { dg-final { scan-assembler "DW_TAG_variable\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*\"varh\[^\\r\\n\]*DW_AT_name(\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*DW_AT_)*\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*\[^0-9a-fA-FxX](0x)?8\[^0-9a-fA-FxX]\[^\\r\\n\]*DW_AT_decl_line" } } */
+/* { dg-final { scan-assembler "DW_TAG_variable\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*\"vari\[^\\r\\n\]*DW_AT_name(\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*DW_AT_)*\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*\[^0-9a-fA-FxX](0xc|12)\[^0-9a-fA-FxX]\[^\\r\\n\]*DW_AT_decl_line" } } */
+/* { dg-final { scan-assembler "DW_TAG_variable\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*\"varj\[^\\r\\n\]*DW_AT_name(\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*DW_AT_)*\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*\[^0-9a-fA-FxX](0xd|13)\[^0-9a-fA-FxX]\[^\\r\\n\]*DW_AT_decl_line" } } */
diff --git a/gcc/testsuite/gcc.dg/debug/dwarf2/pr41445-3.c b/gcc/testsuite/gcc.dg/debug/dwarf2/pr41445-3.c
new file mode 100644
index 00000000000..2a74dc5e3d4
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/debug/dwarf2/pr41445-3.c
@@ -0,0 +1,18 @@
+/* PR preprocessor/41445 */
+/* Test that token after multi-line function-like macro use
+ gets correct locus even when preprocessing separately. */
+/* { dg-do compile } */
+/* { dg-options "-save-temps -g -O0 -dA -fno-merge-debug-strings" } */
+
+#define A(a,b)
+int varh;/*
+
+Some multi-line comment.
+
+ */int vari;
+int varj;
+
+/* { dg-final { scan-assembler "DW_TAG_variable\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*\"varh\[^\\r\\n\]*DW_AT_name(\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*DW_AT_)*\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*\[^0-9a-fA-FxX](0x)?8\[^0-9a-fA-FxX]\[^\\r\\n\]*DW_AT_decl_line" } } */
+/* { dg-final { scan-assembler "DW_TAG_variable\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*\"vari\[^\\r\\n\]*DW_AT_name(\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*DW_AT_)*\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*\[^0-9a-fA-FxX](0xc|12)\[^0-9a-fA-FxX]\[^\\r\\n\]*DW_AT_decl_line" } } */
+/* { dg-final { scan-assembler "DW_TAG_variable\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*\"varj\[^\\r\\n\]*DW_AT_name(\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*DW_AT_)*\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*\[^0-9a-fA-FxX](0xd|13)\[^0-9a-fA-FxX]\[^\\r\\n\]*DW_AT_decl_line" } } */
+/* { dg-final { cleanup-saved-temps } } */
diff --git a/gcc/testsuite/gcc.dg/debug/dwarf2/pr41445-4.c b/gcc/testsuite/gcc.dg/debug/dwarf2/pr41445-4.c
new file mode 100644
index 00000000000..8aa92de5dd4
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/debug/dwarf2/pr41445-4.c
@@ -0,0 +1,9 @@
+/* PR preprocessor/41445 */
+/* { dg-do compile } */
+/* { dg-options "-g -O0 -dA -fno-merge-debug-strings" } */
+
+#include "pr41445-3.c"
+
+/* { dg-final { scan-assembler "DW_TAG_variable\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*\"varh\[^\\r\\n\]*DW_AT_name(\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*DW_AT_)*\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*\[^0-9a-fA-FxX](0x)?8\[^0-9a-fA-FxX]\[^\\r\\n\]*DW_AT_decl_line" } } */
+/* { dg-final { scan-assembler "DW_TAG_variable\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*\"vari\[^\\r\\n\]*DW_AT_name(\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*DW_AT_)*\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*\[^0-9a-fA-FxX](0xc|12)\[^0-9a-fA-FxX]\[^\\r\\n\]*DW_AT_decl_line" } } */
+/* { dg-final { scan-assembler "DW_TAG_variable\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*\"varj\[^\\r\\n\]*DW_AT_name(\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*DW_AT_)*\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*\[^0-9a-fA-FxX](0xd|13)\[^0-9a-fA-FxX]\[^\\r\\n\]*DW_AT_decl_line" } } */
diff --git a/gcc/testsuite/gcc.dg/debug/dwarf2/pr41445-5.c b/gcc/testsuite/gcc.dg/debug/dwarf2/pr41445-5.c
new file mode 100644
index 00000000000..03af604a7c0
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/debug/dwarf2/pr41445-5.c
@@ -0,0 +1,14 @@
+/* PR preprocessor/41445 */
+/* Test that token after multi-line function-like macro use
+ gets correct locus even when preprocessing separately. */
+/* { dg-do compile } */
+/* { dg-options "-save-temps -g -O0 -dA -fno-merge-debug-strings" } */
+
+#define A(x) vari x
+#define vari(x)
+#define B , varj
+int A(B) ;
+
+/* { dg-final { scan-assembler "DW_TAG_variable\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*\"vari\[^\\r\\n\]*DW_AT_name(\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*DW_AT_)*\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*\[^0-9a-fA-FxX](0x)?7\[^0-9a-fA-FxX]\[^\\r\\n\]*DW_AT_decl_line" } } */
+/* { dg-final { scan-assembler "DW_TAG_variable\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*\"varj\[^\\r\\n\]*DW_AT_name(\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*DW_AT_)*\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*\[^0-9a-fA-FxX](0xa|10)\[^0-9a-fA-FxX]\[^\\r\\n\]*DW_AT_decl_line" } } */
+/* { dg-final { cleanup-saved-temps } } */
diff --git a/gcc/testsuite/gcc.dg/debug/dwarf2/pr41445-6.c b/gcc/testsuite/gcc.dg/debug/dwarf2/pr41445-6.c
new file mode 100644
index 00000000000..8aa37d1c1a6
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/debug/dwarf2/pr41445-6.c
@@ -0,0 +1,8 @@
+/* PR preprocessor/41445 */
+/* { dg-do compile } */
+/* { dg-options "-g -O0 -dA -fno-merge-debug-strings" } */
+
+#include "pr41445-5.c"
+
+/* { dg-final { scan-assembler "DW_TAG_variable\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*\"vari\[^\\r\\n\]*DW_AT_name(\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*DW_AT_)*\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*\[^0-9a-fA-FxX](0x)?7\[^0-9a-fA-FxX]\[^\\r\\n\]*DW_AT_decl_line" } } */
+/* { dg-final { scan-assembler "DW_TAG_variable\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*\"varj\[^\\r\\n\]*DW_AT_name(\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*DW_AT_)*\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*\[^0-9a-fA-FxX](0xa|10)\[^0-9a-fA-FxX]\[^\\r\\n\]*DW_AT_decl_line" } } */
diff --git a/gcc/testsuite/gcc.dg/debug/dwarf2/pr41543.c b/gcc/testsuite/gcc.dg/debug/dwarf2/pr41543.c
new file mode 100644
index 00000000000..02683960bdb
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/debug/dwarf2/pr41543.c
@@ -0,0 +1,14 @@
+/* PR preprocessor/41543 */
+/* { dg-do compile } */
+/* { dg-options "-save-temps -g -O0 -dA -fno-merge-debug-strings" } */
+
+#include <stdarg.h>
+
+int
+foo (va_list ap)
+{
+ return va_arg (ap, int);
+}
+
+/* { dg-final { scan-assembler-not "DW_AT_decl_file\[^\\r\\n\]*\(pr41543\.i\)" } } */
+/* { dg-final { cleanup-saved-temps } } */
diff --git a/gcc/testsuite/gcc.dg/debug/dwarf2/pr41695.c b/gcc/testsuite/gcc.dg/debug/dwarf2/pr41695.c
new file mode 100644
index 00000000000..d61b5a293f5
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/debug/dwarf2/pr41695.c
@@ -0,0 +1,18 @@
+/* PR debug/41695 */
+/* { dg-do compile } */
+/* { dg-options "-g -O2 -dA -fno-merge-debug-strings" } */
+
+int bar (int);
+
+void
+foo (void)
+{
+ int b = 0;
+ b = bar (b);
+ b = bar (b);
+ b = bar (b);
+ b = bar (b);
+ bar (b);
+}
+
+/* { dg-final { scan-assembler-not "LVL(\[0-9\]+)-\[^1\]\[^\\r\\n\]*Location list begin address\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*LVL\\1-1-" } } */
diff --git a/gcc/testsuite/gcc.dg/debug/pr41264-1.c b/gcc/testsuite/gcc.dg/debug/pr41264-1.c
new file mode 100644
index 00000000000..b5555b554ba
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/debug/pr41264-1.c
@@ -0,0 +1,36 @@
+/* { dg-do compile } */
+
+typedef unsigned int hashval_t;
+static hashval_t __attribute__((always_inline))
+iterative_hash_host_wide_int (long val, hashval_t val2)
+{
+ hashval_t a = (hashval_t) val;
+ int zero = 0;
+ hashval_t b = (hashval_t) (val >> (sizeof (hashval_t) * 8 + zero));
+
+ a -= b; a -= val2; a ^= (val2>>13);
+ b -= val2; b -= a; b ^= (a<< 8);
+ val2 -= a; val2 -= b; val2 ^= ((b&0xffffffff)>>13);
+ a -= b; a -= val2; a ^= ((val2&0xffffffff)>>12);
+ b -= val2; b -= a; b = (b ^ (a<<16)) & 0xffffffff;
+ val2 -= a; val2 -= b; val2 = (val2 ^ (b>> 5)) & 0xffffffff;
+ a -= b; a -= val2; a = (a ^ (val2>> 3)) & 0xffffffff;
+ b -= val2; b -= a; b = (b ^ (a<<10)) & 0xffffffff;
+ val2 -= a; val2 -= b; val2 = (val2 ^ (b>>15)) & 0xffffffff;
+ return val2;
+}
+
+hashval_t
+bla (int nunits, int mode)
+{
+ hashval_t hashcode = 0;
+
+
+ hashcode = iterative_hash_host_wide_int (14, hashcode);
+ hashcode = iterative_hash_host_wide_int (nunits, hashcode);
+ hashcode = iterative_hash_host_wide_int (mode, hashcode);
+ if (nunits)
+ return 0;
+ else
+ return hashcode;
+}
diff --git a/gcc/testsuite/gcc.dg/debug/pr41343-1.c b/gcc/testsuite/gcc.dg/debug/pr41343-1.c
new file mode 100644
index 00000000000..6d56380383d
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/debug/pr41343-1.c
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+
+#define X(new,old) int i ## new = i ## old + i ## old;
+#define Y(pfx) X(pfx ## 1, pfx) \
+ X(pfx ## 2, pfx ## 1) \
+ X(pfx ## 3, pfx ## 2) \
+ X(pfx ## 4, pfx ## 3) \
+ X(pfx ## 5, pfx ## 4) \
+ X(pfx ## 6, pfx ## 5) \
+ X(pfx ## 7, pfx ## 6) \
+ X(pfx ## 8, pfx ## 7) \
+ X(pfx ## 9, pfx ## 8)
+
+void foo (int i1)
+{
+ Y(1)
+ Y(11)
+ Y(111)
+ asm ("" : : "X" (i1));
+}
diff --git a/gcc/testsuite/gcc.dg/debug/pr41717.c b/gcc/testsuite/gcc.dg/debug/pr41717.c
new file mode 100644
index 00000000000..21250883a11
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/debug/pr41717.c
@@ -0,0 +1,10 @@
+/* PR debug/41717 */
+/* { dg-do compile } */
+
+void
+foo (void)
+{
+ _Complex float v[1], w;
+ v[1] = 0.0f + 0.8fi;
+ w = __builtin_conjf (v[1] * v[1]);
+}
diff --git a/gcc/testsuite/gcc.dg/debug/pr41893-1.c b/gcc/testsuite/gcc.dg/debug/pr41893-1.c
new file mode 100644
index 00000000000..54a31fb6f2f
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/debug/pr41893-1.c
@@ -0,0 +1,13 @@
+/* PR debug/41893 */
+/* { dg-do compile } */
+/* { dg-options "-combine -fwhole-program -O" } */
+/* { dg-additional-sources "pr41893-2.c" } */
+
+struct S { int v; };
+struct S s;
+
+void __attribute__((externally_visible))
+func1 (void)
+{
+ struct S *p = &s;
+}
diff --git a/gcc/testsuite/gcc.dg/debug/pr41893-2.c b/gcc/testsuite/gcc.dg/debug/pr41893-2.c
new file mode 100644
index 00000000000..f967875f198
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/debug/pr41893-2.c
@@ -0,0 +1,10 @@
+/* PR debug/41893 */
+/* { dg-do compile } */
+
+extern struct S s;
+
+void
+func2 (void)
+{
+ &s;
+}
diff --git a/gcc/testsuite/gcc.dg/debug/vta-1.c b/gcc/testsuite/gcc.dg/debug/vta-1.c
new file mode 100644
index 00000000000..414083a09c0
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/debug/vta-1.c
@@ -0,0 +1,34 @@
+/* https://bugzilla.redhat.com/show_bug.cgi?id=521991#c5
+
+ Distilled from Linux XFS source code. foo, inlined into bar, ends
+ up with debug stmts referencing the addressable variable b.
+ Optimization made it non-addressable, and then completely optimized
+ away, before we got a chance to rename (and discard) the occurrence
+ in the debug stmt. When we did, we crashed, attempting to rename
+ an unreference variable. */
+
+/* { dg-do compile } */
+
+static inline int
+foo (void *x, unsigned y)
+{
+ unsigned z = *(unsigned long *) x % y;
+ *(unsigned long *) x = *(unsigned long *) x / y;
+ return z;
+}
+
+struct S
+{
+ unsigned t;
+};
+
+void
+bar (struct S *x, int *y)
+{
+ int a = 0;
+ unsigned long b = x->t;
+ foo (&b, x->t);
+ for (;; a++)
+ if (b)
+ *y = 1;
+}
diff --git a/gcc/testsuite/gcc.dg/debug/vta-2.c b/gcc/testsuite/gcc.dg/debug/vta-2.c
new file mode 100644
index 00000000000..5d44262ec76
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/debug/vta-2.c
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+
+static int
+bar (void *a, unsigned int b, int n)
+{
+ int c = *(unsigned long *) a % b;
+ *(unsigned long *) a = (int) (*(unsigned long *) a) / b;
+ return c;
+}
+
+int
+foo (unsigned long x, int *y, int z)
+{
+ int level;
+ for (level = 0; level < *y; level++)
+ {
+ bar (&x, z, sizeof (x));
+ if (x)
+ return *y - 1;
+ }
+}
diff --git a/gcc/testsuite/gcc.dg/debug/vta-3.c b/gcc/testsuite/gcc.dg/debug/vta-3.c
new file mode 100644
index 00000000000..7d014f1bc1e
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/debug/vta-3.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+
+int
+foo (void)
+{
+ union { char e[8]; int i; } a, b;
+ char *c, *d;
+ unsigned int i;
+ c = a.e;
+ d = &b.e[sizeof (int) - 1];
+ for (i = 0; i < sizeof (int); i++)
+ {
+ *d = *c++;
+ --d;
+ }
+ return b.i;
+}
diff --git a/gcc/testsuite/gcc.dg/guality/guality.exp b/gcc/testsuite/gcc.dg/guality/guality.exp
index 82185fba1ba..d4ee6864ba4 100644
--- a/gcc/testsuite/gcc.dg/guality/guality.exp
+++ b/gcc/testsuite/gcc.dg/guality/guality.exp
@@ -1,6 +1,7 @@
# This harness is for tests that should be run at all optimisation levels.
load_lib gcc-dg.exp
+load_lib gcc-gdb-test.exp
# Disable on darwin until radr://7264615 is resolved.
if { [istarget *-*-darwin*] } {
@@ -20,82 +21,6 @@ proc check_guality {args} {
return $ret
}
-# Utility for testing variable values using gdb, invoked via dg-final.
-# Call pass if variable has the desired value, otherwise fail.
-#
-# Argument 0 is the line number on which to put a breakpoint
-# Argument 1 is the name of the variable to be checked
-# Argument 2 is the expected value of the variable
-# Argument 3 handles expected failures and the like
-proc gdb-test { args } {
- if { ![isnative] || [is_remote target] } { return }
-
- if { [llength $args] >= 4 } {
- switch [dg-process-target [lindex $args 3]] {
- "S" { }
- "N" { return }
- "F" { setup_xfail "*-*-*" }
- "P" { }
- }
- }
-
- # This assumes that we are three frames down from dg-test, and that
- # it still stores the filename of the testcase in a local variable "name".
- # A cleaner solution would require a new DejaGnu release.
- upvar 2 name testcase
- upvar 2 prog prog
-
- set gdb_name $::env(GUALITY_GDB_NAME)
- set testname "$testcase line [lindex $args 0] [lindex $args 1] == [lindex $args 2]"
- set output_file "[file rootname [file tail $prog]].exe"
- set cmd_file "[file rootname [file tail $prog]].gdb"
-
- set fd [open $cmd_file "w"]
- puts $fd "break [lindex $args 0]"
- puts $fd "run"
- puts $fd "print [lindex $args 1]"
- puts $fd "print [lindex $args 2]"
- puts $fd "quit"
- close $fd
-
- send_log "Spawning: $gdb_name -nx -nw -quiet -x $cmd_file ./$output_file\n"
- set res [remote_spawn target "$gdb_name -nx -nw -quiet -x $cmd_file ./$output_file"]
- if { $res < 0 || $res == "" } {
- unsupported "$testname"
- return
- }
-
- remote_expect target [timeout_value] {
- -re {[\n\r]\$1 = ([^\n\r]*)[\n\r]+\$2 = ([^\n\r]*)[\n\r]} {
- set first $expect_out(1,string)
- set second $expect_out(2,string)
- if { $first == $second } {
- pass "$testname"
- } else {
- send_log "$first != $second\n"
- fail "$testname"
- }
- remote_close target
- return
- }
- # Too old GDB
- -re "Unhandled dwarf expression|Error in sourced command file" {
- unsupported "$testname"
- remote_close target
- return
- }
- timeout {
- unsupported "$testname"
- remote_close target
- return
- }
- }
-
- remote_close target
- unsupported "$testname"
- return
-}
-
dg-init
global GDB
diff --git a/gcc/testsuite/gcc.dg/guality/pr41447-1.c b/gcc/testsuite/gcc.dg/guality/pr41447-1.c
new file mode 100644
index 00000000000..9bb28abe37c
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/guality/pr41447-1.c
@@ -0,0 +1,26 @@
+/* { dg-do run { xfail *-*-* } } */
+/* { dg-options "-g" } */
+
+#include "guality.h"
+
+int a;
+
+int
+main (int argc, char *argv[])
+{
+ int tmp = a;
+ int tmp2 = a;
+ int tmp3;
+ int res;
+ GUALCHKVAL (a);
+ GUALCHKVAL (tmp);
+ GUALCHKVAL (tmp2);
+ a = 0;
+ tmp3 = tmp2;
+ GUALCHKVAL (a);
+ GUALCHKVAL (tmp);
+ GUALCHKVAL (tmp2);
+ GUALCHKVAL (tmp3);
+ res = tmp - tmp2 + 1;
+ return res;
+}
diff --git a/gcc/testsuite/gcc.dg/guality/pr41616-1.c b/gcc/testsuite/gcc.dg/guality/pr41616-1.c
new file mode 100644
index 00000000000..24f64ab083d
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/guality/pr41616-1.c
@@ -0,0 +1,20 @@
+/* { dg-do run { xfail *-*-* } } */
+/* { dg-options "-g" } */
+
+#include "guality.h"
+
+inline int f(int *a)
+{
+ return *a;
+}
+
+int
+main(int argc, char *argv[])
+{
+ int b = -1;
+ GUALCHKVAL (b);
+ if (argc > 0)
+ b = -f(&b);
+ GUALCHKVAL (b);
+ return b;
+}
diff --git a/gcc/testsuite/gcc.dg/inline-33.c b/gcc/testsuite/gcc.dg/inline-33.c
index ac577e3cb88..d82ff71545b 100644
--- a/gcc/testsuite/gcc.dg/inline-33.c
+++ b/gcc/testsuite/gcc.dg/inline-33.c
@@ -1,6 +1,6 @@
/* { dg-do compile } */
/* { dg-options "-O3 -fdump-tree-optimized" } */
-/* { dg-options "-O3 -fdump-tree-optimized -fpie" { target { ! nonpic } } } */
+/* { dg-add-options bind_pic_locally } */
int i;
diff --git a/gcc/testsuite/gcc.dg/ipa/ipa-1.c b/gcc/testsuite/gcc.dg/ipa/ipa-1.c
index 76ef9a643d6..65c0a0caae3 100644
--- a/gcc/testsuite/gcc.dg/ipa/ipa-1.c
+++ b/gcc/testsuite/gcc.dg/ipa/ipa-1.c
@@ -1,6 +1,6 @@
/* { dg-do compile } */
/* { dg-options "-O3 -fipa-cp -fipa-cp-clone -fdump-ipa-cp -fno-early-inlining" } */
-/* { dg-skip-if "PR 25442" { "*-*-*" } { "-fpic" "-fPIC" } { "" } } */
+/* { dg-add-options bind_pic_locally } */
#include <stdio.h>
int g (int b, int c)
diff --git a/gcc/testsuite/gcc.dg/ipa/ipa-2.c b/gcc/testsuite/gcc.dg/ipa/ipa-2.c
index 454927a2c19..1b94bbb7bc0 100644
--- a/gcc/testsuite/gcc.dg/ipa/ipa-2.c
+++ b/gcc/testsuite/gcc.dg/ipa/ipa-2.c
@@ -1,6 +1,6 @@
/* { dg-do compile } */
/* { dg-options "-O3 -fipa-cp -fipa-cp-clone -fdump-ipa-cp -fno-early-inlining" } */
-/* { dg-skip-if "PR 25442" { "*-*-*" } { "-fpic" "-fPIC" } { "" } } */
+/* { dg-add-options bind_pic_locally } */
#include <stdio.h>
int g (int b, int c)
diff --git a/gcc/testsuite/gcc.dg/ipa/ipa-3.c b/gcc/testsuite/gcc.dg/ipa/ipa-3.c
index 6eb3da40a6f..57200a9ca5d 100644
--- a/gcc/testsuite/gcc.dg/ipa/ipa-3.c
+++ b/gcc/testsuite/gcc.dg/ipa/ipa-3.c
@@ -1,6 +1,6 @@
/* { dg-do compile } */
/* { dg-options "-O3 -fipa-cp -fipa-cp-clone -fdump-ipa-cp -fno-early-inlining" } */
-/* { dg-skip-if "PR 25442" { "*-*-*" } { "-fpic" "-fPIC" } { "" } } */
+/* { dg-add-options bind_pic_locally } */
/* Double constants. */
diff --git a/gcc/testsuite/gcc.dg/ipa/ipa-4.c b/gcc/testsuite/gcc.dg/ipa/ipa-4.c
index c162b2385f2..12af6a4f4d3 100644
--- a/gcc/testsuite/gcc.dg/ipa/ipa-4.c
+++ b/gcc/testsuite/gcc.dg/ipa/ipa-4.c
@@ -1,6 +1,6 @@
/* { dg-do compile } */
/* { dg-options "-O3 -fipa-cp -fipa-cp-clone -fdump-ipa-cp -fno-early-inlining" } */
-/* { dg-skip-if "PR 25442" { "*-*-*" } { "-fpic" "-fPIC" } { "" } } */
+/* { dg-add-options bind_pic_locally } */
#include <stdio.h>
int g (int b, int c)
diff --git a/gcc/testsuite/gcc.dg/ipa/ipa-5.c b/gcc/testsuite/gcc.dg/ipa/ipa-5.c
index 9e8006a2fef..0ca6ba21dce 100644
--- a/gcc/testsuite/gcc.dg/ipa/ipa-5.c
+++ b/gcc/testsuite/gcc.dg/ipa/ipa-5.c
@@ -1,6 +1,6 @@
/* { dg-do compile } */
/* { dg-options "-O3 -fipa-cp -fipa-cp-clone -fdump-ipa-cp -fno-early-inlining" } */
-/* { dg-skip-if "PR 25442" { "*-*-*" } { "-fpic" "-fPIC" } { "" } } */
+/* { dg-add-options bind_pic_locally } */
/* Float & short constants. */
diff --git a/gcc/testsuite/gcc.dg/ipa/ipa-7.c b/gcc/testsuite/gcc.dg/ipa/ipa-7.c
index 1c4a1709df6..b3ab0f532e4 100644
--- a/gcc/testsuite/gcc.dg/ipa/ipa-7.c
+++ b/gcc/testsuite/gcc.dg/ipa/ipa-7.c
@@ -1,6 +1,6 @@
/* { dg-do compile } */
/* { dg-options "-O3 -fipa-cp -fipa-cp-clone -fdump-ipa-cp -fno-early-inlining" } */
-/* { dg-skip-if "PR 25442" { "*-*-*" } { "-fpic" "-fPIC" } { "" } } */
+/* { dg-add-options bind_pic_locally } */
#include <stdio.h>
void send_addr (int *);
diff --git a/gcc/testsuite/gcc.dg/ipa/ipacost-2.c b/gcc/testsuite/gcc.dg/ipa/ipacost-2.c
index 958059c73e6..d06c9b8a48c 100644
--- a/gcc/testsuite/gcc.dg/ipa/ipacost-2.c
+++ b/gcc/testsuite/gcc.dg/ipa/ipacost-2.c
@@ -1,6 +1,6 @@
/* { dg-do compile } */
/* { dg-options "-O3 -fipa-cp -fipa-cp-clone -fdump-ipa-cp -fno-early-inlining -fdump-tree-optimized" } */
-/* { dg-options "-O3 -fipa-cp -fipa-cp-clone -fdump-ipa-cp -fno-early-inlining -fdump-tree-optimized -fpie" { target { ! nonpic } } } */
+/* { dg-add-options bind_pic_locally } */
int array[100];
diff --git a/gcc/testsuite/gcc.dg/lto/20080908_0.c b/gcc/testsuite/gcc.dg/lto/20080908_0.c
new file mode 100644
index 00000000000..3bc1c3a725c
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20080908_0.c
@@ -0,0 +1,16 @@
+/* { dg-lto-do assemble } */
+void foo(void) {
+ char *bar;
+ int baz;
+ while (1)
+ {
+ if (baz)
+ {
+ baz = -baz;
+ do
+ *bar++ = 0;
+ while (++baz);
+ }
+ ++baz;
+ }
+}
diff --git a/gcc/testsuite/gcc.dg/lto/20080917_0.c b/gcc/testsuite/gcc.dg/lto/20080917_0.c
new file mode 100644
index 00000000000..ac0891081fe
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20080917_0.c
@@ -0,0 +1,29 @@
+/* { dg-lto-do assemble } */
+/* { dg-lto-options {{-O2 -funsigned-char}} } */
+int
+foo (char *s, int flag)
+{
+ for (;;)
+ {
+ unsigned char c;
+ if (flag)
+ c = *s;
+ else
+ c = *s;
+ return c;
+ }
+}
+
+int
+baz (const char *s, int flag)
+{
+ for (;;)
+ {
+ unsigned char c;
+ if (flag)
+ c = *s;
+ else
+ c = *s;
+ return c;
+ }
+}
diff --git a/gcc/testsuite/gcc.dg/lto/20080924_0.c b/gcc/testsuite/gcc.dg/lto/20080924_0.c
new file mode 100644
index 00000000000..db7745077e2
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20080924_0.c
@@ -0,0 +1,9 @@
+/* { dg-lto-do assemble } */
+/* { dg-lto-options {{-O2 -flto -funsigned-char}} } */
+typedef unsigned int size_t;
+foo (const char *src, unsigned char *dst, size_t size)
+{
+ int ch;
+ while ((ch = *src++) != '\0') {
+ }
+}
diff --git a/gcc/testsuite/gcc.dg/lto/20081024_0.c b/gcc/testsuite/gcc.dg/lto/20081024_0.c
new file mode 100644
index 00000000000..9fa297abc0e
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20081024_0.c
@@ -0,0 +1,26 @@
+/* { dg-lto-do run } */
+
+#include <stdarg.h>
+#include <stdio.h>
+#include <string.h>
+
+char *
+myprintf (const char *fmt, ...)
+{
+ va_list args;
+ static char buf[80];
+
+ va_start (args, fmt);
+ (void) vsnprintf (buf, sizeof (buf), fmt, args);
+ va_end (args);
+ return buf;
+}
+
+int
+main ()
+{
+ char *s;
+
+ s = myprintf ("%s: %d\n", "foo", 1);
+ return strcmp (s, "foo: 1\n") != 0;
+}
diff --git a/gcc/testsuite/gcc.dg/lto/20081109_0.c b/gcc/testsuite/gcc.dg/lto/20081109_0.c
new file mode 100644
index 00000000000..eaa25f673d3
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20081109_0.c
@@ -0,0 +1,3 @@
+/* { dg-lto-do assemble } */
+/* { dg-lto-options {{-w -flto}} } */
+void Foo(void) { char bar[1]; free(bar); }
diff --git a/gcc/testsuite/gcc.dg/lto/20081111_0.c b/gcc/testsuite/gcc.dg/lto/20081111_0.c
new file mode 100644
index 00000000000..899689c1bc4
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20081111_0.c
@@ -0,0 +1,11 @@
+extern int mumble;
+extern void abort (void);
+extern void exit (int);
+
+int
+main ()
+{
+ if (++mumble != 42)
+ abort ();
+ exit (0);
+}
diff --git a/gcc/testsuite/gcc.dg/lto/20081111_1.c b/gcc/testsuite/gcc.dg/lto/20081111_1.c
new file mode 100644
index 00000000000..2b7fee58690
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20081111_1.c
@@ -0,0 +1,7 @@
+int mumble = 41;
+
+int
+bar (void)
+{
+ return mumble;
+}
diff --git a/gcc/testsuite/gcc.dg/lto/20081112_0.c b/gcc/testsuite/gcc.dg/lto/20081112_0.c
new file mode 100644
index 00000000000..a90aa70b3ab
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20081112_0.c
@@ -0,0 +1,14 @@
+extern void exit (int);
+extern void abort (void);
+
+extern void f ();
+extern int g ();
+
+int
+main ()
+{
+ f ();
+ if (g () != 42)
+ abort ();
+ exit (0);
+}
diff --git a/gcc/testsuite/gcc.dg/lto/20081112_1.c b/gcc/testsuite/gcc.dg/lto/20081112_1.c
new file mode 100644
index 00000000000..2ba1cb9405c
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20081112_1.c
@@ -0,0 +1,13 @@
+static int mumble;
+
+void
+f (void)
+{
+ mumble = 41;
+}
+
+int __attribute__((noinline))
+g (void)
+{
+ return ++mumble;
+}
diff --git a/gcc/testsuite/gcc.dg/lto/20081115_0.c b/gcc/testsuite/gcc.dg/lto/20081115_0.c
new file mode 100644
index 00000000000..f24a92deda4
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20081115_0.c
@@ -0,0 +1,32 @@
+/* { dg-lto-options {{-O2 -DOPTIMIZE -fwhopr} {-O0 -fwhopr}} } */
+
+extern void abort (void);
+
+int f (void)
+{
+ return 1;
+}
+
+extern inline int
+e_inline_baz (void)
+{
+ return 1 + f();
+}
+
+int
+bar (void)
+{
+ return e_inline_baz ();
+}
+
+main ()
+{
+#ifdef OPTIMIZE
+ if (bar () != 2 || foo () != 3)
+ abort ();
+#else
+ if (bar () != 0 || foo () != 0)
+ abort ();
+#endif
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/lto/20081115_1.c b/gcc/testsuite/gcc.dg/lto/20081115_1.c
new file mode 100644
index 00000000000..62ffa520000
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20081115_1.c
@@ -0,0 +1,11 @@
+extern inline int
+e_inline_baz (void)
+{
+ return 2 + 1;
+}
+
+int
+foo (void)
+{
+ return e_inline_baz ();
+}
diff --git a/gcc/testsuite/gcc.dg/lto/20081115_2.c b/gcc/testsuite/gcc.dg/lto/20081115_2.c
new file mode 100644
index 00000000000..0ccecd7363d
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20081115_2.c
@@ -0,0 +1,5 @@
+int
+e_inline_baz (void)
+{
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/lto/20081118_0.c b/gcc/testsuite/gcc.dg/lto/20081118_0.c
new file mode 100644
index 00000000000..0640428be6d
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20081118_0.c
@@ -0,0 +1,28 @@
+/* { dg-lto-options {{-O2 -DOPTIMIZE -fwhopr} {-O0 -fwhopr}} } */
+
+extern void abort (void);
+extern int f (void);
+
+extern inline int
+e_inline_baz (void)
+{
+ return 1 + f();
+}
+
+int
+bar (void)
+{
+ return e_inline_baz ();
+}
+
+main ()
+{
+#ifdef OPTIMIZE
+ if (bar () != 2 || foo () != 3)
+ abort ();
+#else
+ if (bar () != 0 || foo () != 0)
+ abort ();
+#endif
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/lto/20081118_1.c b/gcc/testsuite/gcc.dg/lto/20081118_1.c
new file mode 100644
index 00000000000..f0a8c3c876b
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20081118_1.c
@@ -0,0 +1,13 @@
+extern int f (void);
+
+extern inline int
+e_inline_baz (void)
+{
+ return 2 + f ();
+}
+
+int
+foo (void)
+{
+ return e_inline_baz ();
+}
diff --git a/gcc/testsuite/gcc.dg/lto/20081118_2.c b/gcc/testsuite/gcc.dg/lto/20081118_2.c
new file mode 100644
index 00000000000..32ce432a128
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20081118_2.c
@@ -0,0 +1,11 @@
+int
+e_inline_baz (void)
+{
+ return 0;
+}
+
+ __attribute__((noinline)) int
+f (void)
+{
+ return 1;
+}
diff --git a/gcc/testsuite/gcc.dg/lto/20081120-1_0.c b/gcc/testsuite/gcc.dg/lto/20081120-1_0.c
new file mode 100644
index 00000000000..e842b37f663
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20081120-1_0.c
@@ -0,0 +1,5 @@
+/* { dg-lto-do link } */
+/* { dg-lto-options {{-flto -r -nostdlib}} } */
+extern int stat(void) __asm__("" "stat64");
+extern inline int stat(void) { }
+static void foo(void) { stat(); }
diff --git a/gcc/testsuite/gcc.dg/lto/20081120-1_1.c b/gcc/testsuite/gcc.dg/lto/20081120-1_1.c
new file mode 100644
index 00000000000..73d25000c91
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20081120-1_1.c
@@ -0,0 +1,3 @@
+extern int stat(void) __asm__("" "stat64");
+extern inline int stat(void) { }
+static void foo(void) { stat(); }
diff --git a/gcc/testsuite/gcc.dg/lto/20081120-2_0.c b/gcc/testsuite/gcc.dg/lto/20081120-2_0.c
new file mode 100644
index 00000000000..19c4ab34784
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20081120-2_0.c
@@ -0,0 +1,3 @@
+/* { dg-lto-do link } */
+/* { dg-lto-options {{-fwhopr -r -nostdlib}} } */
+void bar(void) {}
diff --git a/gcc/testsuite/gcc.dg/lto/20081120-2_1.c b/gcc/testsuite/gcc.dg/lto/20081120-2_1.c
new file mode 100644
index 00000000000..c81f8c7fd07
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20081120-2_1.c
@@ -0,0 +1,2 @@
+int mumble = 0;
+void foo(void) {}
diff --git a/gcc/testsuite/gcc.dg/lto/20081125_0.c b/gcc/testsuite/gcc.dg/lto/20081125_0.c
new file mode 100644
index 00000000000..4b2e7191fed
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20081125_0.c
@@ -0,0 +1,6 @@
+int foo (int);
+
+int main()
+{
+ return foo (0);
+}
diff --git a/gcc/testsuite/gcc.dg/lto/20081125_1.c b/gcc/testsuite/gcc.dg/lto/20081125_1.c
new file mode 100644
index 00000000000..1fcf4e7d391
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20081125_1.c
@@ -0,0 +1,4 @@
+int foo (int x)
+{
+ return x;
+}
diff --git a/gcc/testsuite/gcc.dg/lto/20081126_0.c b/gcc/testsuite/gcc.dg/lto/20081126_0.c
new file mode 100644
index 00000000000..9243da96a79
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20081126_0.c
@@ -0,0 +1,8 @@
+/* { dg-lto-do link } */
+/* { dg-skip-if "" { ! { i?86-*-* x86_64-*-* } } { "*" } { "" } } */
+/* { dg-lto-options {{-flto -r -nostdlib}} } */
+
+int f(void) {
+ register int ri asm("edi");
+ return ri;
+}
diff --git a/gcc/testsuite/gcc.dg/lto/20081201-1_0.c b/gcc/testsuite/gcc.dg/lto/20081201-1_0.c
new file mode 100644
index 00000000000..05cbb82fdd1
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20081201-1_0.c
@@ -0,0 +1,33 @@
+/* { dg-lto-options {{-O2 -DOPTIMIZE -fwhopr} {-O0 -fwhopr}} } */
+
+extern void abort (void);
+
+int
+f (void)
+{
+ return 1;
+}
+
+extern inline int
+e_inline_baz (void)
+{
+ return 1 + f();
+}
+
+int
+bar (void)
+{
+ return e_inline_baz ();
+}
+
+main ()
+{
+#ifdef OPTIMIZE
+ if (bar () != 2 || foo () != 3)
+ abort ();
+#else
+ if (bar () != 0 || foo () != 0)
+ abort ();
+#endif
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/lto/20081201-1_1.c b/gcc/testsuite/gcc.dg/lto/20081201-1_1.c
new file mode 100644
index 00000000000..f0a8c3c876b
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20081201-1_1.c
@@ -0,0 +1,13 @@
+extern int f (void);
+
+extern inline int
+e_inline_baz (void)
+{
+ return 2 + f ();
+}
+
+int
+foo (void)
+{
+ return e_inline_baz ();
+}
diff --git a/gcc/testsuite/gcc.dg/lto/20081201-1_2.c b/gcc/testsuite/gcc.dg/lto/20081201-1_2.c
new file mode 100644
index 00000000000..bcf87a749b5
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20081201-1_2.c
@@ -0,0 +1,7 @@
+int
+e_inline_baz (void)
+{
+ return 0;
+}
+
+
diff --git a/gcc/testsuite/gcc.dg/lto/20081201-2_0.c b/gcc/testsuite/gcc.dg/lto/20081201-2_0.c
new file mode 100644
index 00000000000..4c1510d1cec
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20081201-2_0.c
@@ -0,0 +1,16 @@
+/* { dg-lto-options {{-O3 -fwhopr}} } */
+
+/* Test that cross-TU inlining works. */
+
+extern void abort ();
+extern void exit (int);
+extern void *foo (void);
+
+int
+main ()
+{
+ if (foo () != __builtin_return_address (0))
+ abort ();
+
+ exit (0);
+}
diff --git a/gcc/testsuite/gcc.dg/lto/20081201-2_1.c b/gcc/testsuite/gcc.dg/lto/20081201-2_1.c
new file mode 100644
index 00000000000..f93e1fd025f
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20081201-2_1.c
@@ -0,0 +1,5 @@
+void *
+foo (void)
+{
+ return __builtin_return_address (0);
+}
diff --git a/gcc/testsuite/gcc.dg/lto/20081202-1_0.c b/gcc/testsuite/gcc.dg/lto/20081202-1_0.c
new file mode 100644
index 00000000000..933610a894b
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20081202-1_0.c
@@ -0,0 +1,11 @@
+/* { dg-lto-options {{-fwhopr -O3}} } */
+
+extern void exit (int);
+extern void foo (void);
+
+int
+main ()
+{
+ foo ();
+ exit (0);
+}
diff --git a/gcc/testsuite/gcc.dg/lto/20081202-1_1.c b/gcc/testsuite/gcc.dg/lto/20081202-1_1.c
new file mode 100644
index 00000000000..2f6777864a0
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20081202-1_1.c
@@ -0,0 +1,10 @@
+static void __attribute__((noinline))
+bar (void)
+{
+}
+
+void
+foo (void)
+{
+ bar ();
+}
diff --git a/gcc/testsuite/gcc.dg/lto/20081202-2_0.c b/gcc/testsuite/gcc.dg/lto/20081202-2_0.c
new file mode 100644
index 00000000000..09f417698ca
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20081202-2_0.c
@@ -0,0 +1,13 @@
+/* { dg-lto-options {{-fwhopr -O3}} } */
+
+extern void exit (int);
+extern void *foo (void);
+
+void *p;
+
+int
+main ()
+{
+ p = foo ();
+ exit (0);
+}
diff --git a/gcc/testsuite/gcc.dg/lto/20081202-2_1.c b/gcc/testsuite/gcc.dg/lto/20081202-2_1.c
new file mode 100644
index 00000000000..adb15024502
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20081202-2_1.c
@@ -0,0 +1,16 @@
+static void __attribute__((noinline))
+bar (void)
+{
+}
+
+void *
+foo (void)
+{
+ return bar;
+}
+
+void
+quxx (void)
+{
+ return bar ();
+}
diff --git a/gcc/testsuite/gcc.dg/lto/20081204-1_0.c b/gcc/testsuite/gcc.dg/lto/20081204-1_0.c
new file mode 100644
index 00000000000..5952b07b76f
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20081204-1_0.c
@@ -0,0 +1,7 @@
+/* { dg-lto-do link } */
+/* { dg-lto-options {{-fwhopr -fPIC -r -nostdlib}} } */
+
+/* Tests for the absence during linking of:
+ lto1: error: type of 'i' does not match original declaration */
+
+const int i[1];
diff --git a/gcc/testsuite/gcc.dg/lto/20081204-1_1.c b/gcc/testsuite/gcc.dg/lto/20081204-1_1.c
new file mode 100644
index 00000000000..95761ea156b
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20081204-1_1.c
@@ -0,0 +1,5 @@
+extern const int i[];
+
+int dummy(void) {
+ return i[0];
+}
diff --git a/gcc/testsuite/gcc.dg/lto/20081204-2_0.c b/gcc/testsuite/gcc.dg/lto/20081204-2_0.c
new file mode 100644
index 00000000000..53446050f95
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20081204-2_0.c
@@ -0,0 +1,5 @@
+/* { dg-lto-do link } */
+/* { dg-skip-if "" { ! { i?86-*-* x86_64-*-* } } { "*" } { "" } } */
+/* { dg-lto-options {{-w -flto -fPIC -r -nostdlib}} } */
+
+register int ri asm("edi");
diff --git a/gcc/testsuite/gcc.dg/lto/20081210-1_0.c b/gcc/testsuite/gcc.dg/lto/20081210-1_0.c
new file mode 100644
index 00000000000..5cf020ec227
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20081210-1_0.c
@@ -0,0 +1,21 @@
+#if defined(_LP64) || defined(_WIN64)
+typedef unsigned long int uintptr_t;
+#else
+typedef unsigned int uintptr_t;
+#endif
+
+extern void srand (uintptr_t);
+
+inline void
+foo (uintptr_t seed)
+{
+ srand (seed * seed);
+}
+
+int
+main ()
+{
+ foo (0);
+ srand ((uintptr_t) (&foo));
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/lto/20081212-1_0.c b/gcc/testsuite/gcc.dg/lto/20081212-1_0.c
new file mode 100644
index 00000000000..acc00186840
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20081212-1_0.c
@@ -0,0 +1,4 @@
+/* { dg-lto-do link } */
+/* { dg-lto-options {{-r -nostdlib}} } */
+int exported_var = 42;
+/* { dg-final { scan-symbol "exported_var" } } */
diff --git a/gcc/testsuite/gcc.dg/lto/20081222_0.c b/gcc/testsuite/gcc.dg/lto/20081222_0.c
new file mode 100644
index 00000000000..e44766613bd
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20081222_0.c
@@ -0,0 +1,11 @@
+#include "20081222_0.h"
+
+extern void abort (void);
+
+int
+main ()
+{
+ if (x () == 7)
+ return 0;
+ abort ();
+}
diff --git a/gcc/testsuite/gcc.dg/lto/20081222_0.h b/gcc/testsuite/gcc.dg/lto/20081222_0.h
new file mode 100644
index 00000000000..4c26f461651
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20081222_0.h
@@ -0,0 +1 @@
+int x();
diff --git a/gcc/testsuite/gcc.dg/lto/20081222_1.c b/gcc/testsuite/gcc.dg/lto/20081222_1.c
new file mode 100644
index 00000000000..e8f9254421b
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20081222_1.c
@@ -0,0 +1,16 @@
+#include "20081222_0.h"
+
+/* Actually, call "x" "INT_X", and make it hidden. */
+extern __typeof (x) x
+ __asm__ ("INT_x")
+ __attribute__ ((__visibility__ ("hidden")));
+
+int x ()
+{
+ return 7;
+}
+
+/* Make an externally-visible symbol "X" that's an alias for INT_x. */
+extern __typeof (x) EXT_x
+ __asm__ ("x")
+ __attribute__ ((__alias__ ("INT_x")));
diff --git a/gcc/testsuite/gcc.dg/lto/20081224_0.c b/gcc/testsuite/gcc.dg/lto/20081224_0.c
new file mode 100644
index 00000000000..9c784fe29ff
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20081224_0.c
@@ -0,0 +1,9 @@
+/* { dg-lto-do link } */
+/* { dg-lto-options {{-fwhopr -r -nostdlib -fPIC}} } */
+#include "20081224_0.h"
+
+extern struct foo x;
+
+void f(void) {
+ x.x = 0;
+}
diff --git a/gcc/testsuite/gcc.dg/lto/20081224_0.h b/gcc/testsuite/gcc.dg/lto/20081224_0.h
new file mode 100644
index 00000000000..7b62a079667
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20081224_0.h
@@ -0,0 +1,3 @@
+typedef struct foo {
+ int x;
+} foo_t;
diff --git a/gcc/testsuite/gcc.dg/lto/20081224_1.c b/gcc/testsuite/gcc.dg/lto/20081224_1.c
new file mode 100644
index 00000000000..3e1ff341088
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20081224_1.c
@@ -0,0 +1,2 @@
+#include "20081224_0.h"
+foo_t x;
diff --git a/gcc/testsuite/gcc.dg/lto/20090116_0.c b/gcc/testsuite/gcc.dg/lto/20090116_0.c
new file mode 100644
index 00000000000..9fd83ca0766
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20090116_0.c
@@ -0,0 +1,12 @@
+/* { dg-lto-do link } */
+/* { dg-lto-options {{-O1 -fwhopr -fPIC}} } */
+/* { dg-extra-ld-options {-r -nostdlib -O0} } */
+
+int foo(void) {
+ int ret, i;
+ for (i = 0; i < 1; i++)
+ ret = 0;
+ for (i = 0; i < 1; i++)
+ ret = 1;
+ return ret;
+}
diff --git a/gcc/testsuite/gcc.dg/lto/20090120_0.c b/gcc/testsuite/gcc.dg/lto/20090120_0.c
new file mode 100644
index 00000000000..6c69a9918b2
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20090120_0.c
@@ -0,0 +1,14 @@
+/* { dg-lto-options {{-flto -funsigned-char}} } */
+
+extern void abort ();
+
+char c = 0xff;
+
+int
+main ()
+{
+ int i = (unsigned) c;
+ if (i < 0)
+ abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/lto/20090126-1_0.c b/gcc/testsuite/gcc.dg/lto/20090126-1_0.c
new file mode 100644
index 00000000000..b2a25b2261c
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20090126-1_0.c
@@ -0,0 +1,7 @@
+/* { dg-lto-do link } */
+/* { dg-lto-options {{-O0 -fwhopr}} } */
+/* { dg-extra-ld-options {-r -nostdlib -O2 -fwhopr} } */
+
+int main(int argc, char **argv) {
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/lto/20090126-2_0.c b/gcc/testsuite/gcc.dg/lto/20090126-2_0.c
new file mode 100644
index 00000000000..a366c183873
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20090126-2_0.c
@@ -0,0 +1,7 @@
+/* { dg-lto-do link } */
+/* { dg-lto-options {{-fPIC -O2 -fwhopr}} } */
+/* { dg-extra-ld-options {-fno-PIC -r -nostdlib -O2 -fwhopr} } */
+
+int main(int argc, char **argv) {
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/lto/20090206-1_0.c b/gcc/testsuite/gcc.dg/lto/20090206-1_0.c
new file mode 100644
index 00000000000..13cd8861183
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20090206-1_0.c
@@ -0,0 +1,10 @@
+/* { dg-lto-do link } */
+/* { dg-skip-if "" { ! { i?86-*-linux* x86_64-*-linux* } } { "*" } { "" } } */
+/* { dg-lto-options {{-fPIC -r -nostdlib -fwhopr -msse2}} } */
+/* { dg-suppress-ld-options {-fPIC -msse2} } */
+
+typedef short v8hi __attribute__((__vector_size__(16)));
+void func (void) {
+ v8hi x, y, z;
+ z = __builtin_ia32_paddw128 (x, y);
+}
diff --git a/gcc/testsuite/gcc.dg/lto/20090206-2_0.c b/gcc/testsuite/gcc.dg/lto/20090206-2_0.c
new file mode 100644
index 00000000000..3e85c5d227c
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20090206-2_0.c
@@ -0,0 +1,18 @@
+/* { dg-lto-do link } */
+/* { dg-skip-if "" { ! { i?86-*-linux* x86_64-*-linux* } } { "*" } { "" } } */
+/* { dg-lto-options {{-fwhopr -fPIC}} } */
+/* { dg-suppress-ld-options {-fPIC} } */
+
+void func(int n) {
+ static int __thread v = 0;
+ int i;
+ for (i = 0; i < n; ++i) {
+ volatile int *p = &v;
+ volatile int x __attribute__ ((unused)) = *p;
+ }
+}
+
+int main(int argc, char **argv) {
+ func(argc);
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/lto/20090210_0.c b/gcc/testsuite/gcc.dg/lto/20090210_0.c
new file mode 100644
index 00000000000..c588e8a2778
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20090210_0.c
@@ -0,0 +1,6 @@
+/* { dg-lto-do run } */
+/* { dg-suppress-ld-options {-fPIC} } */
+int foo (int x)
+{
+ return x;
+}
diff --git a/gcc/testsuite/gcc.dg/lto/20090210_1.c b/gcc/testsuite/gcc.dg/lto/20090210_1.c
new file mode 100644
index 00000000000..bf12aa6c08b
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20090210_1.c
@@ -0,0 +1,22 @@
+/* { dg-options "-fPIC" } */
+static void
+f (int n)
+{
+ int i;
+ static int __thread value = 100;
+ for (i = 0; i < n; ++i)
+ {
+ volatile int *p = &value;
+ volatile int x __attribute__ ((unused)) = *p;
+ }
+}
+
+
+extern int foo (int);
+
+int
+main (int argc, char **argv)
+{
+ f (foo (4) + argc);
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/lto/20090213_0.c b/gcc/testsuite/gcc.dg/lto/20090213_0.c
new file mode 100644
index 00000000000..6387a0e4716
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20090213_0.c
@@ -0,0 +1,11 @@
+/* { dg-lto-do run } */
+#include <stdio.h>
+
+extern int foo (int);
+
+main()
+{
+ int x = foo (10);
+ printf ("x is %d, foo is at 0x%p\n", x, foo);
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/lto/20090213_1.c b/gcc/testsuite/gcc.dg/lto/20090213_1.c
new file mode 100644
index 00000000000..4a852efd193
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20090213_1.c
@@ -0,0 +1,6 @@
+int foo (int x)
+{
+ return x * 32;
+}
+
+
diff --git a/gcc/testsuite/gcc.dg/lto/20090218-1_0.c b/gcc/testsuite/gcc.dg/lto/20090218-1_0.c
new file mode 100644
index 00000000000..1dc9ee08540
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20090218-1_0.c
@@ -0,0 +1,4 @@
+void set_mem_alias_set () __attribute__ ((always_inline));
+void emit_push_insn () {
+ set_mem_alias_set ();
+}
diff --git a/gcc/testsuite/gcc.dg/lto/20090218-1_1.c b/gcc/testsuite/gcc.dg/lto/20090218-1_1.c
new file mode 100644
index 00000000000..33d4fb000f3
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20090218-1_1.c
@@ -0,0 +1,9 @@
+int main(void)
+{
+ return 0;
+}
+static void __attribute__ ((noinline)) get_mem_attrs () {
+}
+void __attribute__ ((always_inline)) set_mem_alias_set () {
+ get_mem_attrs ();
+}
diff --git a/gcc/testsuite/gcc.dg/lto/20090218-2_0.c b/gcc/testsuite/gcc.dg/lto/20090218-2_0.c
new file mode 100644
index 00000000000..8857e7a6d21
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20090218-2_0.c
@@ -0,0 +1,3 @@
+void emit_push_insn () {
+ set_mem_alias_set ();
+}
diff --git a/gcc/testsuite/gcc.dg/lto/20090218-2_1.c b/gcc/testsuite/gcc.dg/lto/20090218-2_1.c
new file mode 100644
index 00000000000..119fbe4a16b
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20090218-2_1.c
@@ -0,0 +1,19 @@
+typedef struct {
+} mem_attrs;
+int main(void)
+{
+ return 0;
+}
+void *malloc(unsigned long size);
+void *memcpy(void *dest, const void *src, unsigned long n);
+static mem_attrs * get_mem_attrs () {
+ void **slot;
+ *slot = malloc (3);
+ memcpy (*slot, 0, 3);
+}
+void set_mem_attributes () {
+ get_mem_attrs ();
+}
+void set_mem_alias_set () {
+ get_mem_attrs ();
+}
diff --git a/gcc/testsuite/gcc.dg/lto/20090218_0.c b/gcc/testsuite/gcc.dg/lto/20090218_0.c
new file mode 100644
index 00000000000..c4390fa1f10
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20090218_0.c
@@ -0,0 +1,7 @@
+void __attribute__((noinline)) *foo1(void);
+void __attribute__((noinline)) *foo2(void);
+
+int main(void)
+{
+ return foo1() != foo2();
+}
diff --git a/gcc/testsuite/gcc.dg/lto/20090218_1.c b/gcc/testsuite/gcc.dg/lto/20090218_1.c
new file mode 100644
index 00000000000..c28b84ada6e
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20090218_1.c
@@ -0,0 +1,6 @@
+void bar(void);
+void __attribute__((noinline)) *foo1 (void)
+{
+ bar();
+ return (void *) bar;
+}
diff --git a/gcc/testsuite/gcc.dg/lto/20090218_2.c b/gcc/testsuite/gcc.dg/lto/20090218_2.c
new file mode 100644
index 00000000000..e9f835f3627
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20090218_2.c
@@ -0,0 +1,6 @@
+void bar(void);
+void __attribute__((noinline)) *foo2 (void)
+{
+ bar();
+ return (void *) bar;
+}
diff --git a/gcc/testsuite/gcc.dg/lto/20090218_3.c b/gcc/testsuite/gcc.dg/lto/20090218_3.c
new file mode 100644
index 00000000000..e1f4df61479
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20090218_3.c
@@ -0,0 +1,3 @@
+void bar(void)
+{
+}
diff --git a/gcc/testsuite/gcc.dg/lto/20090219_0.c b/gcc/testsuite/gcc.dg/lto/20090219_0.c
new file mode 100644
index 00000000000..b93dd1fe946
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20090219_0.c
@@ -0,0 +1,28 @@
+/* { dg-lto-do link } */
+/* { dg-lto-options {{-O3 -fwhopr -fPIC -r -nostdlib}} } */
+
+struct Foo { int f1, f2, f3, f4, f5; };
+
+int x = 0;
+struct Foo *foo;
+
+inline void Bar(int n){
+ foo[x].f1 = 0;
+ foo[x].f2 = 0;
+ foo[x].f3 = 0;
+ foo[x].f4 = 0;
+ foo[x].f5 = n;
+}
+
+int ei[1];
+inline void Baz(int n) {
+ if (ei[n] == 1)
+ Bar (0);
+ else if (ei[n] == 0)
+ Bar (1);
+}
+
+void mumble(void) {
+ for (;;)
+ Baz (0);
+}
diff --git a/gcc/testsuite/gcc.dg/lto/20090312_0.c b/gcc/testsuite/gcc.dg/lto/20090312_0.c
new file mode 100644
index 00000000000..8aaad754cc3
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20090312_0.c
@@ -0,0 +1,43 @@
+/* { dg-lto-do link } */
+extern int **foo (void);
+extern void mumble (char*, char*, char*);
+
+static int *
+bar (char **sp)
+{
+ char *s = *sp, *rs = s;
+ int c;
+ while (*foo ()[c])
+ rs++;
+ while (c = *rs)
+ {
+ if (c || ((c == '"') || (c == '\'')))
+ {
+ if (c)
+ *rs++ = c;
+ else
+ mumble (0, "", "");
+ }
+ else if (c || (*foo ()[c] & 1))
+ *rs++ = c;
+ }
+ if (c)
+ mumble (0, "", "");
+}
+
+static void
+baz (char *s)
+{
+ char *args[100];
+ while (bar (&s))
+ {
+ mumble (args[0], "", "");
+ }
+}
+
+int
+main (void)
+{
+ baz ("");
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/lto/20090312_1.c b/gcc/testsuite/gcc.dg/lto/20090312_1.c
new file mode 100644
index 00000000000..882fb0f4157
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20090312_1.c
@@ -0,0 +1,9 @@
+int **foo (void)
+{
+
+}
+
+void mumble (char* a, char* b , char* c)
+{
+
+}
diff --git a/gcc/testsuite/gcc.dg/lto/20090313_0.c b/gcc/testsuite/gcc.dg/lto/20090313_0.c
new file mode 100644
index 00000000000..120ba3c50e0
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20090313_0.c
@@ -0,0 +1,9 @@
+void
+_cairo_clip_path_reference () {
+ int a;
+ __sync_fetch_and_add(&a, 1);
+}
+
+int main(void) {
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/lto/20090706-1_0.c b/gcc/testsuite/gcc.dg/lto/20090706-1_0.c
new file mode 100644
index 00000000000..7877fd350d7
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20090706-1_0.c
@@ -0,0 +1,42 @@
+#include <stdarg.h>
+
+extern void abort (void);
+
+void foo (int size, ...)
+{
+ struct
+ {
+ struct
+ {
+ char x[size];
+ } e;
+ unsigned r;
+ } d;
+ va_list ap;
+ char c;
+ int i;
+
+ va_start (ap, size);
+ d = va_arg (ap, typeof (d));
+ c = d.e.x[3];
+ if (c != '3')
+ abort ();
+ if (d.r != 2602)
+ abort ();
+ va_end (ap);
+}
+
+int main (void)
+{
+ int z = 5, i;
+ struct { struct { char a[z]; } y; unsigned r; } x;
+
+ x.y.a[0] = '0';
+ x.y.a[1] = '1';
+ x.y.a[2] = '2';
+ x.y.a[3] = '3';
+ x.y.a[4] = '4';
+ x.r = 2602;
+ foo (z, x);
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/lto/20090706-2_0.c b/gcc/testsuite/gcc.dg/lto/20090706-2_0.c
new file mode 100644
index 00000000000..69da98b5cca
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20090706-2_0.c
@@ -0,0 +1,16 @@
+extern void abort (void);
+
+int foo (int size)
+{
+ int a[size];
+ a[size - 10] = 42;
+ return a[size - 10] + size;
+}
+
+main()
+{
+ int x = foo (20);
+ if (x != 62)
+ abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/lto/20090717_0.c b/gcc/testsuite/gcc.dg/lto/20090717_0.c
new file mode 100644
index 00000000000..fe13bdf78d4
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20090717_0.c
@@ -0,0 +1,4 @@
+struct variable {
+ const char *string;
+};
+struct variable table[] = { };
diff --git a/gcc/testsuite/gcc.dg/lto/20090717_1.c b/gcc/testsuite/gcc.dg/lto/20090717_1.c
new file mode 100644
index 00000000000..bda8138214b
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20090717_1.c
@@ -0,0 +1,11 @@
+struct variable {
+ const char *string;
+};
+extern struct variable table[];
+int main(int argc, char *argv[])
+{
+ struct variable *p;
+ for(p = table; p->string; p++)
+ ;
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/lto/20090729_0.c b/gcc/testsuite/gcc.dg/lto/20090729_0.c
new file mode 100644
index 00000000000..05ae74f872e
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20090729_0.c
@@ -0,0 +1,4 @@
+/* { dg-lto-options "-w" } */
+
+double i;
+int j;
diff --git a/gcc/testsuite/gcc.dg/lto/20090729_1.c b/gcc/testsuite/gcc.dg/lto/20090729_1.c
new file mode 100644
index 00000000000..0a5091ac29e
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20090729_1.c
@@ -0,0 +1,4 @@
+double j;
+int i;
+int main () { return i; }
+
diff --git a/gcc/testsuite/gcc.dg/lto/20090812_0.c b/gcc/testsuite/gcc.dg/lto/20090812_0.c
new file mode 100644
index 00000000000..baf20f520a2
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20090812_0.c
@@ -0,0 +1,11 @@
+struct X;
+struct Y
+{
+ struct X *p;
+ int i;
+};
+
+void foo (struct Y *p)
+{
+ p->i = 1;
+}
diff --git a/gcc/testsuite/gcc.dg/lto/20090812_1.c b/gcc/testsuite/gcc.dg/lto/20090812_1.c
new file mode 100644
index 00000000000..e91424492a0
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20090812_1.c
@@ -0,0 +1,26 @@
+/* struct X is complete in this TU, this causes us to not merge Y and
+ thus assign different alias-sets to them. */
+struct X
+{
+ int i;
+};
+struct Y
+{
+ struct X *p;
+ int i;
+};
+extern void abort (void);
+extern void foo(struct Y *);
+int __attribute__((noinline)) bar(struct Y *p)
+{
+ p->i = 0;
+ foo (p);
+ return p->i;
+}
+int main()
+{
+ struct Y y;
+ if (bar (&y) != 1)
+ abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/lto/20090914-1_0.c b/gcc/testsuite/gcc.dg/lto/20090914-1_0.c
new file mode 100644
index 00000000000..ef9f7b35182
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20090914-1_0.c
@@ -0,0 +1,13 @@
+/* { dg-lto-do link } */
+/* { dg-lto-options {{-flto -g -fvar-tracking-assignments}} } */
+/* { dg-suppress-ld-options "-g -fvar-tracking-assignments" } */
+
+void foo()
+{
+ int hex = 0x4;
+}
+
+int main()
+{
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/lto/20090914-2_0.c b/gcc/testsuite/gcc.dg/lto/20090914-2_0.c
new file mode 100644
index 00000000000..906b3c44196
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20090914-2_0.c
@@ -0,0 +1,12 @@
+/* { dg-lto-do run } */
+/* { dg-skip-if "x86 only" { ! { x86_64-*-* i?86-*-* } } { "*" } { "" } } */
+
+/* Doesn't work without this dummy function with -fwhopr. */
+int foo(void) { }
+
+asm(".text\n"
+ ".globl main\n"
+ "\t.type main,@function\n"
+ "main:\n"
+ "\txorl %eax, %eax\n"
+ "\tret\n");
diff --git a/gcc/testsuite/gcc.dg/lto/20091005-1_0.c b/gcc/testsuite/gcc.dg/lto/20091005-1_0.c
new file mode 100644
index 00000000000..f4316efbc35
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20091005-1_0.c
@@ -0,0 +1,3 @@
+/* { dg-lto-do run } */
+
+const int i[10] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
diff --git a/gcc/testsuite/gcc.dg/lto/20091005-1_1.c b/gcc/testsuite/gcc.dg/lto/20091005-1_1.c
new file mode 100644
index 00000000000..52eb8e78b3f
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20091005-1_1.c
@@ -0,0 +1,2 @@
+extern int i[10];
+int main () { return i[0]; }
diff --git a/gcc/testsuite/gcc.dg/lto/20091005-2_0.c b/gcc/testsuite/gcc.dg/lto/20091005-2_0.c
new file mode 100644
index 00000000000..d1485d671d6
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20091005-2_0.c
@@ -0,0 +1,11 @@
+/* { dg-lto-do link } */
+/* { dg-lto-options {{-fstrict-aliasing -flto}} } */
+
+typedef struct { } t_commrec;
+typedef struct { } t_fft_c;
+void
+solve_pme(t_commrec *cr)
+{
+ t_fft_c *ptr;
+}
+int main () { return 0; }
diff --git a/gcc/testsuite/gcc.dg/lto/20091006-1_0.c b/gcc/testsuite/gcc.dg/lto/20091006-1_0.c
new file mode 100644
index 00000000000..9b4356edc22
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20091006-1_0.c
@@ -0,0 +1,14 @@
+/* { dg-lto-do link } */
+
+typedef void (*fnt) (void);
+void __attribute__((noinline)) bar (void) {}
+extern inline void check3 (void)
+{
+ bar ();
+}
+void test (void)
+{
+ const fnt pcheck3 = check3;
+ pcheck3 ();
+}
+int main() { return 0; }
diff --git a/gcc/testsuite/gcc.dg/lto/20091006-1_1.c b/gcc/testsuite/gcc.dg/lto/20091006-1_1.c
new file mode 100644
index 00000000000..f82f827002a
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20091006-1_1.c
@@ -0,0 +1,2 @@
+extern void bar (void);
+void check3 (void) { bar (); }
diff --git a/gcc/testsuite/gcc.dg/lto/20091006-2_0.c b/gcc/testsuite/gcc.dg/lto/20091006-2_0.c
new file mode 100644
index 00000000000..f8189920cfd
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20091006-2_0.c
@@ -0,0 +1,4 @@
+/* { dg-lto-do link } */
+
+extern int a[10];
+int main() { return 0; }
diff --git a/gcc/testsuite/gcc.dg/lto/20091006-2_1.c b/gcc/testsuite/gcc.dg/lto/20091006-2_1.c
new file mode 100644
index 00000000000..581839344c1
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20091006-2_1.c
@@ -0,0 +1 @@
+int a[16];
diff --git a/gcc/testsuite/gcc.dg/lto/20091006-2_2.c b/gcc/testsuite/gcc.dg/lto/20091006-2_2.c
new file mode 100644
index 00000000000..a610b2b1292
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20091006-2_2.c
@@ -0,0 +1 @@
+extern int a[14];
diff --git a/gcc/testsuite/gcc.dg/lto/20091013-1_0.c b/gcc/testsuite/gcc.dg/lto/20091013-1_0.c
new file mode 100644
index 00000000000..0fecce04f09
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20091013-1_0.c
@@ -0,0 +1,21 @@
+/* { dg-lto-do link } */
+/* { dg-lto-options {{-fPIC -r -nostdlib -flto} {-fPIC -r -nostdlib -O2 -flto}} } */
+
+void * HeapAlloc(void*,unsigned int,unsigned long);
+
+typedef struct tagGdiFont GdiFont;
+
+typedef struct tagDC {
+ int xunused;
+ GdiFont *gdiFont;
+ unsigned int font_code_page;
+} DC;
+
+DC *alloc_dc_ptr( void *funcs, unsigned short magic )
+{
+ DC *dc;
+ if (!(dc = HeapAlloc( 0, 0, sizeof(*dc) ))) return ((void *)0);
+ dc->gdiFont = 0;
+ return dc;
+}
+
diff --git a/gcc/testsuite/gcc.dg/lto/20091013-1_1.c b/gcc/testsuite/gcc.dg/lto/20091013-1_1.c
new file mode 100644
index 00000000000..68294fa62cb
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20091013-1_1.c
@@ -0,0 +1,111 @@
+typedef struct HDC__ { int unused; } *HDC;
+typedef struct HFONT__ { int unused; } *HFONT;
+
+typedef struct
+{
+ unsigned int ciACP;
+} CHARSETINFO, *PCHARSETINFO, *LPCHARSETINFO;
+
+typedef struct tagTEXTMETRICW
+{
+ int tmCharSet;
+} TEXTMETRICW, *LPTEXTMETRICW, *PTEXTMETRICW;
+
+struct gdi_obj_funcs
+{
+ void* (*pSelectObject)( void* handle, void* hdc );
+};
+
+typedef struct tagGdiFont GdiFont;
+
+typedef struct tagDC
+{
+ int xunused;
+ GdiFont *gdiFont;
+ unsigned int font_code_page;
+} DC;
+
+extern GdiFont* WineEngCreateFontInstance(DC*, HFONT);
+extern unsigned int WineEngGetTextCharsetInfo(GdiFont *font, void* fs, unsigned int flags);
+extern int WineEngGetTextMetrics(GdiFont*, LPTEXTMETRICW);
+extern void* alloc_gdi_handle( void *obj, unsigned short type, const struct gdi_obj_funcs *funcs );
+
+enum __wine_debug_class
+{
+ __WINE_DBCL_FIXME,
+ __WINE_DBCL_ERR,
+ __WINE_DBCL_WARN,
+ __WINE_DBCL_TRACE,
+
+ __WINE_DBCL_INIT = 7
+};
+
+struct __wine_debug_channel
+{
+ unsigned char flags;
+ char name[15];
+};
+
+extern int wine_dbg_log( enum __wine_debug_class cls, struct __wine_debug_channel *ch, const char *func,
+ const char *format, ... ) __attribute__((format (printf,4,5)));
+
+static struct __wine_debug_channel __wine_dbch_font = { ~0, "font" };
+static struct __wine_debug_channel * const __wine_dbch___default = &__wine_dbch_font;
+
+static void* FONT_SelectObject( void* handle, void* hdc );
+
+static const struct gdi_obj_funcs font_funcs =
+{
+ FONT_SelectObject,
+};
+
+HFONT CreateFontIndirectW( const void *plf )
+{
+ return alloc_gdi_handle( 0, 6, &font_funcs );
+}
+
+static void update_font_code_page( DC *dc )
+{
+ CHARSETINFO csi;
+ int charset = (unsigned char)1;
+
+ if (dc->gdiFont)
+ charset = WineEngGetTextCharsetInfo( dc->gdiFont, ((void *)0), 0 );
+
+ if (TranslateCharsetInfo( ((void *)(unsigned long)((unsigned long)charset)), &csi, 1) )
+ dc->font_code_page = csi.ciACP;
+ else {
+ switch(charset) {
+ case (unsigned char)1:
+ dc->font_code_page = GetACP();
+ break;
+
+ case (unsigned char)246:
+ dc->font_code_page = 0;
+ break;
+
+ default:
+ do { if((((__wine_dbch___default))->flags & (1 << __WINE_DBCL_FIXME))) { struct __wine_debug_channel * const __dbch = (__wine_dbch___default); const enum __wine_debug_class __dbcl = __WINE_DBCL_FIXME; wine_dbg_log( __dbcl, __dbch, __FUNCTION__, "Can't find codepage for charset %d\n", charset); } } while(0);
+ dc->font_code_page = 0;
+ break;
+ }
+ }
+
+ do { if((((__wine_dbch___default))->flags & (1 << __WINE_DBCL_TRACE))) { struct __wine_debug_channel * const __dbch = (__wine_dbch___default); const enum __wine_debug_class __dbcl = __WINE_DBCL_TRACE; wine_dbg_log( __dbcl, __dbch, __FUNCTION__, "charset %d => cp %d\n", charset, dc->font_code_page); } } while(0);
+}
+
+static void* FONT_SelectObject( void* handle, void* hdc )
+{
+ DC *dc;
+
+ dc->gdiFont = WineEngCreateFontInstance( dc, handle );
+ update_font_code_page( dc );
+ return 0;
+}
+
+int GetTextMetricsW( HDC hdc, TEXTMETRICW *metrics )
+{
+ DC * dc;
+ return WineEngGetTextMetrics(dc->gdiFont, metrics);
+}
+
diff --git a/gcc/testsuite/gcc.dg/lto/20091013-1_2.c b/gcc/testsuite/gcc.dg/lto/20091013-1_2.c
new file mode 100644
index 00000000000..55f8ca1b46d
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20091013-1_2.c
@@ -0,0 +1,220 @@
+typedef struct HDC__ { int unused; } *HDC;
+typedef struct HFONT__ { int unused; } *HFONT;
+
+void* HeapAlloc(void*,unsigned int,unsigned long);
+
+typedef struct tagLOGFONTW
+{
+ int lfPitchAndFamily;
+ unsigned short lfFaceName[32];
+} LOGFONTW, *PLOGFONTW, *LPLOGFONTW;
+
+typedef struct tagGdiFont GdiFont;
+typedef struct tagDC DC;
+
+extern unsigned int WineEngGetFontData(GdiFont*, unsigned int, unsigned int, void*, unsigned int);
+
+struct list
+{
+ struct list *next;
+ struct list *prev;
+};
+
+typedef struct FT_FaceRec_
+{
+ signed long face_flags;
+} FT_FaceRec, *FT_Face;
+
+typedef struct { } GM;
+
+typedef struct { } FMAT2;
+
+typedef struct {
+ unsigned int hash;
+ LOGFONTW lf;
+ int can_use_bitmap;
+} FONT_DESC;
+
+
+
+typedef struct tagHFONTLIST {
+ struct list entry;
+ HFONT hfont;
+} HFONTLIST;
+
+typedef struct {
+ struct list entry;
+ void *face;
+ GdiFont *font;
+} CHILD_FONT;
+
+
+struct tagGdiFont {
+ struct list entry;
+ GM **gm;
+ struct list hfontlist;
+ struct list child_fonts;
+
+ FT_Face ft_face;
+ FONT_DESC font_desc;
+ long ppem;
+};
+
+
+
+static struct list gdi_font_list = { &(gdi_font_list), &(gdi_font_list) };
+
+
+
+
+static int get_glyph_index_linked(GdiFont *font, unsigned int c, GdiFont **linked_font, unsigned int *glyph);
+static long load_VDMX(GdiFont*, long);
+
+extern int f1(void*,int);
+
+static FT_Face OpenFontFace(GdiFont *font, void *face, long width, long height)
+{
+ FT_Face ft_face;
+
+ font->ppem = load_VDMX(font, height);
+ if(font->ppem == 0)
+ font->ppem = f1(ft_face, height);
+ return ft_face;
+}
+
+
+static GdiFont *alloc_font(void)
+{
+ GdiFont *ret = HeapAlloc(0, 0x00000008, sizeof(*ret));
+ ret->gm = HeapAlloc(0, 0x00000008, sizeof(GM*));
+ return ret;
+}
+
+
+static long load_VDMX(GdiFont *font,long height)
+{
+ unsigned short hdr[3];
+
+ WineEngGetFontData(font, 0x42424242, 0, hdr, 6);
+ return 0;
+}
+
+static int fontcmp(const GdiFont *font, FONT_DESC *fd)
+{
+ if(font->font_desc.hash != fd->hash) return 1;
+ if(memcmp(&font->font_desc.lf, &fd->lf, __builtin_offsetof (LOGFONTW, lfFaceName))) return 1;
+ if(!font->font_desc.can_use_bitmap != !fd->can_use_bitmap) return 1;
+ return strcmpiW(font->font_desc.lf.lfFaceName, fd->lf.lfFaceName);
+}
+
+static GdiFont *find_in_cache(HFONT hfont, const LOGFONTW *plf, const FMAT2 *pmat, int can_use_bitmap)
+{
+ GdiFont *ret;
+ FONT_DESC fd;
+ HFONTLIST *hflist;
+ struct list *font_elem_ptr, *hfontlist_elem_ptr;
+
+ fd.lf = *plf;
+ fd.can_use_bitmap = can_use_bitmap;
+
+
+ for ((font_elem_ptr) = (&gdi_font_list)->next; (font_elem_ptr) != (&gdi_font_list); (font_elem_ptr) = (font_elem_ptr)->next) {
+ ret = ((struct tagGdiFont *)((char *)(font_elem_ptr) - (unsigned long)(&((struct tagGdiFont *)0)->entry)));
+ if(!fontcmp(ret, &fd)) {
+ if(!can_use_bitmap && !( ret->ft_face->face_flags & ( 1L << 0 ) )) continue;
+ for ((hfontlist_elem_ptr) = (&ret->hfontlist)->next; (hfontlist_elem_ptr) != (&ret->hfontlist); (hfontlist_elem_ptr) = (hfontlist_elem_ptr)->next) {
+ hflist = ((struct tagHFONTLIST *)((char *)(hfontlist_elem_ptr) - (unsigned long)(&((struct tagHFONTLIST *)0)->entry)));
+ if(hflist->hfont == hfont)
+ return ret;
+ }
+ hflist = HeapAlloc(0, 0, sizeof(*hflist));
+ hflist->hfont = hfont;
+ return ret;
+ }
+ }
+
+ while(font_elem_ptr) {
+ ret = ((struct tagGdiFont *)((char *)(font_elem_ptr) - (unsigned long)(&((struct tagGdiFont *)0)->entry)));
+ if(!fontcmp(ret, &fd)) {
+ if(!can_use_bitmap && !( ret->ft_face->face_flags & ( 1L << 0 ) )) continue;
+ hflist = HeapAlloc(0, 0, sizeof(*hflist));
+ hflist->hfont = hfont;
+ return ret;
+ }
+ }
+ return ((void *)0);
+}
+
+
+
+
+GdiFont *WineEngCreateFontInstance(DC *dc, HFONT hfont)
+{
+ GdiFont *ret;
+ int can_use_bitmap;
+ LOGFONTW lf;
+ FMAT2 dcmat;
+
+ if((ret = find_in_cache(hfont, &lf, &dcmat, can_use_bitmap)) != ((void *)0))
+ return ret;
+ return alloc_font();
+}
+
+extern unsigned int f(void*,unsigned int g);
+
+static unsigned int get_glyph_index(void*font, unsigned int glyph)
+{
+ return f(font, glyph);
+}
+
+unsigned int WineEngGetGlyphOutline(GdiFont *incoming_font, unsigned int glyph, unsigned int format,
+ void* lpgm, unsigned int buflen, void* buf,
+ const void* lpmat)
+{
+ unsigned int glyph_index;
+
+ get_glyph_index_linked(incoming_font, glyph, &incoming_font, &glyph_index);
+ return 0;
+}
+
+static int load_child_font(GdiFont *font, CHILD_FONT *child)
+{
+ child->font = alloc_font();
+ child->font->ft_face = OpenFontFace(child->font, child->face, 0, -font->ppem);
+ if(!child->font->ft_face)
+ return 0;
+ return 1;
+}
+
+static int get_glyph_index_linked(GdiFont *font, unsigned int c, GdiFont **linked_font, unsigned int *glyph)
+{
+ unsigned int g;
+ CHILD_FONT *child_font;
+
+ for ((child_font) = ((CHILD_FONT *)((char *)((&font->child_fonts)->next) - (unsigned long)(&((CHILD_FONT *)0)->entry))); &(child_font)->entry != (&font->child_fonts); (child_font) = ((CHILD_FONT *)((char *)((child_font)->entry.next) - (unsigned long)(&((CHILD_FONT *)0)->entry))))
+ {
+ if(!load_child_font(font, child_font))
+ continue;
+
+ g = get_glyph_index(child_font->font, c);
+ if(g) {
+ *glyph = g;
+ *linked_font = child_font->font;
+ return 1;
+ }
+ }
+ return 0;
+}
+
+unsigned int WineEngGetFontData(GdiFont *font, unsigned int table, unsigned int offset, void* buf,
+ unsigned int cbData)
+{
+ unsigned long len;
+ load_sfnt_table(font->ft_face, table, offset, buf, &len);
+ return len;
+}
+
+int WineEngGetLinkedHFont(DC *dc, unsigned short c, HFONT *new_hfont, unsigned int *glyph) {
+ return get_glyph_index_linked(0, 0, 0, 0);
+}
+
diff --git a/gcc/testsuite/gcc.dg/lto/20091014-1_0.c b/gcc/testsuite/gcc.dg/lto/20091014-1_0.c
new file mode 100644
index 00000000000..975214e0430
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20091014-1_0.c
@@ -0,0 +1,4 @@
+/* { dg-lto-do link } */
+/* { dg-lto-options {{-fPIC -r -nostdlib -flto}} } */
+
+/* Empty file. See PR41173. */
diff --git a/gcc/testsuite/gcc.dg/lto/20091015-1_0.c b/gcc/testsuite/gcc.dg/lto/20091015-1_0.c
new file mode 100644
index 00000000000..d55ebcf4042
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20091015-1_0.c
@@ -0,0 +1,5 @@
+/* { dg-lto-do link } */
+/* { dg-lto-options {{-fPIC -r -nostdlib -O2 -flto} {-fPIC -r -nostdlib -O2 -fwhopr}} } */
+
+#include "20091015-1_b.h"
+void diagnostic_initialize (FILE **stream) { *stream = stderr; }
diff --git a/gcc/testsuite/gcc.dg/lto/20091015-1_1.c b/gcc/testsuite/gcc.dg/lto/20091015-1_1.c
new file mode 100644
index 00000000000..c000518f45d
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20091015-1_1.c
@@ -0,0 +1,4 @@
+#include "20091015-1_a.h"
+#include "20091015-1_b.h"
+void ggc_print_common_statistics (FILE *stream) {
+}
diff --git a/gcc/testsuite/gcc.dg/lto/20091015-1_2.c b/gcc/testsuite/gcc.dg/lto/20091015-1_2.c
new file mode 100644
index 00000000000..fd10680866a
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20091015-1_2.c
@@ -0,0 +1,5 @@
+#include "20091015-1_a.h"
+#include "20091015-1_b.h"
+void debug_optab_libfuncs (void) {
+foo (stderr, 4 );
+}
diff --git a/gcc/testsuite/gcc.dg/lto/20091015-1_a.h b/gcc/testsuite/gcc.dg/lto/20091015-1_a.h
new file mode 100644
index 00000000000..61e56c9a95f
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20091015-1_a.h
@@ -0,0 +1,2 @@
+struct _IO_FILE { int _flags;
+};
diff --git a/gcc/testsuite/gcc.dg/lto/20091015-1_b.h b/gcc/testsuite/gcc.dg/lto/20091015-1_b.h
new file mode 100644
index 00000000000..88139027467
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20091015-1_b.h
@@ -0,0 +1,2 @@
+typedef struct _IO_FILE FILE;
+extern struct _IO_FILE *stderr;
diff --git a/gcc/testsuite/gcc.dg/lto/20091016-1_0.c b/gcc/testsuite/gcc.dg/lto/20091016-1_0.c
new file mode 100644
index 00000000000..39a04b950bf
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20091016-1_0.c
@@ -0,0 +1,13 @@
+/* { dg-lto-do link } */
+/* { dg-lto-options {{-fPIC -r -nostdlib -O2 -flto}} } */
+
+typedef struct VEC_constructor_elt_gc { } VEC_constructor_elt_gc;
+#include "20091016-1_a.h"
+struct stmt_tree_s {
+ tree x_cur_stmt_list;
+};
+void *add_stmt (struct stmt_tree_s *x)
+{
+ return &x->x_cur_stmt_list;
+}
+
diff --git a/gcc/testsuite/gcc.dg/lto/20091016-1_1.c b/gcc/testsuite/gcc.dg/lto/20091016-1_1.c
new file mode 100644
index 00000000000..06389b8e309
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20091016-1_1.c
@@ -0,0 +1,18 @@
+typedef struct VEC_constructor_elt_gcx { } VEC_constructor_elt_gc;
+#include "20091016-1_a.h"
+struct gcc_target {
+ void (* builtin_vec_perm) (tree*);
+};
+extern struct gcc_target targetm;
+void dwarf2out_begin_prologue (tree t)
+{
+ (*targetm.builtin_vec_perm) (&t);
+}
+struct die_arg_entry_struct {
+ tree arg;
+};
+void *gt_pch_p_20VEC_die_arg_entry_gc (struct die_arg_entry_struct *vec)
+{
+ return &(vec->arg);
+}
+
diff --git a/gcc/testsuite/gcc.dg/lto/20091016-1_a.h b/gcc/testsuite/gcc.dg/lto/20091016-1_a.h
new file mode 100644
index 00000000000..8eefed5cfad
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20091016-1_a.h
@@ -0,0 +1,6 @@
+typedef union tree_node *tree;
+union tree_node {
+ tree * use;
+ VEC_constructor_elt_gc *elts;
+};
+
diff --git a/gcc/testsuite/gcc.dg/lto/20091017-1_0.c b/gcc/testsuite/gcc.dg/lto/20091017-1_0.c
new file mode 100644
index 00000000000..ec4c62e4d7c
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20091017-1_0.c
@@ -0,0 +1,15 @@
+/* { dg-lto-do run } */
+
+struct X {
+ int i;
+};
+extern void foo (void *);
+extern void abort (void);
+int main ()
+{
+ struct X *p;
+ foo(&p);
+ if (p != (struct X *)0)
+ abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/lto/20091017-1_1.c b/gcc/testsuite/gcc.dg/lto/20091017-1_1.c
new file mode 100644
index 00000000000..23e5992bde6
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20091017-1_1.c
@@ -0,0 +1,6 @@
+struct X;
+void foo (void *q)
+{
+ struct X **p = (struct X **)q;
+ *p = (struct X *)0;
+}
diff --git a/gcc/testsuite/gcc.dg/lto/20091020-1_0.c b/gcc/testsuite/gcc.dg/lto/20091020-1_0.c
new file mode 100644
index 00000000000..c9bcb565d96
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20091020-1_0.c
@@ -0,0 +1,8 @@
+/* { dg-lto-do link } */
+/* { dg-lto-options {{-fPIC -r -nostdlib -flto}} } */
+
+typedef struct {
+ int NumPackStreams;
+} CSzAr;
+void cli_7unz (CSzAr db) { }
+
diff --git a/gcc/testsuite/gcc.dg/lto/20091020-1_1.c b/gcc/testsuite/gcc.dg/lto/20091020-1_1.c
new file mode 100644
index 00000000000..899183a2459
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20091020-1_1.c
@@ -0,0 +1,15 @@
+typedef struct {
+ int NumPackStreams;
+} CSzAr;
+typedef struct {
+ CSzAr db;
+} CSzArEx;
+int SzArEx_Init(CSzArEx *p)
+{
+ return p->db.NumPackStreams;
+}
+int SzArEx_GetFolderFullPackSize(const CSzArEx *p)
+{
+ return p->db.NumPackStreams;
+}
+
diff --git a/gcc/testsuite/gcc.dg/lto/20091020-2_0.c b/gcc/testsuite/gcc.dg/lto/20091020-2_0.c
new file mode 100644
index 00000000000..fb1a82bb8c6
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20091020-2_0.c
@@ -0,0 +1,18 @@
+/* { dg-lto-do link } */
+/* { dg-lto-options {{-fPIC -r -nostdlib -flto}} } */
+
+typedef struct {
+ int NumPackStreams;
+} CSzAr;
+typedef struct {
+ CSzAr db;
+} CSzArEx;
+int SzArEx_Init(CSzArEx *p)
+{
+ return p->db.NumPackStreams;
+}
+int SzArEx_GetFolderFullPackSize(const CSzArEx *p)
+{
+ return p->db.NumPackStreams;
+}
+
diff --git a/gcc/testsuite/gcc.dg/lto/20091020-2_1.c b/gcc/testsuite/gcc.dg/lto/20091020-2_1.c
new file mode 100644
index 00000000000..9174f26c35c
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20091020-2_1.c
@@ -0,0 +1,5 @@
+typedef struct {
+ int NumPackStreams;
+} CSzAr;
+void cli_7unz (CSzAr db) { }
+
diff --git a/gcc/testsuite/gcc.dg/lto/20091020-3_0.c b/gcc/testsuite/gcc.dg/lto/20091020-3_0.c
new file mode 100644
index 00000000000..441a7b91a7f
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20091020-3_0.c
@@ -0,0 +1,20 @@
+/* { dg-lto-do assemble } */
+
+typedef __SIZE_TYPE__ size_t;
+static int stack_dir;
+static void find_stack_direction ()
+{
+ static char *addr = ((void *)0);
+ auto char dummy;
+ if (addr == ((void *)0))
+ {
+ addr = &(dummy);
+ find_stack_direction ();
+ }
+}
+void * C_alloca (size_t size)
+{
+ if (stack_dir == 0)
+ find_stack_direction ();
+}
+
diff --git a/gcc/testsuite/gcc.dg/lto/20091027-1_0.c b/gcc/testsuite/gcc.dg/lto/20091027-1_0.c
new file mode 100644
index 00000000000..f2669fe0f00
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20091027-1_0.c
@@ -0,0 +1,11 @@
+/* { dg-lto-do link } */
+/* { dg-extra-ld-options "-r -nostdlib" } */
+
+typedef struct _xmlDict xmlDict;
+struct _xmlDict {
+ int ref_counter;
+};
+void xmlDictCreate(void) {
+ xmlDict * dict;
+}
+
diff --git a/gcc/testsuite/gcc.dg/lto/20091027-1_1.c b/gcc/testsuite/gcc.dg/lto/20091027-1_1.c
new file mode 100644
index 00000000000..d92394cc591
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20091027-1_1.c
@@ -0,0 +1,9 @@
+typedef struct _xmlDict xmlDict;
+struct _xmlDoc {
+ struct _xmlDict *dict;
+};
+void xmlAddEntity(struct _xmlDoc *a) {
+ xmlDict * dict = a->dict;
+ xmlHashCreateDict(0, dict);
+}
+
diff --git a/gcc/testsuite/gcc.dg/lto/README b/gcc/testsuite/gcc.dg/lto/README
new file mode 100644
index 00000000000..1a13dd92c62
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/README
@@ -0,0 +1,35 @@
+This directory contains tests for link-time optimization (LTO).
+Tests in this directory may span multiple files, so the naming of
+the files is significant.
+
+The name of every file must end with '_N' where N is an integer.
+All the files with the same name base and different _N suffixes
+will be compiled separately and linked together to form the final
+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
+suffix).
+
+For example, given the files a_0.C a_1.C a_2.C, they will be
+compiled as:
+
+$ g++ -c <flags> a_0.C
+$ g++ -c <flags> a_1.C
+$ g++ -c <flags> a_2.C
+$ 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'.
+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
+but not executed (in this case, function main() needs to exist
+but it does not need to do anything). If 'run' is used, the
+final executable is generated and the resulting binary executed.
+
+The default value for dg-lto-do is 'run'.
diff --git a/gcc/testsuite/gcc.dg/lto/lto.exp b/gcc/testsuite/gcc.dg/lto/lto.exp
new file mode 100644
index 00000000000..0e343c19b77
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/lto.exp
@@ -0,0 +1,57 @@
+# Copyright (C) 2009 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GCC; see the file COPYING3. If not see
+# <http://www.gnu.org/licenses/>.
+#
+# Contributed by Diego Novillo <dnovillo@google.com>
+
+
+# Test link-time optimization across multiple files.
+#
+# Programs are broken into multiple files. Each one is compiled
+# separately with LTO information. The final executable is generated
+# by collecting all the generated object files using regular LTO or WHOPR.
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+# Load procedures from common libraries.
+load_lib standard.exp
+load_lib gcc.exp
+
+# Load the language-independent compabibility support procedures.
+load_lib lto.exp
+
+gcc_init
+lto_init
+
+# Define an identifier for use with this suite to avoid name conflicts
+# with other lto tests running at the same time.
+set sid "c_lto"
+
+# If LTO has not been enabled, bail.
+if { ![check_effective_target_lto] } {
+ return
+}
+
+# Main loop.
+foreach src [lsort [find $srcdir/$subdir *_0.c]] {
+ # If we're only testing specific files and this isn't one of them, skip it.
+ if ![runtest_file_p $runtests $src] then {
+ continue
+ }
+
+ lto-execute $src $sid
+}
diff --git a/gcc/testsuite/gcc.dg/noncompile/pr40033-1.c b/gcc/testsuite/gcc.dg/noncompile/pr40033-1.c
new file mode 100644
index 00000000000..4f074420783
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/noncompile/pr40033-1.c
@@ -0,0 +1,7 @@
+/* ICE from error_mark_node being wrapped in a C_MAYBE_CONST_EXPR. PR
+ 40033. */
+
+void foo()
+{
+ ({ 0,; }); /* { dg-error "expected" } */
+}
diff --git a/gcc/testsuite/gcc.dg/plugin/one_time_plugin.c b/gcc/testsuite/gcc.dg/plugin/one_time_plugin.c
index 0c607bdc559..4a6a8a61969 100644
--- a/gcc/testsuite/gcc.dg/plugin/one_time_plugin.c
+++ b/gcc/testsuite/gcc.dg/plugin/one_time_plugin.c
@@ -31,7 +31,7 @@ struct gimple_opt_pass one_pass =
{
{
GIMPLE_PASS,
- "useless", /* name */
+ "cfg", /* name */
one_pass_gate, /* gate */
one_pass_exec, /* execute */
NULL, /* sub */
@@ -50,10 +50,10 @@ struct gimple_opt_pass one_pass =
int plugin_init (struct plugin_name_args *plugin_info,
struct plugin_gcc_version *version)
{
- struct plugin_pass p;
+ struct register_pass_info p;
p.pass = &one_pass.pass;
- p.reference_pass_name = "useless";
+ p.reference_pass_name = "cfg";
p.ref_pass_instance_number = 1;
p.pos_op = PASS_POS_INSERT_AFTER;
diff --git a/gcc/testsuite/gcc.dg/plugin/selfassign.c b/gcc/testsuite/gcc.dg/plugin/selfassign.c
index 13f6be9c2c1..f804222826d 100644
--- a/gcc/testsuite/gcc.dg/plugin/selfassign.c
+++ b/gcc/testsuite/gcc.dg/plugin/selfassign.c
@@ -299,7 +299,7 @@ int
plugin_init (struct plugin_name_args *plugin_info,
struct plugin_gcc_version *version)
{
- struct plugin_pass pass_info;
+ struct register_pass_info pass_info;
const char *plugin_name = plugin_info->base_name;
int argc = plugin_info->argc;
struct plugin_argument *argv = plugin_info->argv;
diff --git a/gcc/testsuite/gcc.dg/pr41340.c b/gcc/testsuite/gcc.dg/pr41340.c
new file mode 100644
index 00000000000..bafa61f5185
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr41340.c
@@ -0,0 +1,68 @@
+/* PR debug/41340 */
+/* { dg-do compile } */
+/* { dg-options "-O3 -g -fcompare-debug" } */
+/* { dg-options "-O3 -g -fcompare-debug -march=i686" { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
+
+typedef struct { int t; } *T;
+struct S1 { unsigned s1; };
+struct S2 { struct S1 s2; };
+struct S3 { unsigned s3; struct S2 **s4; };
+struct S5 { struct S2 *s5; };
+
+extern void fn0 (void) __attribute__ ((__noreturn__));
+T fn6 (struct S3);
+void fn7 (void);
+
+static inline __attribute__((always_inline)) int
+fn1 (const struct S1 *x)
+{
+ return x->s1;
+}
+
+static inline __attribute__((always_inline)) int
+fn2 (const struct S1 *x, unsigned y)
+{
+ if (y >= x->s1)
+ fn0 ();
+ return 0;
+}
+
+static inline __attribute__((always_inline)) int
+fn3 (struct S3 x)
+{
+ return (x.s3 == fn1 (*x.s4 ? &(*x.s4)->s2 : 0));
+}
+
+static inline __attribute__((always_inline)) int
+fn4 (struct S3 x)
+{
+ return fn2 (&(*x.s4)->s2, x.s3);
+}
+
+int
+fn5 (struct S3 x, T *y)
+{
+ if (!fn3 (x))
+ {
+ *y = (T) (long) fn4 (x);
+ return 1;
+ }
+ return 0;
+}
+
+void
+test (struct S5 *x)
+{
+ struct S3 a;
+ T b;
+ unsigned char c = 0;
+ a.s4 = &x->s5;
+ while (fn5 (a, &b))
+ if (!(b->t & 8))
+ c = 1;
+ a.s4 = &x->s5;
+ while ((b = fn6 (a)))
+ ;
+ if (!c)
+ fn7 ();
+}
diff --git a/gcc/testsuite/gcc.dg/pr41345.c b/gcc/testsuite/gcc.dg/pr41345.c
new file mode 100644
index 00000000000..4b146c0c202
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr41345.c
@@ -0,0 +1,14 @@
+/* PR bootstrap/41345 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -g -fcompare-debug" } */
+
+void
+foo (int *x)
+{
+ int a;
+ for (a = 0; a < 2; a++)
+ if (x[a])
+ goto lab;
+ __builtin_unreachable ();
+lab:;
+}
diff --git a/gcc/testsuite/gcc.dg/pr41573.c b/gcc/testsuite/gcc.dg/pr41573.c
new file mode 100644
index 00000000000..52961db8f22
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr41573.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+__inline __attribute__ ((__always_inline__)) char *
+strcpy (char *__dest, __const char *__src)
+{
+ return __builtin___strcpy_chk (__dest, __src, __builtin_object_size (__dest, 2 > 1));
+}
+
+const char* get_attr(unsigned attr)
+{
+ static char tmp[256];
+
+ strcpy(tmp, "");
+ return tmp;
+}
diff --git a/gcc/testsuite/gcc.dg/pr41574.c b/gcc/testsuite/gcc.dg/pr41574.c
new file mode 100644
index 00000000000..f5ddcb2fcc8
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr41574.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -march=armv7-a -mfloat-abi=softfp -mfpu=neon -fno-unsafe-math-optimizations -fdump-rtl-combine" { target { arm*-*-* } } } */
+/* { dg-options "-O2 -fno-unsafe-math-optimizations -fdump-rtl-combine" { target { ! arm*-*-* } } } */
+
+
+static const double one=1.0;
+
+double
+f(double x)
+{
+ return x*(one+x);
+}
+
+/* { dg-final { scan-rtl-dump-not "\\(plus:DF \\(mult:DF" "combine" } } */
+/* { dg-final { cleanup-rtl-dump "combine*" } } */
diff --git a/gcc/testsuite/gcc.dg/pr41762.c b/gcc/testsuite/gcc.dg/pr41762.c
new file mode 100644
index 00000000000..88d8172f288
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr41762.c
@@ -0,0 +1,31 @@
+/* PR target/41762 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftracer -fsched2-use-superblocks" } */
+/* { dg-options "-O2 -ftracer -fsched2-use-superblocks -fpic" { target fpic } } */
+
+extern __SIZE_TYPE__ strlen (const char *);
+extern int f1 (void *);
+extern char *f2 (void);
+extern void f3 (int, int);
+static char *a;
+char *b, *c, *d, *e;
+
+void
+foo (void)
+{
+ int f, g, h;
+ f = (a ? strlen (a) : strlen ("abcde"));
+ f += (b ? strlen (b) : 0);
+ f += (c ? strlen (c) : 0);
+ f += (d ? strlen (d) : 0);
+ f += (e ? strlen (e) : 0);
+ h = f1 (strlen);
+ g = strlen (a);
+ f3 (g, f);
+}
+
+void
+bar (void)
+{
+ a = f2 ();
+}
diff --git a/gcc/testsuite/gcc.dg/pr41783.c b/gcc/testsuite/gcc.dg/pr41783.c
new file mode 100644
index 00000000000..cae066be6f4
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr41783.c
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -fdump-tree-pre" } */
+int db[100];
+int a_global_var, fact;
+int main()
+{
+ int i,j=0;
+ do
+ {
+ for (i=0; i<100; ++i)
+ db[i] = i;
+ fact = a_global_var * i;
+ }
+ while (j++ < 100);
+}
+/* We want to have exactly one load (not two) from a_global_var,
+ and we want that load to be into a PRE temporary. */
+/* { dg-final { scan-tree-dump-times "= a_global_var;" 1 "pre" } } */
+/* { dg-final { scan-tree-dump "pretmp\[^\\n\]* = a_global_var;" "pre" } } */
+/* { dg-final { cleanup-tree-dump "pre" } } */
diff --git a/gcc/testsuite/gcc.dg/pr41837.c b/gcc/testsuite/gcc.dg/pr41837.c
new file mode 100644
index 00000000000..f96c3473540
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr41837.c
@@ -0,0 +1,38 @@
+/* PR middle-end/41837 */
+/* { dg-do compile } */
+/* { dg-options "-fipa-struct-reorg -O -fwhole-program -fprofile-generate" } */
+
+typedef struct { int a, b; } T1;
+typedef struct S1 *T2;
+typedef struct S2 *T3;
+typedef struct S3 *T4;
+typedef struct S4 *T5;
+struct S4 { union { int c; } d; };
+struct S2 { int e; T2 f; int g; };
+typedef struct { T3 h; } T6;
+typedef struct { int i; } *T7;
+struct S3 { T6 j; T7 k; };
+
+void
+f1 (T4 x)
+{
+ if (!x->j.h->e)
+ f5 (x);
+}
+
+void
+f2 (void)
+{
+ f6 (f1);
+}
+
+void
+f3 (T5 x, T1 *y)
+{
+}
+
+void
+f4 (void)
+{
+ f7 (f3);
+}
diff --git a/gcc/testsuite/gcc.dg/pr41841.c b/gcc/testsuite/gcc.dg/pr41841.c
new file mode 100644
index 00000000000..595bc759207
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr41841.c
@@ -0,0 +1,22 @@
+/* PR tree-optimization/41841 */
+/* { dg-do compile } */
+/* { dg-options "-O -fipa-struct-reorg -fwhole-program -fipa-cp" } */
+
+typedef struct S *T;
+typedef struct { } *U;
+extern int f1 (void);
+
+static void
+f3 (U x, int y)
+{
+ T a = (T) x;
+ y && f1 ();
+}
+
+static void
+f2 (T x)
+{
+ f3 ((U) x, 1);
+}
+
+void *volatile a __attribute__((used)) = f2;
diff --git a/gcc/testsuite/gcc.dg/pr41842.c b/gcc/testsuite/gcc.dg/pr41842.c
new file mode 100644
index 00000000000..fa7edd11ecc
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr41842.c
@@ -0,0 +1,8 @@
+/* PR c/41842 */
+/* { dg-do compile } */
+
+void
+f ()
+{
+ char x[g (h)]; /* { dg-error "undeclared|for each function" } */
+}
diff --git a/gcc/testsuite/gcc.dg/pr41935.c b/gcc/testsuite/gcc.dg/pr41935.c
new file mode 100644
index 00000000000..e6a1b28670a
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr41935.c
@@ -0,0 +1,25 @@
+/* PR middle-end/41935 */
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+
+extern void abort (void);
+struct A { int a; int b[10]; };
+
+int
+foo (struct A *p)
+{
+ return __builtin_offsetof (struct A, b[p->a]);
+}
+
+int
+main ()
+{
+ struct A a;
+ a.a = 7;
+ if (foo (&a) != 7 * sizeof (int) + __builtin_offsetof (struct A, b))
+ abort ();
+ a.a = 2;
+ if (foo (&a) != 2 * sizeof (int) + __builtin_offsetof (struct A, b))
+ abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/pr41963.c b/gcc/testsuite/gcc.dg/pr41963.c
new file mode 100644
index 00000000000..f8bf4a1b81c
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr41963.c
@@ -0,0 +1,36 @@
+/* { dg-do run } */
+/* { dg-options "-O2 -ffast-math" } */
+#include <math.h>
+
+extern float sqrtf(float);
+
+static __attribute__((noinline)) void f (float *dst, float *src)
+{
+ int i, j;
+ for (i = 0; i < 2; i++)
+ {
+ float len;
+ dst[0] = src[0];
+ dst[1] = src[1];
+ len = sqrtf (dst[0] * dst[0] + dst[1] * dst[1]);
+ if (len > 0.5f)
+ {
+ len = 1.0f / len;
+ dst[0] *= len;
+ dst[1] *= len;
+ }
+ }
+}
+
+extern void abort (void);
+
+int main()
+{
+ float dst[2], src[2];
+ src[0] = 2.0f;
+ src[1] = 5.0f;
+ f (dst, src);
+ if (fabsf (dst[0] * dst[0] + dst[1] * dst[1] - 1.0f) > 0.01f)
+ abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/raw-string-1.c b/gcc/testsuite/gcc.dg/raw-string-1.c
new file mode 100644
index 00000000000..b499e5cce69
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/raw-string-1.c
@@ -0,0 +1,101 @@
+/* { dg-do run } */
+/* { dg-options "-std=gnu99" } */
+
+#include <wchar.h>
+
+typedef __CHAR16_TYPE__ char16_t;
+typedef __CHAR32_TYPE__ char32_t;
+
+const char s0[] = R"[a\
+\u010d\U0000010D\\\'\"\?\a\b\f\n\r\t\v\0\00\000\xa\xabb
+c]";
+const char s1[] = "a\U0000010d\u010d\\\\\\'\\\"\\?\\a\\b\\f\\n\\r\\t\\v\\0\\00\\000\\xa\\xabb\nc";
+const char s2[] = R"*|*[a\
+b
+c]"
+c]*|"
+c]*|*";
+const char s3[] = "ab\nc]\"\nc]*|\"\nc";
+
+const char t0[] = u8R"[a\
+\u010d\U0000010D\\\'\"\?\a\b\f\n\r\t\v\0\00\000\xa\xabb
+c]";
+const char t1[] = u8"a\U0000010d\u010d\\\\\\'\\\"\\?\\a\\b\\f\\n\\r\\t\\v\\0\\00\\000\\xa\\xabb\nc";
+const char t2[] = u8R"*|*[a\
+b
+c]"
+c]*|"
+c]*|*";
+const char t3[] = u8"ab\nc]\"\nc]*|\"\nc";
+
+const char16_t u0[] = uR"[a\
+\u010d\U0000010D\\\'\"\?\a\b\f\n\r\t\v\0\00\000\xa\xabb
+c]";
+const char16_t u1[] = u"a\U0000010d\u010d\\\\\\'\\\"\\?\\a\\b\\f\\n\\r\\t\\v\\0\\00\\000\\xa\\xabb\nc";
+const char16_t u2[] = uR"*|*[a\
+b
+c]"
+c]*|"
+c]*|*";
+const char16_t u3[] = u"ab\nc]\"\nc]*|\"\nc";
+
+const char32_t U0[] = UR"[a\
+\u010d\U0000010D\\\'\"\?\a\b\f\n\r\t\v\0\00\000\xa\xabb
+c]";
+const char32_t U1[] = U"a\U0000010d\u010d\\\\\\'\\\"\\?\\a\\b\\f\\n\\r\\t\\v\\0\\00\\000\\xa\\xabb\nc";
+const char32_t U2[] = UR"*|*[a\
+b
+c]"
+c]*|"
+c]*|*";
+const char32_t U3[] = U"ab\nc]\"\nc]*|\"\nc";
+
+const wchar_t L0[] = LR"[a\
+\u010d\U0000010D\\\'\"\?\a\b\f\n\r\t\v\0\00\000\xa\xabb
+c]";
+const wchar_t L1[] = L"a\U0000010d\u010d\\\\\\'\\\"\\?\\a\\b\\f\\n\\r\\t\\v\\0\\00\\000\\xa\\xabb\nc";
+const wchar_t L2[] = LR"*|*[a\
+b
+c]"
+c]*|"
+c]*|*";
+const wchar_t L3[] = L"ab\nc]\"\nc]*|\"\nc";
+
+int
+main (void)
+{
+ if (sizeof (s0) != sizeof (s1)
+ || __builtin_memcmp (s0, s1, sizeof (s0)) != 0)
+ __builtin_abort ();
+ if (sizeof (s2) != sizeof (s3)
+ || __builtin_memcmp (s2, s3, sizeof (s2)) != 0)
+ __builtin_abort ();
+ if (sizeof (t0) != sizeof (t1)
+ || __builtin_memcmp (t0, t1, sizeof (t0)) != 0)
+ __builtin_abort ();
+ if (sizeof (t2) != sizeof (t3)
+ || __builtin_memcmp (t2, t3, sizeof (t2)) != 0)
+ __builtin_abort ();
+ if (sizeof (u0) != sizeof (u1)
+ || __builtin_memcmp (u0, u1, sizeof (u0)) != 0)
+ __builtin_abort ();
+ if (sizeof (u2) != sizeof (u3)
+ || __builtin_memcmp (u2, u3, sizeof (u2)) != 0)
+ __builtin_abort ();
+ if (sizeof (U0) != sizeof (U1)
+ || __builtin_memcmp (U0, U1, sizeof (U0)) != 0)
+ __builtin_abort ();
+ if (sizeof (U2) != sizeof (U3)
+ || __builtin_memcmp (U2, U3, sizeof (U2)) != 0)
+ __builtin_abort ();
+ if (sizeof (L0) != sizeof (L1)
+ || __builtin_memcmp (L0, L1, sizeof (L0)) != 0)
+ __builtin_abort ();
+ if (sizeof (L2) != sizeof (L3)
+ || __builtin_memcmp (L2, L3, sizeof (L2)) != 0)
+ __builtin_abort ();
+ if (sizeof (R"*[]*") != 1
+ || __builtin_memcmp (R"*[]*", "", 1) != 0)
+ __builtin_abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/raw-string-2.c b/gcc/testsuite/gcc.dg/raw-string-2.c
new file mode 100644
index 00000000000..533abe2bc89
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/raw-string-2.c
@@ -0,0 +1,109 @@
+/* { dg-do run } */
+/* { dg-options "-std=gnu99" } */
+
+#include <wchar.h>
+
+typedef __CHAR16_TYPE__ char16_t;
+typedef __CHAR32_TYPE__ char32_t;
+
+#define R
+#define u
+#define uR
+#define U
+#define UR
+#define u8
+#define u8R
+#define L
+#define LR
+
+const char s00[] = R"[a]" "[b]";
+const char s01[] = "[a]" R"*[b]*";
+const char s02[] = R"[a]" R"[b]";
+const char s03[] = R"-[a]-" u8"[b]";
+const char s04[] = "[a]" u8R"MNOPQRSTUVWXYZ[b]MNOPQRSTUVWXYZ";
+const char s05[] = R"[a]" u8R"wxyzABCDEFGHIJKL[b]wxyzABCDEFGHIJKL";
+const char s06[] = u8R";([a];(" "[b]";
+const char s07[] = u8"[a]" R"[b]";
+const char s08[] = u8R"[a]" R"_{}#()<>%:;.?*+-[b]_{}#()<>%:;.?*+-";
+const char s09[] = u8R"/^&|~!=,"'\[a]/^&|~!=,"'\" u8"[b]";
+const char s10[] = u8"[a]" u8R"0123456789abcdef[b]0123456789abcdef";
+const char s11[] = u8R"ghijklmnopqrstuv[a]ghijklmnopqrstuv" u8R"w[b]w";
+
+const char16_t u03[] = R"-[a]-" u"[b]";
+const char16_t u04[] = "[a]" uR"MNOPQRSTUVWXYZ[b]MNOPQRSTUVWXYZ";
+const char16_t u05[] = R"[a]" uR"wxyzABCDEFGHIJKL[b]wxyzABCDEFGHIJKL";
+const char16_t u06[] = uR";([a];(" "[b]";
+const char16_t u07[] = u"[a]" R"[b]";
+const char16_t u08[] = uR"[a]" R"_{}#()<>%:;.?*+-[b]_{}#()<>%:;.?*+-";
+const char16_t u09[] = uR"/^&|~!=,"'\[a]/^&|~!=,"'\" u"[b]";
+const char16_t u10[] = u"[a]" uR"0123456789abcdef[b]0123456789abcdef";
+const char16_t u11[] = uR"ghijklmnopqrstuv[a]ghijklmnopqrstuv" uR"w[b]w";
+
+const char32_t U03[] = R"-[a]-" U"[b]";
+const char32_t U04[] = "[a]" UR"MNOPQRSTUVWXYZ[b]MNOPQRSTUVWXYZ";
+const char32_t U05[] = R"[a]" UR"wxyzABCDEFGHIJKL[b]wxyzABCDEFGHIJKL";
+const char32_t U06[] = UR";([a];(" "[b]";
+const char32_t U07[] = U"[a]" R"[b]";
+const char32_t U08[] = UR"[a]" R"_{}#()<>%:;.?*+-[b]_{}#()<>%:;.?*+-";
+const char32_t U09[] = UR"/^&|~!=,"'\[a]/^&|~!=,"'\" U"[b]";
+const char32_t U10[] = U"[a]" UR"0123456789abcdef[b]0123456789abcdef";
+const char32_t U11[] = UR"ghijklmnopqrstuv[a]ghijklmnopqrstuv" UR"w[b]w";
+
+const wchar_t L03[] = R"-[a]-" L"[b]";
+const wchar_t L04[] = "[a]" LR"MNOPQRSTUVWXYZ[b]MNOPQRSTUVWXYZ";
+const wchar_t L05[] = R"[a]" LR"wxyzABCDEFGHIJKL[b]wxyzABCDEFGHIJKL";
+const wchar_t L06[] = LR";([a];(" "[b]";
+const wchar_t L07[] = L"[a]" R"[b]";
+const wchar_t L08[] = LR"[a]" R"_{}#()<>%:;.?*+-[b]_{}#()<>%:;.?*+-";
+const wchar_t L09[] = LR"/^&|~!=,"'\[a]/^&|~!=,"'\" L"[b]";
+const wchar_t L10[] = L"[a]" LR"0123456789abcdef[b]0123456789abcdef";
+const wchar_t L11[] = LR"ghijklmnopqrstuv[a]ghijklmnopqrstuv" LR"w[b]w";
+
+int
+main (void)
+{
+#define TEST(str, val) \
+ if (sizeof (str) != sizeof (val) \
+ || __builtin_memcmp (str, val, sizeof (str)) != 0) \
+ __builtin_abort ()
+ TEST (s00, "a[b]");
+ TEST (s01, "[a]b");
+ TEST (s02, "ab");
+ TEST (s03, "a[b]");
+ TEST (s04, "[a]b");
+ TEST (s05, "ab");
+ TEST (s06, "a[b]");
+ TEST (s07, "[a]b");
+ TEST (s08, "ab");
+ TEST (s09, "a[b]");
+ TEST (s10, "[a]b");
+ TEST (s11, "ab");
+ TEST (u03, u"a[b]");
+ TEST (u04, u"[a]b");
+ TEST (u05, u"ab");
+ TEST (u06, u"a[b]");
+ TEST (u07, u"[a]b");
+ TEST (u08, u"ab");
+ TEST (u09, u"a[b]");
+ TEST (u10, u"[a]b");
+ TEST (u11, u"ab");
+ TEST (U03, U"a[b]");
+ TEST (U04, U"[a]b");
+ TEST (U05, U"ab");
+ TEST (U06, U"a[b]");
+ TEST (U07, U"[a]b");
+ TEST (U08, U"ab");
+ TEST (U09, U"a[b]");
+ TEST (U10, U"[a]b");
+ TEST (U11, U"ab");
+ TEST (L03, L"a[b]");
+ TEST (L04, L"[a]b");
+ TEST (L05, L"ab");
+ TEST (L06, L"a[b]");
+ TEST (L07, L"[a]b");
+ TEST (L08, L"ab");
+ TEST (L09, L"a[b]");
+ TEST (L10, L"[a]b");
+ TEST (L11, L"ab");
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/raw-string-3.c b/gcc/testsuite/gcc.dg/raw-string-3.c
new file mode 100644
index 00000000000..9226411d2e0
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/raw-string-3.c
@@ -0,0 +1,53 @@
+/* If not gnu99, the {,u,u8,U,L}R prefix should be parsed as separate
+ token. */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+const void *s0 = R"[a]"; /* { dg-error "undeclared" } */
+ /* { dg-error "expected ',' or ';'" "" { target *-*-* } 6 } */
+const void *s1 = uR"[a]"; /* { dg-error "undeclared" } */
+ /* { dg-error "expected ',' or ';'" "" { target *-*-* } 8 } */
+const void *s2 = UR"[a]"; /* { dg-error "undeclared" } */
+ /* { dg-error "expected ',' or ';'" "" { target *-*-* } 10 } */
+const void *s3 = u8R"[a]"; /* { dg-error "undeclared" } */
+ /* { dg-error "expected ',' or ';'" "" { target *-*-* } 12 } */
+const void *s4 = LR"[a]"; /* { dg-error "undeclared" } */
+ /* { dg-error "expected ',' or ';'" "" { target *-*-* } 14 } */
+
+const int i0 = R'a'; /* { dg-error "expected ',' or ';'" } */
+const int i1 = uR'a'; /* { dg-error "expected ',' or ';'" } */
+const int i2 = UR'a'; /* { dg-error "expected ',' or ';'" } */
+const int i3 = u8R'a'; /* { dg-error "expected ',' or ';'" } */
+const int i4 = LR'a'; /* { dg-error "expected ',' or ';'" } */
+
+#define R "a"
+#define uR "b"
+#define UR "c"
+#define u8R "d"
+#define LR "e"
+
+const void *s5 = R"[a]";
+const void *s6 = uR"[a]";
+const void *s7 = UR"[a]";
+const void *s8 = u8R"[a]";
+const void *s9 = LR"[a]";
+
+#undef R
+#undef uR
+#undef UR
+#undef u8R
+#undef LR
+
+#define R 1 +
+#define uR 2 +
+#define UR 3 +
+#define u8R 4 +
+#define LR 5 +
+
+const int i5 = R'a';
+const int i6 = uR'a';
+const int i7 = UR'a';
+const int i8 = u8R'a';
+const int i9 = LR'a';
+
+int main () {}
diff --git a/gcc/testsuite/gcc.dg/raw-string-4.c b/gcc/testsuite/gcc.dg/raw-string-4.c
new file mode 100644
index 00000000000..24d56ed7464
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/raw-string-4.c
@@ -0,0 +1,28 @@
+/* R is not applicable for character literals. */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
+
+const int i0 = R'a'; /* { dg-error "undeclared" } */
+ /* { dg-error "expected ',' or ';'" "" { target *-*-* } 5 } */
+const int i1 = uR'a'; /* { dg-error "undeclared" } */
+ /* { dg-error "expected ',' or ';'" "" { target *-*-* } 7 } */
+const int i2 = UR'a'; /* { dg-error "undeclared" } */
+ /* { dg-error "expected ',' or ';'" "" { target *-*-* } 9 } */
+const int i3 = u8R'a'; /* { dg-error "undeclared" } */
+ /* { dg-error "expected ',' or ';'" "" { target *-*-* } 11 } */
+const int i4 = LR'a'; /* { dg-error "undeclared" } */
+ /* { dg-error "expected ',' or ';'" "" { target *-*-* } 13 } */
+
+#define R 1 +
+#define uR 2 +
+#define UR 3 +
+#define u8R 4 +
+#define LR 5 +
+
+const int i5 = R'a';
+const int i6 = uR'a';
+const int i7 = UR'a';
+const int i8 = u8R'a';
+const int i9 = LR'a';
+
+int main () {}
diff --git a/gcc/testsuite/gcc.dg/raw-string-5.c b/gcc/testsuite/gcc.dg/raw-string-5.c
new file mode 100644
index 00000000000..3dbf97ded90
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/raw-string-5.c
@@ -0,0 +1,23 @@
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
+
+const void *s0 = R"0123456789abcdefg[]0123456789abcdefg";
+ /* { dg-error "raw string delimiter longer" "" { target *-*-* } 4 } */
+ /* { dg-error "stray" "" { target *-*-* } 4 } */
+const void *s1 = R" [] ";
+ /* { dg-error "invalid character" "" { target *-*-* } 7 } */
+ /* { dg-error "stray" "" { target *-*-* } 7 } */
+const void *s2 = R" [] ";
+ /* { dg-error "invalid character" "" { target *-*-* } 10 } */
+ /* { dg-error "stray" "" { target *-*-* } 10 } */
+const void *s3 = R"][]]";
+ /* { dg-error "invalid character" "" { target *-*-* } 13 } */
+ /* { dg-error "stray" "" { target *-*-* } 13 } */
+const void *s4 = R"@[]@";
+ /* { dg-error "invalid character" "" { target *-*-* } 16 } */
+ /* { dg-error "stray" "" { target *-*-* } 16 } */
+const void *s5 = R"$[]$";
+ /* { dg-error "invalid character" "" { target *-*-* } 19 } */
+ /* { dg-error "stray" "" { target *-*-* } 19 } */
+
+int main () {}
diff --git a/gcc/testsuite/gcc.dg/raw-string-6.c b/gcc/testsuite/gcc.dg/raw-string-6.c
new file mode 100644
index 00000000000..338087a25fd
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/raw-string-6.c
@@ -0,0 +1,5 @@
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
+
+const void *s0 = R"ouch[]ouCh"; /* { dg-error "expected expression at end of input" } */
+ /* { dg-error "unterminated raw string" "" { target *-*-* } 4 } */
diff --git a/gcc/testsuite/gcc.dg/raw-string-7.c b/gcc/testsuite/gcc.dg/raw-string-7.c
new file mode 100644
index 00000000000..5bb4bec2085
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/raw-string-7.c
@@ -0,0 +1,23 @@
+/* The trailing whitespace after \ and before newline extension
+ breaks full compliance for raw strings. */
+/* { dg-do run { xfail *-*-* } } */
+/* { dg-options "-std=gnu99" } */
+
+/* Note, there is a single space after \ on the following line. */
+const void *s0 = R"[\
+]";
+/* { dg-bogus "backslash and newline separated by space" "" { xfail *-*-* } 7 } */
+
+/* Note, there is a single tab after \ on the following line. */
+const void *s1 = R"[\
+]";
+/* { dg-bogus "backslash and newline separated by space" "" { xfail *-*-* } 12 } */
+
+int
+main (void)
+{
+ if (__builtin_strcmp (s0, "\\ \n") != 0
+ || __builtin_strcmp (s1, "\\\t\n") != 0)
+ __builtin_abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/tls/pie-1.c b/gcc/testsuite/gcc.dg/tls/pie-1.c
new file mode 100644
index 00000000000..07eb5f1ad25
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tls/pie-1.c
@@ -0,0 +1,6 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target fpic } */
+/* { dg-options "-fpie" } */
+/* { dg-require-effective-target tls } */
+
+__thread int a; int b; int main() { return a = b; }
diff --git a/gcc/testsuite/gcc.dg/torture/builtin-math-6.c b/gcc/testsuite/gcc.dg/torture/builtin-math-6.c
index 1bf367a5deb..097a8c25d37 100644
--- a/gcc/testsuite/gcc.dg/torture/builtin-math-6.c
+++ b/gcc/testsuite/gcc.dg/torture/builtin-math-6.c
@@ -6,7 +6,7 @@
Origin: Kaveh R. Ghazi, January 28, 2009. */
/* { dg-do link } */
-/* { dg-require-effective-target mpc_pow } */
+/* { dg-require-effective-target mpc_arc } */
/* All references to link_error should go away at compile-time. The
first number is the line number and the second is the value number
@@ -180,9 +180,48 @@ extern void link_error(int, int);
int main (void)
{
+ TESTIT_COMPLEX (1, cacos, 1, CONJ(0));
+ TESTIT_COMPLEX_R (1, cacos, -1, CONJ(3.141593F));
+ TESTIT_COMPLEX (1, cacos, CONJ(1), 0);
+ TESTIT_COMPLEX_R (1, cacos, CONJ(-1), 3.141593F);
+ TESTIT_COMPLEX_R_ALLNEG (cacos, 3.45678F + 2.34567FI,
+ 0.60971F - 2.11780FI, 2.531875F - 2.117800FI,
+ 0.60971F + 2.11780FI, 2.531875F + 2.117800FI);
+
+ TESTIT_COMPLEX_ALLNEG (casin, 0,
+ 0, -CONJ(0), CONJ(0), CONJ(-0.F));
+ TESTIT_COMPLEX_R_ALLNEG (casin, 3.45678F + 2.34567FI,
+ 0.96107F + 2.11780FI, -0.96107F + 2.11780FI,
+ 0.96107F - 2.11780FI, -0.96107F - 2.11780FI);
+
+ TESTIT_COMPLEX_ALLNEG (catan, 0,
+ 0, -CONJ(0), CONJ(0), CONJ(-0.F));
+ TESTIT_COMPLEX_R_ALLNEG (catan, 3.45678F + 2.34567FI,
+ 1.37188F + 0.12997FI, -1.37188F + 0.12997FI,
+ 1.37188F - 0.12997FI, -1.37188F - 0.12997FI);
+
+ TESTIT_COMPLEX (1, cacosh, 1, 0);
+ TESTIT_COMPLEX_R (1, cacosh, -1, 3.141593FI);
+ TESTIT_COMPLEX (1, cacosh, CONJ(1), CONJ(0));
+ TESTIT_COMPLEX_R (1, cacosh, CONJ(-1), CONJ(3.141593FI));
+ TESTIT_COMPLEX_R_ALLNEG (cacosh, 3.45678F + 2.34567FI,
+ 2.11780F + 0.60971FI, 2.11780F + 2.531875FI,
+ 2.11780F - 0.60971FI, 2.11780F - 2.531875FI);
+
+ TESTIT_COMPLEX_ALLNEG (casinh, 0,
+ 0, -CONJ(0), CONJ(0), CONJ(-0.F));
+ TESTIT_COMPLEX_R_ALLNEG (casinh, 3.45678F + 2.34567FI,
+ 2.12836F + 0.58310FI, -2.12836F + 0.58310FI,
+ 2.12836F - 0.58310FI, -2.12836F - 0.58310FI);
+
+ TESTIT_COMPLEX_ALLNEG (catanh, 0,
+ 0, -CONJ(0), CONJ(0), CONJ(-0.F));
+ TESTIT_COMPLEX_R_ALLNEG (catanh, 3.45678F + 2.34567FI,
+ 0.19693F + 1.43190FI, -0.19693F + 1.43190FI,
+ 0.19693F - 1.43190FI, -0.19693F - 1.43190FI);
+
TESTIT_COMPLEX_ALLNEG (csin, 0,
- 0, -0.F,
- CONJ(0), CONJ(-0.F));
+ 0, -0.F, CONJ(0), CONJ(-0.F));
TESTIT_COMPLEX_R_ALLNEG (csin, 3.45678F + 2.34567FI,
-1.633059F - 4.917448FI, 1.633059F - 4.917448FI,
-1.633059F + 4.917448FI, 1.633059F + 4.917448FI);
@@ -219,8 +258,8 @@ int main (void)
TESTIT_COMPLEX (1, clog, 1, 0);
TESTIT_COMPLEX_R (1, clog, -1, 3.141593FI);
- TESTIT_COMPLEX (1, clog, CONJ(1), CONJ(0)); /* Fails with mpc-0.6. */
- TESTIT_COMPLEX_R (1, clog, CONJ(-1), CONJ(3.141593FI)); /* Fails with mpc-0.6. */
+ TESTIT_COMPLEX (1, clog, CONJ(1), CONJ(0));
+ TESTIT_COMPLEX_R (1, clog, CONJ(-1), CONJ(3.141593FI));
TESTIT_COMPLEX_R_ALLNEG (clog, 3.45678F + 2.34567FI,
1.429713F + 0.596199FI, 1.429713F + 2.545394FI,
1.429713F - 0.596199FI, 1.429713F - 2.545394FI);
diff --git a/gcc/testsuite/gcc.dg/torture/ipa-pta-1.c b/gcc/testsuite/gcc.dg/torture/ipa-pta-1.c
index 10963973c3b..7df130a1f5b 100644
--- a/gcc/testsuite/gcc.dg/torture/ipa-pta-1.c
+++ b/gcc/testsuite/gcc.dg/torture/ipa-pta-1.c
@@ -4,31 +4,37 @@
struct X { char x; char y; };
-void bar (char *p);
+char *q;
-void test1 (char a, char b, char c, char d, char e, char f, char g, char h)
+static void __attribute__((noinline))
+bar (char *p)
{
- char *p = &a;
+ q = p;
+}
+
+void test1 (char a1, char b, char c, char d, char e, char f, char g, char h)
+{
+ char *p = &a1;
p++;
bar (p);
}
-void test2 (struct X a, char b, char c, char d, char e, char f, char g, char h)
+void test2 (struct X a2, char b, char c, char d, char e, char f, char g, char h)
{
- char *p = &a.x;
+ char *p = &a2.x;
p++;
bar (p);
}
-void test3 (struct X a, char b, char c, char d, char e, char f, char g, char h)
+void test3 (struct X a3, char b, char c, char d, char e, char f, char g, char h)
{
- char *p = &a.y;
+ char *p = &a3.y;
bar (p);
}
-void test4 (int a, char b, char c, char d, char e, char f, char g, char h)
+void test4 (int a4, char b, char c, char d, char e, char f, char g, char h)
{
- char *p = (char *)&a;
+ char *p = (char *)&a4;
p++;
p++;
p++;
@@ -36,5 +42,5 @@ void test4 (int a, char b, char c, char d, char e, char f, char g, char h)
bar (p);
}
-/* { dg-final { scan-ipa-dump "bar.arg0 = { test4.arg0 test3.arg0 test2.arg0 test1.arg0 }" "pta" } } */
+/* { dg-final { scan-ipa-dump "bar.arg0 = { a4 a3 a2 a1 }" "pta" } } */
/* { dg-final { cleanup-ipa-dump "pta" } } */
diff --git a/gcc/testsuite/gcc.dg/torture/pr23821.c b/gcc/testsuite/gcc.dg/torture/pr23821.c
new file mode 100644
index 00000000000..7d425831bb8
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr23821.c
@@ -0,0 +1,29 @@
+/* { dg-do compile } */
+/* { dg-skip-if "" { *-*-* } { "-O0" } { "" } } */
+/* At -O1 DOM threads a jump in a non-optimal way which leads to
+ the bogus propagation. */
+/* { dg-skip-if "" { *-*-* } { "-O1" } { "" } } */
+/* { dg-options "-fdump-tree-ivcanon-details" } */
+
+static int a[199];
+
+extern void abort (void);
+
+int
+main ()
+{
+ int i, x;
+ for (i = 0; i < 199; i++)
+ {
+ x = a[i];
+ if (x != i)
+ abort ();
+ }
+ return 0;
+}
+
+/* Verify that we do not propagate the equivalence x == i into the
+ induction variable increment. */
+
+/* { dg-final { scan-tree-dump "Added canonical iv" "ivcanon" } } */
+/* { dg-final { cleanup-tree-dump "ivcanon" } } */
diff --git a/gcc/testsuite/gcc.dg/torture/pr26515.c b/gcc/testsuite/gcc.dg/torture/pr26515.c
new file mode 100644
index 00000000000..a051e2e53c4
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr26515.c
@@ -0,0 +1,27 @@
+/* { dg-options "-march=v10" { target cris*-*-* } } */
+struct i
+{
+ long long i_size;
+ struct a *i_mapping;
+};
+struct p
+{
+ struct a *mapping;
+ long index;
+};
+extern void b (struct p*, unsigned);
+extern void u (struct p*);
+void
+block_page_mkwrite (struct i *i, struct p *p)
+{
+ unsigned end = 0;
+ long long size = 0;
+ size = i->i_size;
+ if ((p->mapping != i->i_mapping))
+ goto out_unlock;
+ if (((p->index + 1) << 13) > size)
+ end = size & ~(~(((1UL) << 13) - 1));
+ b (p, end);
+out_unlock:
+ u (p);
+}
diff --git a/gcc/testsuite/gcc.dg/torture/pr38948.c b/gcc/testsuite/gcc.dg/torture/pr38948.c
new file mode 100644
index 00000000000..98ed493cbd7
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr38948.c
@@ -0,0 +1,101 @@
+/* { dg-options "-fno-tree-sra" } */
+/* { dg-options "-fno-tree-sra -march=v32" { target cris-*-* } } */
+typedef unsigned char byte;
+typedef unsigned int uint;
+typedef int bool;
+typedef struct gs_const_string_s
+{
+ const byte *data;
+}
+gs_const_string;
+struct gs_matrix_s
+{
+ float xx, xy, yx, yy, tx, ty;
+};
+typedef struct gs_matrix_s gs_matrix;
+typedef long fixed;
+typedef struct gs_fixed_point_s
+{
+ fixed x, y;
+}
+gs_fixed_point;
+typedef struct gs_matrix_fixed_s
+{
+ int x;
+}
+gs_matrix_fixed;
+static int
+append_simple (const byte * glyph, const gs_matrix_fixed * pmat, void * ppath)
+{
+ int numContours =
+ (int) (((((uint) ((glyph)[0]) << 8) + (glyph)[1]) ^ 0x8000) - 0x8000);
+ const byte *pends = glyph + 10;
+ int code = 0;
+ {
+ uint i = 0;
+ uint np = 0;
+ gs_fixed_point pt = {0};
+ uint reps = 0;
+ for (i = 0, np = 0; i < numContours; ++i)
+ {
+ bool move = ((bool) 1);
+ uint last_point =
+ (((uint) ((pends + i * 2)[0]) << 8) + (pends + i * 2)[1]);
+ int off_curve = 0;
+ gs_fixed_point cpoints[3];
+ for (; np <= last_point; --reps, ++np)
+ {
+ if (move)
+ {
+ cpoints[0] = pt;
+ move = ((bool) 0);
+ }
+ else
+ {
+ switch (off_curve++)
+ {
+ default:
+ cpoints[2].x = ((cpoints[1].x + pt.x) / 2);
+ cpoints[2].y = ((cpoints[1].y + pt.y) / 2);
+ code =
+ gx_path_add_curve_notes (ppath,
+ ((cpoints[0].x +
+ 2 * cpoints[1].x) / 3),
+ ((cpoints[0].y +
+ 2 * cpoints[1].y) / 3),
+ ((2 * cpoints[1].x +
+ cpoints[2].x) / 3),
+ ((2 * cpoints[1].y +
+ cpoints[2].y) / 3),
+ cpoints[2].x, cpoints[2].y,
+ 0);
+ cpoints[0] = cpoints[2];
+ case 0:
+ cpoints[1] = pt;
+ }
+ }
+ }
+ }
+ }
+}
+int
+append_outline (uint glyph_index, const gs_matrix_fixed *pmat, void *ppath)
+{
+ gs_const_string glyph_string = {0};
+ int numContours = 0;
+ numContours =
+ (int) (((((uint) ((glyph_string.data)[0]) << 8) +
+ (glyph_string.data)[1]) ^ 0x8000) - 0x8000);
+ if (numContours >= 0)
+ return append_simple (glyph_string.data, pmat, ppath);
+ {
+ uint flags = 0;
+ do
+ {
+ gs_matrix_fixed mat = {0};
+ gs_matrix scale_mat = {0};
+ gs_matrix_multiply (&scale_mat, (const gs_matrix *) &mat, (gs_matrix *) & mat);
+ }
+ while (flags & 32);
+ }
+}
diff --git a/gcc/testsuite/gcc.dg/torture/pr41555.c b/gcc/testsuite/gcc.dg/torture/pr41555.c
new file mode 100644
index 00000000000..c201fda0cea
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr41555.c
@@ -0,0 +1,119 @@
+/* { dg-do run } */
+/* { dg-options "-std=c99" } */
+
+#include <stdint.h>
+#include <limits.h>
+
+extern void abort (void);
+
+static uint64_t safe_div_func_uint64_t_u_u (uint64_t _ui1, uint64_t _ui2)
+{
+ if (_ui2==0) return _ui1;
+ return _ui1 / _ui2;
+}
+
+static int64_t safe_div_func_int64_t_s_s (int64_t _si1, int64_t _si2)
+{
+ if (_si2==0 || (_si1==INT64_MIN && _si2==-1)) return _si1;
+ return _si1 / _si2;
+}
+
+#define safe_add_macro_int8_t_s_s(si1,si2) \
+ ((((((int8_t)(si1))>((int8_t)0)) && (((int8_t)(si2))>((int8_t)0)) && (((int8_t)(si1)) > ((INT8_MAX)-((int8_t)(si2))))) \
+ || ((((int8_t)(si1))<((int8_t)0)) && (((int8_t)(si2))<((int8_t)0)) && (((int8_t)(si1)) < ((INT8_MIN)-((int8_t)(si2)))))) \
+ ? ((int8_t)(si1)) \
+ : (((int8_t)(si1)) + ((int8_t)(si2))) \
+ )
+
+static int8_t
+safe_add_func_int8_t_s_s(int8_t _si1, int8_t _si2)
+{
+ return safe_add_macro_int8_t_s_s(_si1,_si2);
+}
+
+#define safe_rshift_macro_uint64_t_u_s(left,right) \
+ (((((int)(right)) < ((uint64_t)0)) \
+ || (((int)(right)) >= sizeof(uint64_t)*CHAR_BIT)) \
+ ? ((uint64_t)(left)) \
+ : (((uint64_t)(left)) >> ((int)(right))))
+
+static uint64_t
+safe_rshift_func_uint64_t_u_s(uint64_t _left, int _right)
+{
+ return safe_rshift_macro_uint64_t_u_s(_left,_right);
+}
+
+#define safe_mul_macro_int32_t_s_s(si1,si2) \
+ ((((((int32_t)(si1)) > ((int32_t)0)) && (((int32_t)(si2)) > ((int32_t)0)) && (((int32_t)(si1)) > ((INT32_MAX) / ((int32_t)(si2))))) || \
+ ((((int32_t)(si1)) > ((int32_t)0)) && (((int32_t)(si2)) <= ((int32_t)0)) && (((int32_t)(si2)) < ((INT32_MIN) / ((int32_t)(si1))))) || \
+ ((((int32_t)(si1)) <= ((int32_t)0)) && (((int32_t)(si2)) > ((int32_t)0)) && (((int32_t)(si1)) < ((INT32_MIN) / ((int32_t)(si2))))) || \
+ ((((int32_t)(si1)) <= ((int32_t)0)) && (((int32_t)(si2)) <= ((int32_t)0)) && (((int32_t)(si1)) != ((int32_t)0)) && (((int32_t)(si2)) < ((INT32_MAX) / ((int32_t)(si1)))))) \
+ ? ((int32_t)(si1)) \
+ : ((int32_t)(si1)) * ((int32_t)(si2)))
+
+static int32_t
+safe_mul_func_int32_t_s_s (int32_t _si1, int32_t _si2)
+{
+ return safe_mul_macro_int32_t_s_s(_si1,_si2);
+}
+
+static int8_t g_39;
+static volatile uint8_t g_46;
+static uint8_t g_47;
+static uint8_t *g_62;
+static uint8_t g_79;
+static int8_t g_101 = -1L;
+static uint8_t *g_114;
+static uint8_t *g_126;
+static uint8_t g_133;
+
+static uint16_t func_35 (int32_t * p_36, uint64_t p_37, uint32_t p_38);
+static uint16_t func_35 (int32_t * p_36, uint64_t p_37, uint32_t p_38)
+{
+ if (g_62 != 0)
+ abort ();
+ for (g_39 = 1; g_39 < 0; g_39 = 1)
+ {
+ }
+ return 1;
+}
+
+static int32_t func_19 (int32_t p_20);
+static int32_t func_19 (int32_t p_20)
+{
+ if (1 !=
+ safe_div_func_uint64_t_u_u ((safe_div_func_int64_t_s_s (p_20, 1)),
+ g_101))
+ {
+ func_35 (0, 1 <= (safe_add_func_int8_t_s_s (g_47, g_46)) > p_20 < 1, 1);
+ g_133 = 1;
+ if (g_114 != 0)
+ abort ();
+ if (g_126 != 0)
+ abort ();
+ }
+ return 1;
+}
+
+static uint8_t func_2 (int32_t p_6);
+static uint8_t func_2 (int32_t p_6)
+{
+ for (1; p_6 > 1; 1)
+ return 0;
+ func_19 (g_79);
+ if (safe_mul_func_int32_t_s_s
+ ((0, 1 < (safe_rshift_func_uint64_t_u_s (1 ^ p_6, 1))),
+ (func_35 (&p_6, 1, 1) < 1)))
+ {
+ }
+ return 1;
+}
+
+int main (void)
+{
+ func_2 (1);
+ if (g_133 != 1)
+ abort ();
+ return 0;
+}
+
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/foldstring-1.c b/gcc/testsuite/gcc.dg/tree-ssa/foldstring-1.c
index 25a7ef49f8a..fa64ae14cc4 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/foldstring-1.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/foldstring-1.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O1 -fdump-tree-useless" } */
+/* { dg-options "-O1 -fdump-tree-fre" } */
void
arf ()
@@ -7,5 +7,5 @@ arf ()
if (""[0] == 0)
blah ();
}
-/* { dg-final { scan-tree-dump-times "= 0;" 1 "useless"} } */
-/* { dg-final { cleanup-tree-dump "useless" } } */
+/* { dg-final { scan-tree-dump-times "= 0;" 1 "fre"} } */
+/* { dg-final { cleanup-tree-dump "fre" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/inline-3.c b/gcc/testsuite/gcc.dg/tree-ssa/inline-3.c
index 13e27c307a4..511cc9e2562 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/inline-3.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/inline-3.c
@@ -1,6 +1,7 @@
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-einline2" } */
-/* { dg-options "-O2 -fdump-tree-einline2 -fpie" { target { ! nonpic } } } */
+/* { dg-add-options bind_pic_locally } */
+
extern void inlined ();
void inline_me_too (void);
void inline_through_me (void (*ptr)(void));
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ipa-cp-1.c b/gcc/testsuite/gcc.dg/tree-ssa/ipa-cp-1.c
index bd24446e162..b9c67a62609 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/ipa-cp-1.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/ipa-cp-1.c
@@ -1,33 +1,7 @@
/* { dg-do compile } */
/* { dg-options "-O3 -fdump-tree-optimized -fno-inline" } */
-int
-very_long_function(int a)
-{
- return very_long_function (a)/4;
-}
-main()
-{
- very_long_function (1);
-}
-/* One appereance for dump, one self recursive call and one call from main. */
-/* { dg-final { scan-tree-dump-times "very_long_function.clone.0 \\(\\)" 3 "optimized"} } */
-/* { dg-final { cleanup-tree-dump "optimized" } } */
-/* { dg-do compile } */
-/* { dg-options "-O3 -fdump-tree-optimized -fno-inline" } */
-int
-very_long_function(int a)
-{
- return very_long_function (a)/4;
-}
-main()
-{
- very_long_function (1);
-}
-/* One appereance for dump, one self recursive call and one call from main. */
-/* { dg-final { scan-tree-dump-times "very_long_function.clone.0 \\(\\)" 3 "optimized"} } */
-/* { dg-final { cleanup-tree-dump "optimized" } } */
-/* { dg-do compile } */
-/* { dg-options "-O3 -fdump-tree-optimized -fno-inline" } */
+/* { dg-add-options bind_pic_locally } */
+
int
very_long_function(int a)
{
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/local-pure-const.c b/gcc/testsuite/gcc.dg/tree-ssa/local-pure-const.c
index 065d212cb5f..afb7ca4b0df 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/local-pure-const.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/local-pure-const.c
@@ -1,6 +1,7 @@
/* { dg-do compile } */
/* { dg-options "-O1 -fdump-tree-local-pure-const1" } */
-/* { dg-options "-O1 -fdump-tree-local-pure-const1 -fpie" { target { ! nonpic } } } */
+/* { dg-add-options bind_pic_locally } */
+
t(int a, int b, int c)
{
int *p;
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr41497.c b/gcc/testsuite/gcc.dg/tree-ssa/pr41497.c
new file mode 100644
index 00000000000..e66ee846491
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr41497.c
@@ -0,0 +1,27 @@
+/* { dg-do run } */
+/* { dg-options "-Os" } */
+
+extern void abort (void);
+
+unsigned int a;
+int b, c;
+
+void
+foo (void)
+{
+ b = 0;
+ do {
+ for (a = -13; a == 0; a = (unsigned short)a)
+ c = 1;
+ b++;
+ } while (b == 0);
+}
+
+int
+main ()
+{
+ foo ();
+ if (a != -13)
+ abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/restrict-1.c b/gcc/testsuite/gcc.dg/tree-ssa/restrict-1.c
deleted file mode 100644
index 08fc10f5609..00000000000
--- a/gcc/testsuite/gcc.dg/tree-ssa/restrict-1.c
+++ /dev/null
@@ -1,20 +0,0 @@
-/* { dg-do link } */
-/* { dg-options "-O -fno-strict-aliasing -fdump-tree-optimized" } */
-
-extern void link_error (void);
-
-void bar0 (int * __restrict__ arr1, int * __restrict__ arr2)
-{
- arr1[0] = 1;
- arr2[0] = 1;
- if (arr1[0] != 1)
- link_error ();
-}
-
-int main()
-{
- return 0;
-}
-
-/* { dg-final { scan-tree-dump-not "link_error" "optimized" } } */
-/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/restrict-2.c b/gcc/testsuite/gcc.dg/tree-ssa/restrict-2.c
deleted file mode 100644
index ec824653d5f..00000000000
--- a/gcc/testsuite/gcc.dg/tree-ssa/restrict-2.c
+++ /dev/null
@@ -1,14 +0,0 @@
-/* { dg-do compile } */
-/* { dg-options "-O -fno-strict-aliasing -fdump-tree-lim-details" } */
-
-void foo (float * __restrict__ a, float * __restrict__ b, int n, int j)
-{
- int i;
- for(i = 0; i < n; ++i)
- a[i] = (b[j+50] + b[j-50]) * 0.5f;
-}
-
-/* We should move the RHS of the store out of the loop. */
-
-/* { dg-final { scan-tree-dump-times "Moving statement" 11 "lim1" } } */
-/* { dg-final { cleanup-tree-dump "lim\[1-2\]" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/restrict-4.c b/gcc/testsuite/gcc.dg/tree-ssa/restrict-4.c
deleted file mode 100644
index 3a36def25cc..00000000000
--- a/gcc/testsuite/gcc.dg/tree-ssa/restrict-4.c
+++ /dev/null
@@ -1,19 +0,0 @@
-/* { dg-do compile } */
-/* { dg-options "-O2 -fdump-tree-lim1-details" } */
-
-struct Foo
-{
- int n;
- int * __restrict__ p;
-};
-void bar(struct Foo f, int * __restrict__ q)
-{
- int i;
- for (i = 0; i < f.n; ++i)
- {
- *q += f.p[i];
- }
-}
-
-/* { dg-final { scan-tree-dump "Executing store motion" "lim1" } } */
-/* { dg-final { cleanup-tree-dump "lim1" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-23.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-23.c
index 88c8bb71eb9..6aeb06af9ee 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-23.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-23.c
@@ -9,5 +9,5 @@ void foo(int n)
global.y += global.x*global.x;
}
-/* { dg-final { scan-tree-dump "Eliminated: 2" "pre" } } */
+/* { dg-final { scan-tree-dump "Eliminated: 3" "pre" } } */
/* { dg-final { cleanup-tree-dump "pre" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-24.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-24.c
index 6729e2a297e..f91f4af74df 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-24.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-24.c
@@ -9,12 +9,7 @@ void foo(int *p, double *x, int n)
}
/* We should remove the unnecessary insertion of a phi-node and
- _not_ end up using the phi result for replacement *p.
- The issue here is that when PHI-translating the virtual operands
- we assign different value-numbers to the load. Re-running VN
- after insertion or trying to be clever and doing this on the
- fly during PHI translation would solve this. The next copyprop
- fixes this anyway. */
+ _not_ end up using the phi result for replacement *p. */
-/* { dg-final { scan-tree-dump-not "= prephitmp" "pre" { xfail *-*-* } } } */
+/* { dg-final { scan-tree-dump-not "= prephitmp" "pre" } } */
/* { dg-final { cleanup-tree-dump "pre" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-26.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-26.c
new file mode 100644
index 00000000000..978b7abab3a
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-26.c
@@ -0,0 +1,27 @@
+/* { dg-do compile } */
+/* { dg-options "-Os -fdump-tree-pre-details" } */
+
+typedef union
+{
+ int* data;
+} SA;
+
+typedef struct
+{
+ int reserved;
+ char* array;
+}SB;
+
+typedef struct
+{
+ int status;
+}SC;
+
+void foo(SA* pResult, SB* method, SC* self)
+{
+ if (method->array[0] == 'L' && !self->status && pResult->data != 0)
+ pResult->data = pResult->data;
+}
+
+/* { dg-final { scan-tree-dump "Deleted redundant store" "pre" } } */
+/* { dg-final { cleanup-tree-dump "pre" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/useless-1.c b/gcc/testsuite/gcc.dg/tree-ssa/useless-1.c
index 9170b7ca4de..68eab70046c 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/useless-1.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/useless-1.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O1 -fdump-tree-useless" } */
+/* { dg-options "-O1 -fdump-tree-gimple" } */
void
foo (void)
@@ -13,5 +13,5 @@ foo (void)
in the loop exit condition, it would be re-introduced during
GIMPLE lowering, at the cost of an extra statement, label,
and basic block. */
-/* { dg-final { scan-tree-dump-times "goto" 3 "useless"} } */
-/* { dg-final { cleanup-tree-dump "useless" } } */
+/* { dg-final { scan-tree-dump-times "goto" 3 "gimple"} } */
+/* { dg-final { cleanup-tree-dump "gimple" } } */
diff --git a/gcc/testsuite/gcc.dg/utf-badconcat2.c b/gcc/testsuite/gcc.dg/utf-badconcat2.c
new file mode 100644
index 00000000000..ea71a7f6857
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/utf-badconcat2.c
@@ -0,0 +1,15 @@
+/* Test unsupported concatenation of UTF-8 string literals. */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
+
+void *s0 = u8"a" "b";
+void *s1 = "a" u8"b";
+void *s2 = u8"a" u8"b";
+void *s3 = u8"a" u"b"; /* { dg-error "non-standard concatenation" } */
+void *s4 = u"a" u8"b"; /* { dg-error "non-standard concatenation" } */
+void *s5 = u8"a" U"b"; /* { dg-error "non-standard concatenation" } */
+void *s6 = U"a" u8"b"; /* { dg-error "non-standard concatenation" } */
+void *s7 = u8"a" L"b"; /* { dg-error "non-standard concatenation" } */
+void *s8 = L"a" u8"b"; /* { dg-error "non-standard concatenation" } */
+
+int main () {}
diff --git a/gcc/testsuite/gcc.dg/utf-dflt2.c b/gcc/testsuite/gcc.dg/utf-dflt2.c
new file mode 100644
index 00000000000..ab101f45b78
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/utf-dflt2.c
@@ -0,0 +1,12 @@
+/* If not gnu99, the u8 prefix should be parsed as separate tokens. */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+const void *s0 = u8"a"; /* { dg-error "undeclared" } */
+ /* { dg-error "expected ',' or ';'" "" { target *-*-* } 5 } */
+
+#define u8 "a"
+
+const void *s1 = u8"a";
+
+int main () {}
diff --git a/gcc/testsuite/gcc.dg/utf8-1.c b/gcc/testsuite/gcc.dg/utf8-1.c
new file mode 100644
index 00000000000..e287e065688
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/utf8-1.c
@@ -0,0 +1,45 @@
+/* { dg-do run } */
+/* { dg-require-iconv "ISO-8859-2" } */
+/* { dg-options "-std=gnu99 -fexec-charset=ISO-8859-2" } */
+
+const char *str1 = "h\u00e1\U0000010Dky ";
+const char *str2 = "\u010d\u00E1rky\n";
+const char *str3 = u8"h\u00e1\U0000010Dky ";
+const char *str4 = u8"\u010d\u00E1rky\n";
+const char *str5 = "h\u00e1\U0000010Dky " "\u010d\u00E1rky\n";
+const char *str6 = u8"h\u00e1\U0000010Dky " "\u010d\u00E1rky\n";
+const char *str7 = "h\u00e1\U0000010Dky " u8"\u010d\u00E1rky\n";
+#define u8
+const char *str8 = u8"h\u00e1\U0000010Dky " u8"\u010d\u00E1rky\n";
+
+const char latin2_1[] = "\x68\xe1\xe8\x6b\x79\x20";
+const char latin2_2[] = "\xe8\xe1\x72\x6b\x79\n";
+const char utf8_1[] = "\x68\xc3\xa1\xc4\x8d\x6b\x79\x20";
+const char utf8_2[] = "\xc4\x8d\xc3\xa1\x72\x6b\x79\n";
+
+int
+main (void)
+{
+ if (__builtin_strcmp (str1, latin2_1) != 0
+ || __builtin_strcmp (str2, latin2_2) != 0
+ || __builtin_strcmp (str3, utf8_1) != 0
+ || __builtin_strcmp (str4, utf8_2) != 0
+ || __builtin_strncmp (str5, latin2_1, sizeof (latin2_1) - 1) != 0
+ || __builtin_strcmp (str5 + sizeof (latin2_1) - 1, latin2_2) != 0
+ || __builtin_strncmp (str6, utf8_1, sizeof (utf8_1) - 1) != 0
+ || __builtin_strcmp (str6 + sizeof (utf8_1) - 1, utf8_2) != 0
+ || __builtin_strncmp (str7, utf8_1, sizeof (utf8_1) - 1) != 0
+ || __builtin_strcmp (str7 + sizeof (utf8_1) - 1, utf8_2) != 0
+ || __builtin_strncmp (str8, utf8_1, sizeof (utf8_1) - 1) != 0
+ || __builtin_strcmp (str8 + sizeof (utf8_1) - 1, utf8_2) != 0)
+ __builtin_abort ();
+ if (sizeof ("a" u8"b"[0]) != 1
+ || sizeof (u8"a" "b"[0]) != 1
+ || sizeof (u8"a" u8"b"[0]) != 1
+ || sizeof ("a" "\u010d") != 3
+ || sizeof ("a" u8"\u010d") != 4
+ || sizeof (u8"a" "\u010d") != 4
+ || sizeof (u8"a" "\u010d") != 4)
+ __builtin_abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/utf8-2.c b/gcc/testsuite/gcc.dg/utf8-2.c
new file mode 100644
index 00000000000..9c0442fde3f
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/utf8-2.c
@@ -0,0 +1,26 @@
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99" } */
+
+#include <wchar.h>
+
+typedef __CHAR16_TYPE__ char16_t;
+typedef __CHAR32_TYPE__ char32_t;
+
+const char s0[] = u8"ab";
+const char16_t s1[] = u8"ab"; /* { dg-error "from non-wide" } */
+const char32_t s2[] = u8"ab"; /* { dg-error "from non-wide" } */
+const wchar_t s3[] = u8"ab"; /* { dg-error "from non-wide" } */
+
+const char t0[0] = u8"ab"; /* { dg-warning "chars is too long" } */
+const char t1[1] = u8"ab"; /* { dg-warning "chars is too long" } */
+const char t2[2] = u8"ab";
+const char t3[3] = u8"ab";
+const char t4[4] = u8"ab";
+
+const char u0[0] = u8"\u2160."; /* { dg-warning "chars is too long" } */
+const char u1[1] = u8"\u2160."; /* { dg-warning "chars is too long" } */
+const char u2[2] = u8"\u2160."; /* { dg-warning "chars is too long" } */
+const char u3[3] = u8"\u2160."; /* { dg-warning "chars is too long" } */
+const char u4[4] = u8"\u2160.";
+const char u5[5] = u8"\u2160.";
+const char u6[6] = u8"\u2160.";
diff --git a/gcc/testsuite/gcc.dg/vect/costmodel/i386/costmodel-vect-31.c b/gcc/testsuite/gcc.dg/vect/costmodel/i386/costmodel-vect-31.c
index da7b7c3b3f8..b109be23250 100644
--- a/gcc/testsuite/gcc.dg/vect/costmodel/i386/costmodel-vect-31.c
+++ b/gcc/testsuite/gcc.dg/vect/costmodel/i386/costmodel-vect-31.c
@@ -86,8 +86,6 @@ int main (void)
return main1 ();
}
-/* { dg-final { scan-tree-dump-times "vectorization not profitable" 1 "vect" { xfail vect_hw_misalign } } }
- */
-/* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" { xfail vect_hw_misalign } } } */
-/* { dg-final { scan-tree-dump-times "vectorized 4 loops" 1 "vect" { target vect_hw_misalign } } } */
+/* { dg-final { scan-tree-dump-times "vectorization not profitable" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/costmodel/i386/costmodel-vect-33.c b/gcc/testsuite/gcc.dg/vect/costmodel/i386/costmodel-vect-33.c
index 8a14ededc25..5676b247069 100644
--- a/gcc/testsuite/gcc.dg/vect/costmodel/i386/costmodel-vect-33.c
+++ b/gcc/testsuite/gcc.dg/vect/costmodel/i386/costmodel-vect-33.c
@@ -36,5 +36,5 @@ int main (void)
return main1 ();
}
-/* { dg-final { scan-tree-dump-times "vectorization not profitable" 1 "vect" { xfail vect_hw_misalign } } } */
+/* { dg-final { scan-tree-dump-times "vectorization not profitable" 1 "vect" } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/costmodel/x86_64/costmodel-vect-31.c b/gcc/testsuite/gcc.dg/vect/costmodel/x86_64/costmodel-vect-31.c
index 4490cdc2182..b109be23250 100644
--- a/gcc/testsuite/gcc.dg/vect/costmodel/x86_64/costmodel-vect-31.c
+++ b/gcc/testsuite/gcc.dg/vect/costmodel/x86_64/costmodel-vect-31.c
@@ -86,7 +86,6 @@ int main (void)
return main1 ();
}
-/* { dg-final { scan-tree-dump-times "vectorization not profitable" 1 "vect" { xfail vect_hw_misalign } } } */
-/* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" { target {! vect_hw_misalign} } } } */
-/* { dg-final { scan-tree-dump-times "vectorized 4 loops" 1 "vect" { target {vect_hw_misalign } } } } */
+/* { dg-final { scan-tree-dump-times "vectorization not profitable" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/costmodel/x86_64/costmodel-vect-33.c b/gcc/testsuite/gcc.dg/vect/costmodel/x86_64/costmodel-vect-33.c
index 8a14ededc25..5676b247069 100644
--- a/gcc/testsuite/gcc.dg/vect/costmodel/x86_64/costmodel-vect-33.c
+++ b/gcc/testsuite/gcc.dg/vect/costmodel/x86_64/costmodel-vect-33.c
@@ -36,5 +36,5 @@ int main (void)
return main1 ();
}
-/* { dg-final { scan-tree-dump-times "vectorization not profitable" 1 "vect" { xfail vect_hw_misalign } } } */
+/* { dg-final { scan-tree-dump-times "vectorization not profitable" 1 "vect" } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-31.c b/gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-31.c
index 6060a418a3d..21b87a39677 100644
--- a/gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-31.c
+++ b/gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-31.c
@@ -87,7 +87,6 @@ int main (void)
}
/* { dg-final { scan-tree-dump-times "vectorized 4 loops" 1 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" { xfail vect_hw_misalign } } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { target vect_hw_misalign } } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 2 "vect" { xfail vect_hw_misalign } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 2 "vect" } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-64.c b/gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-64.c
index 2b6f99787c1..1ce3fa7f23b 100644
--- a/gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-64.c
+++ b/gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-64.c
@@ -83,7 +83,6 @@ int main (void)
}
/* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" { xfail vect_hw_misalign } } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { target vect_hw_misalign } } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 2 "vect" { xfail vect_hw_misalign } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 2 "vect" } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-66.c b/gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-66.c
index 78419fae851..49a9098f79f 100644
--- a/gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-66.c
+++ b/gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-66.c
@@ -78,7 +78,6 @@ int main (void)
}
/* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" { xfail vect_hw_misalign } } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { target vect_hw_misalign } } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { xfail vect_hw_misalign } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-68.c b/gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-68.c
index 19bd4f12d05..de036e88ebf 100644
--- a/gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-68.c
+++ b/gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-68.c
@@ -87,7 +87,6 @@ int main (void)
}
/* { dg-final { scan-tree-dump-times "vectorized 4 loops" 1 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" { xfail vect_hw_misalign } } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { target vect_hw_misalign } } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 2 "vect" { xfail vect_hw_misalign } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 2 "vect" } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-69.c b/gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-69.c
index 5f0aeaa9df1..cc4f26fa6c5 100644
--- a/gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-69.c
+++ b/gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-69.c
@@ -113,9 +113,8 @@ int main (void)
}
/* { dg-final { scan-tree-dump-times "vectorized 4 loops" 1 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" { xfail vect_hw_misalign } } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { target vect_hw_misalign } } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 2 "vect" { xfail { {! vector_alignment_reachable} || vect_hw_misalign } } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 2 "vect" { xfail {! vector_alignment_reachable} } } } */
/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 1 "vect" { target { {! vector_alignment_reachable} && {! vect_hw_misalign} } } } } */
/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { target { {! vector_alignment_reachable} && {! vect_hw_misalign} } } } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/slp-25.c b/gcc/testsuite/gcc.dg/vect/slp-25.c
index d10720e7d84..b660508a79c 100644
--- a/gcc/testsuite/gcc.dg/vect/slp-25.c
+++ b/gcc/testsuite/gcc.dg/vect/slp-25.c
@@ -55,7 +55,6 @@ int main (void)
}
/* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" { xfail vect_hw_misalign } } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { target vect_hw_misalign } } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 2 "vect" { xfail { vect_no_align || vect_hw_misalign } } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 2 "vect" { xfail { vect_no_align } } } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-109.c b/gcc/testsuite/gcc.dg/vect/vect-109.c
index 173b8c06970..dd9f8ea77a3 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-109.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-109.c
@@ -74,6 +74,6 @@ int main (void)
/* { dg-final { scan-tree-dump-times "vectorized 0 loops" 2 "vect" } } */
/* { dg-final { scan-tree-dump-times "not vectorized: unsupported unaligned store" 2 "vect" { xfail vect_hw_misalign } } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 3 "vect" { target vect_hw_misalign } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 10 "vect" { target vect_hw_misalign } } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-26.c b/gcc/testsuite/gcc.dg/vect/vect-26.c
index 268ed05061f..bec111b69cf 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-26.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-26.c
@@ -35,7 +35,7 @@ int main (void)
return main1 ();
}
-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { xfail {! vect_hw_misalign} } } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { xfail vect_hw_misalign } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-28.c b/gcc/testsuite/gcc.dg/vect/vect-28.c
index ddf1ee3b0ed..794a7c8f438 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-28.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-28.c
@@ -39,7 +39,7 @@ int main (void)
}
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { xfail { ! { vect_hw_misalign } } } } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { target { vector_alignment_reachable && { ! { vect_hw_misalign } } } } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { target { vector_alignment_reachable } } } } */
/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 1 "vect" { target { {! vector_alignment_reachable} && {! vect_hw_misalign} } } } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-33.c b/gcc/testsuite/gcc.dg/vect/vect-33.c
index 9ee4aecb2ea..d35bce4d6f6 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-33.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-33.c
@@ -38,7 +38,7 @@ int main (void)
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { xfail { ! { vect_hw_misalign } } } } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { target { vector_alignment_reachable && {! vect_hw_misalign} } } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { target vector_alignment_reachable } } } */
/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 1 "vect" { target { {! vector_alignment_reachable} && {! vect_hw_misalign} } } } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-42.c b/gcc/testsuite/gcc.dg/vect/vect-42.c
index ebed418e338..3ba1c6f7fde 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-42.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-42.c
@@ -65,6 +65,6 @@ int main (void)
/* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" } } */
/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 3 "vect" { target vect_no_align } } } */
/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 1 "vect" { target { { ! vector_alignment_reachable } && { ! vect_hw_misalign } } } } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 4 "vect" { xfail { { vect_no_align || vect_hw_misalign } || { ! vector_alignment_reachable } } } } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { xfail { { vect_no_align || vect_hw_misalign } || { ! vector_alignment_reachable } } } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 4 "vect" { xfail { vect_no_align || { ! vector_alignment_reachable } } } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { xfail { vect_no_align || { ! vector_alignment_reachable } } } } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-44.c b/gcc/testsuite/gcc.dg/vect/vect-44.c
index 89d09b36535..ef1a4635bfa 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-44.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-44.c
@@ -65,9 +65,8 @@ int main (void)
two loads to be aligned). */
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 3 "vect" { xfail { ! {vect_hw_misalign } } } } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { xfail { vect_no_align || vect_hw_misalign } } } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { xfail { { vect_no_align || vect_hw_misalign } || {! vector_alignment_reachable} } } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { xfail { vect_no_align } } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { xfail { vect_no_align || {! vector_alignment_reachable} } } } } */
/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning." 3 "vect" { target vect_no_align } } } */
/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning." 1 "vect" { target { {! vector_alignment_reachable} && {{! vect_no_align} && {! vect_hw_misalign} } } } } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-50.c b/gcc/testsuite/gcc.dg/vect/vect-50.c
index 70b683e1a9d..068c804a168 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-50.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-50.c
@@ -61,9 +61,9 @@ int main (void)
align the store will not force the two loads to be aligned). */
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { xfail { vect_no_align || vect_hw_misalign } } } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 3 "vect" { target vect_hw_misalign } } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { xfail { { vect_no_align || vect_hw_misalign } || {! vector_alignment_reachable} } } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { xfail { vect_no_align } } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { target vect_hw_misalign } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { xfail { vect_no_align || {! vector_alignment_reachable} } } } } */
/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning." 3 "vect" { target vect_no_align } } } */
/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning." 1 "vect" { target { {! vector_alignment_reachable} && { {! vect_no_align } && {! vect_hw_misalign } } } } } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-54.c b/gcc/testsuite/gcc.dg/vect/vect-54.c
index 85387fa6a34..629e82df59b 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-54.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-54.c
@@ -59,7 +59,6 @@ int main (void)
}
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 3 "vect" { target vect_hw_misalign } } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" { xfail vect_hw_misalign } } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { xfail vect_hw_misalign } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-56.c b/gcc/testsuite/gcc.dg/vect/vect-56.c
index e32d855d08d..7b7da123591 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-56.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-56.c
@@ -68,6 +68,6 @@ int main (void)
}
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail vect_no_align } } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { xfail vect_no_align } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { xfail { vect_no_align } } } } */
/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 0 "vect" } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-58.c b/gcc/testsuite/gcc.dg/vect/vect-58.c
index 5ceb15627fc..fa8c91b3071 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-58.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-58.c
@@ -58,7 +58,6 @@ int main (void)
}
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 3 "vect" { target vect_hw_misalign } } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" { xfail vect_hw_misalign } } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { xfail vect_hw_misalign } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-60.c b/gcc/testsuite/gcc.dg/vect/vect-60.c
index 3319e360710..cbdf63db123 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-60.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-60.c
@@ -69,6 +69,6 @@ int main (void)
}
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail vect_no_align } } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { xfail vect_no_align } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { xfail { vect_no_align } } } } */
/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 0 "vect" } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-70.c b/gcc/testsuite/gcc.dg/vect/vect-70.c
index bf206874ecd..e3ebdcab8b5 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-70.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-70.c
@@ -63,8 +63,7 @@ int main (void)
}
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" { xfail vect_hw_misalign } } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { target vect_hw_misalign } } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" {target { vector_alignment_reachable && { ! {vect_hw_misalign} } } } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" {target { vector_alignment_reachable} } } } */
/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 1 "vect" {target {{! vector_alignment_reachable} && {! vect_hw_misalign} } } } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-87.c b/gcc/testsuite/gcc.dg/vect/vect-87.c
index e7c5bbc7159..9912f19e724 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-87.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-87.c
@@ -50,8 +50,7 @@ int main (void)
/* Fails for targets that don't vectorize PLUS (e.g alpha). */
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { target vect_hw_misalign } } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" { xfail vect_hw_misalign } } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" {target { vector_alignment_reachable && {! vect_hw_misalign} } } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" {target vector_alignment_reachable} } } */
/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 1 "vect" {target { {! vector_alignment_reachable} && {! vect_hw_misalign} } } } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-88.c b/gcc/testsuite/gcc.dg/vect/vect-88.c
index 3dc5588e92d..59385465228 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-88.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-88.c
@@ -50,8 +50,7 @@ int main (void)
/* Fails for targets that don't vectorize PLUS (e.g alpha). */
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { target vect_hw_misalign } } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" { xfail vect_hw_misalign } } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" {target { vector_alignment_reachable && {! vect_hw_misalign} } } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" {target vector_alignment_reachable } } } */
/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 1 "vect" {target { {! vector_alignment_reachable} && {! vect_hw_misalign} } } } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-89.c b/gcc/testsuite/gcc.dg/vect/vect-89.c
index 4a6e7ae47f7..131efeab53a 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-89.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-89.c
@@ -45,7 +45,6 @@ int main (void)
}
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { target vect_hw_misalign } } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" { xfail vect_hw_misalign } } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { xfail vect_hw_misalign } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-91.c b/gcc/testsuite/gcc.dg/vect/vect-91.c
index c5aee4403f2..632340b0fef 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-91.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-91.c
@@ -58,8 +58,7 @@ main3 ()
}
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 3 "vect" { xfail vect_no_int_add } } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 6 "vect" { target vect_hw_misalign } } } */
/* { dg-final { scan-tree-dump-times "accesses have the same alignment." 3 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 3 "vect" {target { vector_alignment_reachable && {! vect_hw_misalign} } } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 3 "vect" {target { vector_alignment_reachable } } } } */
/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 3 "vect" {target { {! vector_alignment_reachable} && {! vect_hw_misalign} } } } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-92.c b/gcc/testsuite/gcc.dg/vect/vect-92.c
index 62aa97540f2..3a64e251cb2 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-92.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-92.c
@@ -91,7 +91,6 @@ int main (void)
}
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 3 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 9 "vect" { target vect_hw_misalign } } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" { xfail vect_hw_misalign } } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 3 "vect" { xfail vect_hw_misalign } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 3 "vect" } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-93.c b/gcc/testsuite/gcc.dg/vect/vect-93.c
index 4c41e60df0a..85666d9e699 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-93.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-93.c
@@ -71,9 +71,8 @@ int main (void)
/* main && main1 together: */
/* { dg-final { scan-tree-dump-times "vectorized 2 loops" 2 "vect" { target powerpc*-*-* i?86-*-* x86_64-*-* } } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 3 "vect" { target vect_hw_misalign } } } */
/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 2 "vect" { target { vect_no_align && {! vector_alignment_reachable} } } } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 3 "vect" { xfail { { vect_no_align || vect_hw_misalign } || {! vector_alignment_reachable} } } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 3 "vect" { xfail { { vect_no_align } || {! vector_alignment_reachable} } } } } */
/* in main1: */
/* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" { target !powerpc*-*-* !i?86-*-* !x86_64-*-* } } } */
@@ -81,6 +80,6 @@ int main (void)
/* in main: */
/* { dg-final { scan-tree-dump-times "vectorized 0 loops" 1 "vect" { target vect_no_align } } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { xfail { vect_no_align || vect_hw_misalign } } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { xfail { vect_no_align } } } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-95.c b/gcc/testsuite/gcc.dg/vect/vect-95.c
index 9f1a2c4b256..c1d5926e67d 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-95.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-95.c
@@ -56,14 +56,13 @@ int main (void)
}
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 0 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 0 "vect" { xfail {vect_hw_misalign} } } } */
/* For targets that support unaligned loads we version for the two unaligned
stores and generate misaligned accesses for the loads. For targets that
don't support unaligned loads we version for all four accesses. */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { xfail { vect_no_align || vect_hw_misalign } } } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 4 "vect" { target vect_hw_misalign } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { xfail { vect_no_align || vect_hw_misalign} } } } */
/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 2 "vect" { xfail { vect_no_align || vect_hw_misalign } } } } */
/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" { target vect_no_align } } } */
/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 4 "vect" { target vect_no_align } } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-96.c b/gcc/testsuite/gcc.dg/vect/vect-96.c
index 219c82b0897..f392169f770 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-96.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-96.c
@@ -44,6 +44,6 @@ int main (void)
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { target { {! vect_no_align} && vector_alignment_reachable } } } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { xfail { { vect_no_align || vect_hw_misalign } || {! vector_alignment_reachable} } } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { xfail { { vect_no_align } || {! vector_alignment_reachable} } } } } */
/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning." 1 "vect" { target { vect_no_align || { {! vector_alignment_reachable} && {! vect_hw_misalign} } } } } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-multitypes-1.c b/gcc/testsuite/gcc.dg/vect/vect-multitypes-1.c
index 1a0375266b0..e8fe027f5f3 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-multitypes-1.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-multitypes-1.c
@@ -78,11 +78,11 @@ int main (void)
return 0;
}
-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" { xfail {! vect_hw_misalign} } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" { xfail {! vect_hw_misalign} } } } */
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail { vect_no_align || vect_hw_misalign } } } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 2 "vect" { xfail *-*-* } } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { xfail { vect_no_align || vect_hw_misalign }} } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 4 "vect" { xfail {! vect_hw_misalign} } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 2 "vect" { xfail {! vect_hw_misalign} } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { xfail { vect_no_align || vect_hw_misalign } } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 4 "vect" { xfail *-*-* } } } */
/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { xfail { vect_no_align || vect_hw_misalign } } } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-multitypes-3.c b/gcc/testsuite/gcc.dg/vect/vect-multitypes-3.c
index ba1f6604861..3346e71e523 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-multitypes-3.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-multitypes-3.c
@@ -54,6 +54,6 @@ int main (void)
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 3 "vect" { target vect_no_align } } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 3 "vect" {xfail vect_no_align } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 3 "vect" {xfail { vect_no_align } } } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-multitypes-4.c b/gcc/testsuite/gcc.dg/vect/vect-multitypes-4.c
index f1d62f7cd0e..274fb025319 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-multitypes-4.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-multitypes-4.c
@@ -87,9 +87,9 @@ int main (void)
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" { xfail {! vect_hw_misalign} } } } */
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail { vect_no_align || vect_hw_misalign } } } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 2 "vect" { xfail *-*-* } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 2 "vect" { xfail {! vect_hw_misalign} } } } */
/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { xfail { vect_no_align || vect_hw_misalign } } } } */
/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 8 "vect" { xfail *-*-* } } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 4 "vect" { xfail vect_no_align } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 4 "vect" { xfail { vect_no_align || vect_hw_misalign } } } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-multitypes-6.c b/gcc/testsuite/gcc.dg/vect/vect-multitypes-6.c
index 7d8f5afe3e4..450855137a6 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-multitypes-6.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-multitypes-6.c
@@ -61,6 +61,6 @@ int main (void)
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 6 "vect" { target vect_no_align } } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 6 "vect" {xfail vect_no_align } } } */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 6 "vect" {xfail { vect_no_align } } } } */
/* { dg-final { cleanup-tree-dump "vect" } } */