]> git.pld-linux.org Git - packages/gcc.git/blob - gcc32-cfg-eh.patch
- added comment
[packages/gcc.git] / gcc32-cfg-eh.patch
1 2002-05-28  Richard Henderson  <rth@redhat.com>
2
3         * flow.c (calculate_global_regs_live): Rename call_used to
4         invalidated_by_call.  Initialize from regs_invalidated_by_call
5         instead of call_used_regs.
6
7 2002-07-20  Jakub Jelinek  <jakub@redhat.com>
8
9         * g++.dg/opt/life1.C: New test.
10
11 --- gcc/flow.c  28 May 2002 12:53:39 -0000      1.527
12 +++ gcc/flow.c  28 May 2002 20:01:29 -0000      1.528
13 @@ -1048,19 +1048,19 @@ calculate_global_regs_live (blocks_in, b
14       int flags;
15  {
16    basic_block *queue, *qhead, *qtail, *qend;
17 -  regset tmp, new_live_at_end, call_used;
18 -  regset_head tmp_head, call_used_head;
19 +  regset tmp, new_live_at_end, invalidated_by_call;
20 +  regset_head tmp_head, invalidated_by_call_head;
21    regset_head new_live_at_end_head;
22    int i;
23  
24    tmp = INITIALIZE_REG_SET (tmp_head);
25    new_live_at_end = INITIALIZE_REG_SET (new_live_at_end_head);
26 -  call_used = INITIALIZE_REG_SET (call_used_head);
27 +  invalidated_by_call = INITIALIZE_REG_SET (invalidated_by_call_head);
28  
29    /* Inconveniently, this is only readily available in hard reg set form.  */
30    for (i = 0; i < FIRST_PSEUDO_REGISTER; ++i)
31 -    if (call_used_regs[i])
32 -      SET_REGNO_REG_SET (call_used, i);
33 +    if (TEST_HARD_REG_BIT (regs_invalidated_by_call, i))
34 +      SET_REGNO_REG_SET (invalidated_by_call, i);
35  
36    /* Create a worklist.  Allocate an extra slot for ENTRY_BLOCK, and one
37       because the `head == tail' style test for an empty queue doesn't
38 @@ -1147,7 +1147,7 @@ calculate_global_regs_live (blocks_in, b
39             if (e->flags & EDGE_EH)
40               {
41                 bitmap_operation (tmp, sb->global_live_at_start,
42 -                                 call_used, BITMAP_AND_COMPL);
43 +                                 invalidated_by_call, BITMAP_AND_COMPL);
44                 IOR_REG_SET (new_live_at_end, tmp);
45               }
46             else
47 @@ -1315,7 +1315,7 @@ calculate_global_regs_live (blocks_in, b
48  
49    FREE_REG_SET (tmp);
50    FREE_REG_SET (new_live_at_end);
51 -  FREE_REG_SET (call_used);
52 +  FREE_REG_SET (invalidated_by_call);
53  
54    if (blocks_out)
55      {
56 --- gcc/testsuite/g++.dg/opt/life1.C.jj Sat Jul 20 18:57:05 2002
57 +++ gcc/testsuite/g++.dg/opt/life1.C    Sat Jul 20 19:00:01 2002
58 @@ -0,0 +1,16 @@
59 +// This testcase did not set up the pic register on IA-32 due
60 +// to bug in calculate_global_regs_live EH edge handling.
61 +// { dg-do compile { target i?86-*-linux* } }
62 +// { dg-options "-O2 -fPIC" }
63 +
64 +struct A { };
65 +
66 +void foo (A (*fn)())
67 +{
68 +  try {
69 +    A a = fn ();
70 +  } catch (...) {
71 +  }
72 +}
73 +
74 +// { dg-final { scan-assembler "GLOBAL_OFFSET_TABLE" } }
This page took 0.060674 seconds and 3 git commands to generate.