summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/loop-unswitch-1.c
diff options
context:
space:
mode:
authorrakdver <rakdver@138bc75d-0d04-0410-961f-82ee72b054a4>2006-08-30 08:14:29 +0000
committerrakdver <rakdver@138bc75d-0d04-0410-961f-82ee72b054a4>2006-08-30 08:14:29 +0000
commitafd8eb66d431dd78ca6599c78a6048e562e18ecc (patch)
tree60331baa5669c81c73c3772f0667c674953ff487 /gcc/testsuite/gcc.dg/loop-unswitch-1.c
parentc9891f6d2ebd140d0647fce023c5e1b211e4db50 (diff)
downloadgcc-afd8eb66d431dd78ca6599c78a6048e562e18ecc.tar.gz
PR rtl-optimization/27735
* cfgloopmanip.c (fix_loop_placements, fix_bb_placements, unloop): Add new argument to keep track of whether an irreducible region was affected. All callers changed. (fix_irreducible_loops): Removed. (remove_path): Call mark_irreducible_loops if EDGE_IRREDUCIBLE_LOOP flags were invalidated. * gcc.dg/loop-unswitch-1.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@116582 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.dg/loop-unswitch-1.c')
-rw-r--r--gcc/testsuite/gcc.dg/loop-unswitch-1.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/loop-unswitch-1.c b/gcc/testsuite/gcc.dg/loop-unswitch-1.c
new file mode 100644
index 00000000000..930364c8175
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/loop-unswitch-1.c
@@ -0,0 +1,34 @@
+/* For PR rtl-optimization/27735 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -funswitch-loops" } */
+
+void set_color(void);
+void xml_colorize_line(unsigned int *p, int state)
+{
+ int c;
+ switch(state)
+ {
+ case 1:
+ goto parse_tag;
+ case 2:
+ goto parse_comment;
+ }
+
+ for(;;)
+ {
+ c = *p;
+ if (c == '<' && state == 0)
+ {
+parse_comment: ;
+ while (*p != '\n')
+ state = 3;
+parse_tag: ;
+ while (*p != '\n')
+ state = 0;
+ set_color();
+ }
+ else
+ p++;
+ }
+}
+