PATCH, middle-end: fix semantic bug in dse.c

Jakub Jelinek jakub@redhat.com
Wed May 13 12:41:00 GMT 2009


On Wed, May 13, 2009 at 08:31:31AM -0400, Kenneth Zadeck wrote:
> Ben Elliston wrote:
> > On Wed, 2009-05-06 at 08:58 +0200, Jakub Jelinek wrote:
> >
> >   
> >> I think Kenny should review this.
> >>     
> >
> > Ping?
> >
> > Thanks,
> > Ben
> >
> >   
> Now that the test has been moved out of all_positions_needed, i do not
> see why we would also not need a similar test at line 1525 (the first
> call to all positions needed).

In record_store, width is:
  if (GET_MODE (mem) == BLKmode)
    {
      if (GET_CODE (XEXP (mem, 0)) == SCRATCH)
{ ... return 0; }
      else (...
	    || !CONST_INT_P (MEM_SIZE (mem))
	    ...
	    || INTVAL (MEM_SIZE (mem)) <= 0
	    ...)
{ ... return 0; }
...
    }
...
  if (GET_MODE (mem) == BLKmode)
    width = INTVAL (MEM_SIZE (mem));
  else
    {
      width = GET_MODE_SIZE (GET_MODE (mem));
      gcc_assert ((unsigned) width <= HOST_BITS_PER_WIDE_INT);
    }

GET_MODE_SIZE of any mode is always >= 0, e.g. because
#define GET_MODE_SIZE(MODE)    ((unsigned short) mode_size[MODE])
and for BLKmode we have checked that INTVAL (MEM_SIZE (mem)) > 0
earlier.

	Jakub



More information about the Gcc-patches mailing list