------- Comment #14 from rguenth at gcc dot gnu dot org  2007-04-21 16:56 
-------
Indeed.

int main(void){
  s.b6 = 31;
  s.b4 = s.b6 + s.b6;
  s.b6 = s.b4;
  return s.b6 == 15 ? 0 : 1;
}

Created value VH.0 for 31 + 31
...

<bb 2>:
  s.b6 = 31;
  D.1530_3 = 31;
  D.1531_4 = 31;
  D.1530_5 = 31;
  D.1531_6 = 31;
  D.1532_7 = D.1531_6 + D.1531_6;
  D.1533_8 = (<unnamed-unsigned:4>) D.1532_7;

but luckily we don't fold (<unnamed-unsigned:4>) (31 + 31) wrong.  (But
note we also don't constant fold)

Still, for folding (<unnamed-unsigned:6>)(<unnamed-unsigned:4>) 31:6
there is a bug in fold_unary as we are calling
fold_convert_const (code, type, arg0) where arg is 31:6 and type
(<unnamed-unsigned:6>) which is obviously a no-op.  We should call it
on op0 instead.

I'm going to test this (it's broken on the mainline as well) and commit if
it succeeds.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |rguenth at gcc dot gnu dot
                   |dot org                     |org
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2007-03-20 10:00:19         |2007-04-21 16:56:26
               date|                            |


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

Reply via email to