File tree Expand file tree Collapse file tree 2 files changed +32
-1
lines changed Expand file tree Collapse file tree 2 files changed +32
-1
lines changed Original file line number Diff line number Diff line change @@ -1449,8 +1449,11 @@ struct SymbolDependenceDepth {
1449
1449
private:
1450
1450
// / Skip symbol in alias analysis.
1451
1451
bool skipSymbol (const semantics::Symbol &sym) {
1452
+ // Common block equivalences are largely managed by the front end.
1453
+ // Compiler generated symbols ('.' names) cannot be equivalenced.
1454
+ // FIXME: Equivalence code generation may need to be revisited.
1452
1455
return !sym.has <semantics::ObjectEntityDetails>() ||
1453
- lower::definedInCommonBlock (sym);
1456
+ lower::definedInCommonBlock (sym) || sym. name ()[ 0 ] == ' . ' ;
1454
1457
}
1455
1458
1456
1459
// Make sure the table is of appropriate size.
Original file line number Diff line number Diff line change @@ -31,3 +31,31 @@ SUBROUTINE s2
31
31
! CHECK: = fir.load %[[fld]] : !fir.ref<f32>
32
32
PRINT * , r(3 )
33
33
END SUBROUTINE s2
34
+
35
+ ! CHECK-LABEL: func @_QPs3
36
+ SUBROUTINE s3
37
+ REAL r(10 )
38
+ TYPE t
39
+ SEQUENCE
40
+ REAL r(10 )
41
+ END TYPE t
42
+ TYPE (t) x
43
+ ! CHECK: %[[group:.*]] = fir.alloca !fir.array<40xi8>
44
+ EQUIVALENCE (r,x)
45
+ ! CHECK: %[[coor:.*]] = fir.coordinate_of %[[group]], %c0 : (!fir.ref<!fir.array<40xi8>>, index) -> !fir.ref<i8>
46
+ ! CHECK: %[[rloc:.*]] = fir.convert %[[coor]] : (!fir.ref<i8>) -> !fir.ref<!fir.array<10xf32>>
47
+ ! CHECK: %[[xloc:.*]] = fir.convert %[[coor]] : (!fir.ref<i8>) -> !fir.ref<!fir.type<_QFs3Tt{r:!fir.array<10xf32>}>>
48
+ ! CHECK: %[[fidx:.*]] = fir.field_index r, !fir.type<_QFs3Tt{r:!fir.array<10xf32>}>
49
+ ! CHECK: %[[xrloc:.*]] = fir.coordinate_of %[[xloc]], %[[fidx]] :
50
+ ! CHECK: %[[v1loc:.*]] = fir.coordinate_of %[[xrloc]], %c8_i64 : (!fir.ref<!fir.array<10xf32>>, i64) -> !fir.ref<f32>
51
+ ! CHECK: fir.store %{{.*}} to %[[v1loc]] : !fir.ref<f32>
52
+ x% r(9 ) = 9.0
53
+ ! CHECK: %[[v2loc:.*]] = fir.coordinate_of %[[rloc]], %c8_i64 : (!fir.ref<!fir.array<10xf32>>, i64) -> !fir.ref<f32>
54
+ ! CHECK: %{{.*}} = fir.load %[[v2loc]] : !fir.ref<f32>
55
+ PRINT * , r(9 )
56
+ END SUBROUTINE s3
57
+
58
+ CALL s1
59
+ CALL s2
60
+ CALL s3
61
+ END
You can’t perform that action at this time.
0 commit comments