aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.dg
diff options
context:
space:
mode:
authorSebastian Pop <s.pop@samsung.com>2015-08-27 22:11:21 (GMT)
committerSebastian Pop <s.pop@samsung.com>2015-08-28 21:47:03 (GMT)
commit78cf0a232ee4314a9d668aab9b4b54f86b308111 (patch)
tree8a68adf2000538db7c9d499cbc2c992cd18752ef /gcc-4.9/gcc/testsuite/gcc.dg
parent59e18e04b2c6c598c06d1a0ab98a71baa830eaf2 (diff)
downloadtoolchain_gcc-78cf0a232ee4314a9d668aab9b4b54f86b308111.zip
toolchain_gcc-78cf0a232ee4314a9d668aab9b4b54f86b308111.tar.gz
toolchain_gcc-78cf0a232ee4314a9d668aab9b4b54f86b308111.tar.bz2
port revision 219584 from linaro/gcc-4_9-branch
gcc/ 2015-01-14 Yvan Roux <yvan.roux@linaro.org> Backport from trunk r218451. 2014-12-06 James Greenhalgh <james.greenhalgh@arm.com> Sebastian Pop <s.pop@samsung.com> Brian Rzycki <b.rzycki@samsung.com> PR tree-optimization/54742 * params.def (max-fsm-thread-path-insns, max-fsm-thread-length, max-fsm-thread-paths): New. * doc/invoke.texi (max-fsm-thread-path-insns, max-fsm-thread-length, max-fsm-thread-paths): Documented. * tree-cfg.c (split_edge_bb_loc): Export. * tree-cfg.h (split_edge_bb_loc): Declared extern. * tree-ssa-threadedge.c (simplify_control_stmt_condition): Restore the original value of cond when simplification fails. (fsm_find_thread_path): New. (fsm_find_control_statement_thread_paths): New. (thread_through_normal_block): Call find_control_statement_thread_paths. * tree-ssa-threadupdate.c (dump_jump_thread_path): Pretty print EDGE_FSM_THREAD. (verify_seme): New. (duplicate_seme_region): New. (thread_through_all_blocks): Generate code for EDGE_FSM_THREAD edges calling duplicate_seme_region. * tree-ssa-threadupdate.h (jump_thread_edge_type): Add EDGE_FSM_THREAD. gcc/testsuite/ 2015-01-14 Yvan Roux <yvan.roux@linaro.org> Backport from trunk r218451. 2014-12-06 James Greenhalgh <james.greenhalgh@arm.com> Sebastian Pop <s.pop@samsung.com> Brian Rzycki <b.rzycki@samsung.com> PR tree-optimization/54742 * gcc.dg/tree-ssa/ssa-dom-thread-6.c: New test. * gcc.dg/tree-ssa/ssa-dom-thread-7.c: New test.
Diffstat (limited to 'gcc-4.9/gcc/testsuite/gcc.dg')
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-6.c43
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-7.c127
2 files changed, 170 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-6.c
new file mode 100644
index 0000000..bb34a74
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-6.c
@@ -0,0 +1,43 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-dom1-details" } */
+/* { dg-final { scan-tree-dump-times "FSM" 6 "dom1" } } */
+/* { dg-final { cleanup-tree-dump "dom1" } } */
+
+int sum0, sum1, sum2, sum3;
+int foo (char *s, char **ret)
+{
+ int state=0;
+ char c;
+
+ for (; *s && state != 4; s++)
+ {
+ c = *s;
+ if (c == '*')
+ {
+ s++;
+ break;
+ }
+ switch (state)
+ {
+ case 0:
+ if (c == '+')
+ state = 1;
+ else if (c != '-')
+ sum0+=c;
+ break;
+ case 1:
+ if (c == '+')
+ state = 2;
+ else if (c == '-')
+ state = 0;
+ else
+ sum1+=c;
+ break;
+ default:
+ break;
+ }
+
+ }
+ *ret = s;
+ return state;
+}
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-7.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-7.c
new file mode 100644
index 0000000..21474f0
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-7.c
@@ -0,0 +1,127 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-dom1-details" } */
+/* { dg-final { scan-tree-dump-times "FSM" 19 "dom1" } } */
+/* { dg-final { cleanup-tree-dump "dom1" } } */
+
+enum STATE {
+ S0=0,
+ SI,
+ S1,
+ S2,
+ S3,
+ S4,
+ S5,
+ S6
+};
+
+int bar (enum STATE s);
+
+enum STATE foo (unsigned char **y, unsigned *c)
+{
+ unsigned char *x = *y;
+ unsigned char n;
+ enum STATE s = S0;
+
+ for( ; *x && s != SI; x++ )
+ {
+ n = *x;
+ if (n == 'x')
+ {
+ x++;
+ break;
+ }
+ switch(s)
+ {
+ case S0:
+ if(bar(n))
+ s = S3;
+ else if( n == 'a' || n == 'b' )
+ s = S1;
+ else if( n == 'c' )
+ s = S4;
+ else
+ {
+ s = SI;
+ c[SI]++;
+ }
+ c[S0]++;
+ break;
+ case S1:
+ if(bar(n))
+ {
+ s = S3;
+ c[S1]++;
+ }
+ else if( n == 'c' )
+ {
+ s = S4;
+ c[S1]++;
+ }
+ else
+ {
+ s = SI;
+ c[S1]++;
+ }
+ break;
+ case S3:
+ if( n == 'c' )
+ {
+ s = S4;
+ c[S3]++;
+ }
+ else if(!bar(n))
+ {
+ s = SI;
+ c[S3]++;
+ }
+ break;
+ case S4:
+ if( n == 'E' || n == 'e' )
+ {
+ s = S2;
+ c[S4]++;
+ }
+ else if(!bar(n))
+ {
+ s = SI;
+ c[S4]++;
+ }
+ break;
+ case S2:
+ if( n == 'a' || n == 'b' )
+ {
+ s = S5;
+ c[S2]++;
+ }
+ else
+ {
+ s = SI;
+ c[S2]++;
+ }
+ break;
+ case S5:
+ if(bar(n))
+ {
+ s = S6;
+ c[S5]++;
+ }
+ else
+ {
+ s = SI;
+ c[S5]++;
+ }
+ break;
+ case S6:
+ if(!bar(n))
+ {
+ s = SI;
+ c[SI]++;
+ }
+ break;
+ default:
+ break;
+ }
+ }
+ *y=x;
+ return s;
+}