aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/loop-unswitch-1.c
diff options
context:
space:
mode:
authorZdenek Dvorak <dvorakz@suse.cz>2006-08-30 10:14:29 +0200
committerZdenek Dvorak <rakdver@gcc.gnu.org>2006-08-30 08:14:29 +0000
commitdc14f1915ccb1fb35de2c582f6cd98837cadc0b5 (patch)
tree60331baa5669c81c73c3772f0667c674953ff487 /gcc/testsuite/gcc.dg/loop-unswitch-1.c
parentb0d3a6aeb8b18937740877996a862d7dd7e65557 (diff)
downloadgcc-dc14f1915ccb1fb35de2c582f6cd98837cadc0b5.zip
gcc-dc14f1915ccb1fb35de2c582f6cd98837cadc0b5.tar.gz
gcc-dc14f1915ccb1fb35de2c582f6cd98837cadc0b5.tar.bz2
re PR rtl-optimization/27735 (ICE at -O3 caused by loop unswitching)
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. From-SVN: r116582
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 0000000..930364c
--- /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++;
+ }
+}
+