------- Comment #3 from fxcoudert at gcc dot gnu dot org  2007-11-03 13:00 
-------
  integer i, a(1)
  logical(kind=8) s(1)

  s = .true.
  a = 42
  forall (i=1:1, .not. s(1)) a(i) = 0
  end


The ICE happens because we return false in validate_subreg(), called from
gen_rtx_SUBREG(). We come into validate_subreg() with omode=SImode,
imode=DImode, offset=0 and and reg is (reg:DI 130 [ D.975 ]).

We then go to the end of that function, to the following code:

  /* For pseudo registers, we want most of the same checks.  Namely:
     If the register no larger than a word, the subreg must be lowpart.
     If the register is larger than a word, the subreg must be the lowpart
     of a subword.  A subreg does *not* perform arbitrary bit extraction.
     Given that we've already checked mode/offset alignment, we only have
     to check subword subregs here.  */
  if (osize < UNITS_PER_WORD)
    { 
      enum machine_mode wmode = isize > UNITS_PER_WORD ? word_mode : imode;
      unsigned int low_off = subreg_lowpart_offset (omode, wmode);
      if (offset % UNITS_PER_WORD != low_off)
        return false;
    }

and we have wmode = DImode, low_off = 4, and thus we fail the check. The code
that leads to this is:

  logical8 s[1];
  logical1 D.976;
  logical8 D.975;

  D.975 = s[0];
  D.976 = !D.975;

Now, this testcase doesn't trigger an ICE on x86_64-linux, even with
type-checking on, so I'm wondering if this might be a target problem.


-- 

fxcoudert at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|FORALL and WHERE give an ICE|FORALL and WHERE give an ICE
                   |with -fdefault-integer-8 and|with -m64
                   |-m64                        |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32931

Reply via email to