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

Dominique d'Humieres <dominiq at lps dot ens.fr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |ASSIGNED

--- Comment #7 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
> Patch posted:
>
> https://gcc.gnu.org/pipermail/fortran/2021-May/056054.html

With the patch the test PR94331.f90 fails with -flto:

% gfc /opt/gcc/work/gcc/testsuite/gfortran.dg/PR94331.f90
/opt/gcc/work/gcc/testsuite/gfortran.dg/PR94331.c -flto
/opt/gcc/work/gcc/testsuite/gfortran.dg/PR94331.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
      |          ^
/opt/gcc/work/gcc/testsuite/gfortran.dg/PR94331.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)
      | ^
/opt/gcc/work/gcc/testsuite/gfortran.dg/PR94331.c:38:1: note: type
'CFI_index_t' should match type 'int'
/opt/gcc/work/gcc/testsuite/gfortran.dg/PR94331.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
      |          ^
/opt/gcc/work/gcc/testsuite/gfortran.dg/PR94331.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)
      | ^
/opt/gcc/work/gcc/testsuite/gfortran.dg/PR94331.c:38:1: note: type
'CFI_index_t' should match type 'int'
/opt/gcc/work/gcc/testsuite/gfortran.dg/PR94331.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
      |          ^
/opt/gcc/work/gcc/testsuite/gfortran.dg/PR94331.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)
      | ^
/opt/gcc/work/gcc/testsuite/gfortran.dg/PR94331.c:38:1: note: type
'CFI_index_t' should match type 'int'
/opt/gcc/work/gcc/testsuite/gfortran.dg/PR94331.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
      |          ^
/opt/gcc/work/gcc/testsuite/gfortran.dg/PR94331.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)
      | ^
/opt/gcc/work/gcc/testsuite/gfortran.dg/PR94331.c:38:1: note: type
'CFI_index_t' should match type 'int'
/opt/gcc/work/gcc/testsuite/gfortran.dg/PR94331.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
      |          ^
/opt/gcc/work/gcc/testsuite/gfortran.dg/PR94331.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)
      | ^
/opt/gcc/work/gcc/testsuite/gfortran.dg/PR94331.c:38:1: note: type
'CFI_index_t' should match type 'int'
/opt/gcc/work/gcc/testsuite/gfortran.dg/PR94331.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
      |          ^
/opt/gcc/work/gcc/testsuite/gfortran.dg/PR94331.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)
      | ^
/opt/gcc/work/gcc/testsuite/gfortran.dg/PR94331.c:38:1: note: type
'CFI_index_t' should match type 'int'
/opt/gcc/work/gcc/testsuite/gfortran.dg/PR94331.c:38:1: note: 'check_bounds'
was previously declared here
/opt/gcc/work/gcc/testsuite/gfortran.dg/PR94331.c:38:1: note: code may be
misoptimized unless '-fno-strict-aliasing' is used

Note that the original test seems fixed even with -flto.

Reply via email to