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

            Bug ID: 127100
           Summary: [16/17 Regression] intrinsic_intkinds_1.f90
                    miscompilation on s390x since r16-5984
           Product: gcc
           Version: 16.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jakub at gcc dot gnu.org
  Target Milestone: ---

r16-5984-gcee0a9dd2700b9adff64b2d7e1f222671b1b2058
caused miscompilation of gcc/testsuite/gfortran.dg/intrinsic_intkinds_1.f90
when compiled with -O2 -march=z13 or -O2 -march=z14.
STOP 5
is the reported failure.
Just
program main
  integer(kind=1), dimension(2,2) :: a
  a = reshape((/ 1_1, 2_1, 3_1, 4_1/), shape(a))
  if (any(matmul(a,a) /= reshape ( (/ 7, 10, 15, 22 /), shape(a)))) STOP 5
end program main
is needed to reproduce it.
In *.optimized dump we get just
  _gfortran_set_args (argc_2(D), argv_3(D));
  _gfortran_set_options (7, &options.8[0]);
  _gfortran_stop_numeric (5, 0);
pcom dump is identical between r16-5983 and r16-5984, cunroll then has
significant differences and starting with fre4 it is already that unconditional
STOP 5:
  _gfortran_set_args (argc_2(D), argv_3(D));
  _gfortran_set_options (7, &options.8[0]);
  MEM <unsigned int> [(c_char * {ref-all})&a] = 16909060;
  __var_1_matmul = {};
  _gfortran_stop_numeric (5, 0);

Reply via email to