PR middle-end/28683
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 26 Aug 2006 07:31:30 +0000 (07:31 +0000)
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 26 Aug 2006 07:31:30 +0000 (07:31 +0000)
* cfgexpand.c (add_reg_br_prob_note): Check if last has exactly
3 following insns.

* gcc.c-torture/compile/20060823-1.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@116467 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/cfgexpand.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/compile/20060823-1.c [new file with mode: 0644]

index d9f6e4d..6360ec6 100644 (file)
@@ -1,3 +1,9 @@
+2006-08-26  Jakub Jelinek  <jakub@redhat.com>
+
+       PR middle-end/28683
+       * cfgexpand.c (add_reg_br_prob_note): Check if last has exactly
+       3 following insns.
+
 2006-08-25  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
 
        * flow.c (verify_wide_reg): Use internal_error for consistency failure.
index 630a82a..9839d09 100644 (file)
@@ -58,7 +58,9 @@ add_reg_br_prob_note (rtx last, int probability)
        if (!any_condjump_p (last)
            || !JUMP_P (NEXT_INSN (last))
            || !simplejump_p (NEXT_INSN (last))
+           || !NEXT_INSN (NEXT_INSN (last))
            || !BARRIER_P (NEXT_INSN (NEXT_INSN (last)))
+           || !NEXT_INSN (NEXT_INSN (NEXT_INSN (last)))
            || !LABEL_P (NEXT_INSN (NEXT_INSN (NEXT_INSN (last))))
            || NEXT_INSN (NEXT_INSN (NEXT_INSN (NEXT_INSN (last)))))
          goto failed;
index 39d2fc8..b9ddcf0 100644 (file)
@@ -1,3 +1,8 @@
+2006-08-26  Jakub Jelinek  <jakub@redhat.com>
+
+       PR middle-end/28683
+       * gcc.c-torture/compile/20060823-1.c: New test.
+
 2006-08-25  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
 
        PR c++/28853
diff --git a/gcc/testsuite/gcc.c-torture/compile/20060823-1.c b/gcc/testsuite/gcc.c-torture/compile/20060823-1.c
new file mode 100644 (file)
index 0000000..fbce7fe
--- /dev/null
@@ -0,0 +1,18 @@
+/* PR middle-end/28683 */
+
+extern void foo (int *);
+
+struct A
+{
+  int f;
+};
+
+struct A *
+test (struct A *r)
+{
+  int *f = &r->f;
+  static int i = 0;
+  if (!i && !((void *) f == (void *) r))
+    foo (&i);
+  return r;
+}