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

            Bug ID: 104136
           Summary: Gcc cannot compile wrf_r for power10 using -Ofast
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: meissner at gcc dot gnu.org
  Target Milestone: ---

Using the current trunk compiler (from January 18th, 2022), I cannot compile
the module_advect_em fortran module with either -Ofast or -O3 using my normal
spec build options.  The reason is GCC generates a conditional jump
instruction, and the label is too far away.  This means the length insn
attribute is incorrect for one or more instructions, and GCC believes it does
not have to reverse the conditional jump. 

If I disable the generation of vector constants using the XXSPLTIW instruction
via -mno-splat-word-constant option, the module compiles fine.  Enabling or
disabling the XXSPLTIDP instruction with -mno-splat-float-constant does not
affect whether the file can be compiled, only disabling XXSPLTIW.

I used the following options build the module:
-g -Ofast -mcpu=power10 -finline-arg-packing \
-static-libgfortran -fstack-arrays -std=legacy \
-frandom-seed=spec2017 -fconvert=big-endian \
-fno-range-check -fcray-pointer

With those options, there are 646 XXSPLTIW instructions generated and 558
XXSPLTIDP instructions generated.  The size of the
__module_advect_em_MOD_advect_scalar function is 335,440 bytes.

Reply via email to