[Bug fortran/94331] Bind(C) corrupts array descriptors

dominiq at lps dot ens.fr gcc-bugzilla@gcc.gnu.org
Sun May 30 17:12:23 GMT 2021


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94331

--- Comment #8 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
Easier to read warnings:

pr94331_1.f90:121:10: warning: type of 'checkb_o_ar' does not match original
declaration [-Wlto-type-mismatch]
  121 |   if(.not.checkb_o_ar(a, 0, ex-1))stop 28
      |          ^
pr94331_1.c:38:1: note: type mismatch in parameter 2
   38 | check_bounds (const CFI_cdesc_t *restrict auxp, const CFI_index_t lb,
const CFI_index_t ub)
      | ^
pr94331_1.c:38:1: note: type 'CFI_index_t' should match type 'int'
pr94331_1.f90:111:10: warning: type of 'checkb_o_as' does not match original
declaration [-Wlto-type-mismatch]
  111 |   if(.not.checkb_o_as(a, 0, ex-1))stop 20
      |          ^
pr94331_1.c:38:1: note: type mismatch in parameter 2
   38 | check_bounds (const CFI_cdesc_t *restrict auxp, const CFI_index_t lb,
const CFI_index_t ub)
      | ^
pr94331_1.c:38:1: note: type 'CFI_index_t' should match type 'int'
pr94331_1.f90:101:10: warning: type of 'checkb_p_ar' does not match original
declaration [-Wlto-type-mismatch]
  101 |   if(.not.checkb_p_ar(a, lb, ub)) stop 12
      |          ^
pr94331_1.c:38:1: note: type mismatch in parameter 2
   38 | check_bounds (const CFI_cdesc_t *restrict auxp, const CFI_index_t lb,
const CFI_index_t ub)
      | ^
pr94331_1.c:38:1: note: type 'CFI_index_t' should match type 'int'
pr94331_1.f90:91:10: warning: type of 'checkb_p_as' does not match original
declaration [-Wlto-type-mismatch]
   91 |   if(.not.checkb_p_as(a, lb, ub)) stop 4
      |          ^
pr94331_1.c:38:1: note: type mismatch in parameter 2
   38 | check_bounds (const CFI_cdesc_t *restrict auxp, const CFI_index_t lb,
const CFI_index_t ub)
      | ^
pr94331_1.c:38:1: note: type 'CFI_index_t' should match type 'int'
pr94331_1.f90:167:10: warning: type of 'checkb_a_ar' does not match original
declaration [-Wlto-type-mismatch]
  167 |   if(.not.checkb_a_ar(b, lb, ub)) stop 63
      |          ^
pr94331_1.c:38:1: note: type mismatch in parameter 2
   38 | check_bounds (const CFI_cdesc_t *restrict auxp, const CFI_index_t lb,
const CFI_index_t ub)
      | ^
pr94331_1.c:38:1: note: type 'CFI_index_t' should match type 'int'
pr94331_1.f90:155:10: warning: type of 'checkb_a_as' does not match original
declaration [-Wlto-type-mismatch]
  155 |   if(.not.checkb_a_as(b, lb, ub)) stop 54
      |          ^
pr94331_1.c:38:1: note: type mismatch in parameter 2
   38 | check_bounds (const CFI_cdesc_t *restrict auxp, const CFI_index_t lb,
const CFI_index_t ub)
      | ^
pr94331_1.c:38:1: note: type 'CFI_index_t' should match type 'int'
pr94331_1.c:38:1: note: 'check_bounds' was previously declared here
pr94331_1.c:38:1: note: code may be misoptimized unless '-fno-strict-aliasing'
is used

Note that the test passes with -Wno-lto-type-mismatch.


More information about the Gcc-bugs mailing list