about summary refs log tree commit diff
path: root/tests/mir-opt/dont_reset_cast_kind_without_updating_operand.test.GVN.32bit.panic-abort.diff
blob: f203b80e4776cc1b0c4af24fef9d6713769b7721 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
- // MIR for `test` before GVN
+ // MIR for `test` after GVN
  
  fn test() -> () {
      let mut _0: ();
      let _1: &std::boxed::Box<()>;
      let _2: &std::boxed::Box<()>;
      let _3: std::boxed::Box<()>;
      let mut _6: *const ();
      let mut _8: *const [()];
      let mut _9: std::boxed::Box<()>;
      let mut _10: *const ();
      let mut _23: usize;
      scope 1 {
          debug vp_ctx => _1;
          let _4: *const ();
          scope 2 {
              debug slf => _10;
              let _5: *const [()];
              scope 3 {
                  debug bytes => _5;
                  let _7: *mut ();
                  scope 4 {
                      debug _x => _7;
                  }
                  scope 18 (inlined foo) {
                  }
              }
              scope 16 (inlined slice_from_raw_parts::<()>) {
                  scope 17 (inlined std::ptr::from_raw_parts::<[()], ()>) {
                  }
              }
          }
      }
      scope 5 (inlined Box::<()>::new) {
          let mut _11: usize;
          let mut _12: usize;
          let mut _13: *mut u8;
          scope 6 (inlined alloc::alloc::exchange_malloc) {
              let _14: std::alloc::Layout;
              let mut _15: std::result::Result<std::ptr::NonNull<[u8]>, std::alloc::AllocError>;
              let mut _16: isize;
              let mut _18: !;
              scope 7 {
                  let _17: std::ptr::NonNull<[u8]>;
                  scope 8 {
                      scope 11 (inlined NonNull::<[u8]>::as_mut_ptr) {
                          scope 12 (inlined NonNull::<[u8]>::as_non_null_ptr) {
                              scope 13 (inlined NonNull::<[u8]>::cast::<u8>) {
                                  let mut _22: *mut [u8];
                                  scope 14 (inlined NonNull::<[u8]>::as_ptr) {
                                  }
                              }
                          }
                          scope 15 (inlined NonNull::<u8>::as_ptr) {
                          }
                      }
                  }
                  scope 10 (inlined <std::alloc::Global as Allocator>::allocate) {
                  }
              }
              scope 9 (inlined #[track_caller] Layout::from_size_align_unchecked) {
                  let mut _19: bool;
                  let _20: ();
                  let mut _21: std::ptr::Alignment;
              }
          }
      }
  
      bb0: {
          StorageLive(_1);
          StorageLive(_2);
          StorageLive(_3);
          StorageLive(_11);
          StorageLive(_12);
          StorageLive(_13);
-         _11 = SizeOf(());
-         _12 = AlignOf(());
+         _11 = const 0_usize;
+         _12 = const 1_usize;
          StorageLive(_14);
          StorageLive(_16);
          StorageLive(_17);
          StorageLive(_19);
          _19 = const false;
-         switchInt(move _19) -> [0: bb6, otherwise: bb5];
+         switchInt(const false) -> [0: bb6, otherwise: bb5];
      }
  
      bb1: {
          StorageDead(_3);
          StorageDead(_1);
          return;
      }
  
      bb2: {
          unreachable;
      }
  
      bb3: {
-         _18 = handle_alloc_error(move _14) -> unwind unreachable;
+         _18 = handle_alloc_error(const Layout {{ size: 0_usize, align: std::ptr::Alignment(std::ptr::alignment::AlignmentEnum::_Align1Shl0) }}) -> unwind unreachable;
      }
  
      bb4: {
          _17 = copy ((_15 as Ok).0: std::ptr::NonNull<[u8]>);
          StorageLive(_22);
          _22 = copy _17 as *mut [u8] (Transmute);
          _13 = copy _22 as *mut u8 (PtrToPtr);
          StorageDead(_22);
          StorageDead(_15);
          StorageDead(_17);
          StorageDead(_16);
          StorageDead(_14);
          _3 = ShallowInitBox(copy _13, ());
          StorageDead(_13);
          StorageDead(_12);
          StorageDead(_11);
          _2 = &_3;
          _1 = copy _2;
          StorageDead(_2);
          StorageLive(_4);
-         _9 = deref_copy _3;
+         _9 = copy _3;
          _10 = copy ((_9.0: std::ptr::Unique<()>).0: std::ptr::NonNull<()>) as *const () (Transmute);
          _4 = copy _10;
-         StorageLive(_5);
+         nop;
          StorageLive(_6);
-         _6 = copy _4;
+         _6 = copy _10;
          StorageLive(_23);
          _23 = const 1_usize;
-         _5 = *const [()] from (copy _6, copy _23);
+         _5 = *const [()] from (copy _10, const 1_usize);
          StorageDead(_23);
          StorageDead(_6);
          StorageLive(_7);
          StorageLive(_8);
          _8 = copy _5;
-         _7 = copy _8 as *mut () (PtrToPtr);
+         _7 = copy ((_9.0: std::ptr::Unique<()>).0: std::ptr::NonNull<()>) as *mut () (Transmute);
          StorageDead(_8);
          StorageDead(_7);
-         StorageDead(_5);
+         nop;
          StorageDead(_4);
          drop(_3) -> [return: bb1, unwind unreachable];
      }
  
      bb5: {
-         _20 = Layout::from_size_align_unchecked::precondition_check(copy _11, copy _12) -> [return: bb6, unwind unreachable];
+         _20 = Layout::from_size_align_unchecked::precondition_check(const 0_usize, const 1_usize) -> [return: bb6, unwind unreachable];
      }
  
      bb6: {
          StorageDead(_19);
          StorageLive(_21);
-         _21 = copy _12 as std::ptr::Alignment (Transmute);
-         _14 = Layout { size: copy _11, align: move _21 };
+         _21 = const std::ptr::Alignment(std::ptr::alignment::AlignmentEnum::_Align1Shl0);
+         _14 = const Layout {{ size: 0_usize, align: std::ptr::Alignment(std::ptr::alignment::AlignmentEnum::_Align1Shl0) }};
          StorageDead(_21);
          StorageLive(_15);
-         _15 = std::alloc::Global::alloc_impl(const alloc::alloc::exchange_malloc::promoted[0], copy _14, const false) -> [return: bb7, unwind unreachable];
+         _15 = std::alloc::Global::alloc_impl(const alloc::alloc::exchange_malloc::promoted[0], const Layout {{ size: 0_usize, align: std::ptr::Alignment(std::ptr::alignment::AlignmentEnum::_Align1Shl0) }}, const false) -> [return: bb7, unwind unreachable];
      }
  
      bb7: {
          _16 = discriminant(_15);
          switchInt(move _16) -> [0: bb4, 1: bb3, otherwise: bb2];
      }
+ }
+ 
+ ALLOC0 (size: 8, align: 4) {
+     01 00 00 00 00 00 00 00                         │ ........
  }