re PR tree-optimization/50222 (ICE with -O{1,2} -funswitch-loops -ftree-loop-distribu...
authorRichard Biener <rguenther@suse.de>
Wed, 5 Dec 2012 09:59:08 +0000 (09:59 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Wed, 5 Dec 2012 09:59:08 +0000 (09:59 +0000)
2012-12-05  Richard Biener  <rguenther@suse.de>

PR tree-optimization/50222
* gcc.dg/torture/pr50222.c: New testcase.

From-SVN: r194188

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/torture/pr50222.c [new file with mode: 0644]

index ba114ee2b3744140bf9677d25d2b08f7bbd7d1fe..b04fee3909d34b47e6f74e8d92e588fe82c288c6 100644 (file)
@@ -1,3 +1,8 @@
+2012-12-05  Richard Biener  <rguenther@suse.de>
+
+       PR tree-optimization/50222
+       * gcc.dg/torture/pr50222.c: New testcase.
+
 2012-12-05  Richard Biener  <rguenther@suse.de>
 
        PR lto/55525
diff --git a/gcc/testsuite/gcc.dg/torture/pr50222.c b/gcc/testsuite/gcc.dg/torture/pr50222.c
new file mode 100644 (file)
index 0000000..f534d89
--- /dev/null
@@ -0,0 +1,31 @@
+/* { dg-do compile } */
+/* { dg-options "-funswitch-loops -ftree-loop-distribution" } */
+
+typedef struct AVProgram {
+    void *priv_data;
+    unsigned int nb_streams;
+} AVFormatContext;
+typedef struct {
+    unsigned short flags;
+    unsigned char stream_id;
+} FrameCode;
+typedef struct {
+    FrameCode frame_code[256];
+} NUTContext;
+void build_frame_code(AVFormatContext *s, int stream_id,
+                     int is_audio, int pred_count)
+{
+  NUTContext *nut = s->priv_data;
+  int keyframe_0_esc = s->nb_streams > 2;
+  int start2 = 1 + 253*stream_id / s->nb_streams;
+  int key_frame;
+  for(key_frame=0; key_frame<2; key_frame++)
+    {
+      FrameCode *ft;
+      if (is_audio && keyframe_0_esc && key_frame==0)
+       continue;
+      ft= &nut->frame_code[start2];
+      ft->flags|= 3;
+      ft->stream_id= stream_id;
+    }
+}