------- Comment #9 from rguenth at gcc dot gnu dot org  2008-09-09 16:56 -------
The key to the problem seems to be a structure passed by value where the
target passes it as pointer and the struct is callee-copied.  This gimplifies
to the correct

  cvt.64 ={v} cvt;
  D.6054_4 = cvt.64.width;
  width_5 = (size_t) D.6054_4;

but somehow SRA completely messes up scalarizing the struct copy from the
parameter:

  cvt$width_59 = cvt.64.width;
  cvt$cd_60 = cvt.64.cd;
  cvt$func_61 = cvt.64.func;
  cvt.64$cd_62 = cvt$cd_60;
  cvt.64$func_63 = cvt$func_61;
  cvt.64$width_64 = cvt$width_59;
  D.6054_4 = cvt.64$width_64;
  width_5 = (size_t) D.6054_4;

where it removed the initialization of cvt.64.  Which seems because of

2311      src = force_gimple_operand (src, &seq2, false, NULL_TREE);
cvt$width
cvt.width
(gdb) n
2312      gimple_seq_add_seq (&seq, seq2);
(gdb) call debug_generic_expr (src)
cvt.64.width

so we force-gimple-operanded cvt.width to cvt.64.width (but seq2 is empty).


-- 

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|2008-09-07 21:11:45         |2008-09-09 16:56:32
               date|                            |


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

Reply via email to