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

Pat Haugen <pthaugen at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |UNCONFIRMED
     Ever Confirmed|1                           |0

--- Comment #3 from Pat Haugen <pthaugen at gcc dot gnu.org> 2012-04-10 
16:13:49 UTC ---
(In reply to comment #2)
> (gdb) prt to
>  <mem_ref 0xfffafed2790
>     type <real_type 0xfffb0057b60 double DF
>         size <integer_cst 0xfffafe125e0 constant 64>
>         unit size <integer_cst 0xfffafe12600 constant 8>
>         align 8 symtab 0 alias set 2 canonical type 0xfffaff00f18 precision 
> 64>
> 
> I suppose SRA does this.  Can you check with -fno-tree-sra?

With -fno-tree-sra they both generate the same code, a sequence of 8-byte
stores to build up the rhs, and then a call to memcpy for the entire structure
copy.

At expand phase we now have:

  struct ggVector3 D.2563;
  struct ggVector3 D.2562;
  struct ggVector3 D.2561;
  struct ggONB3 D.2573;

  # BLOCK 2 freq:10000
  # PRED: ENTRY [100.0%]  (fallthru,exec)
  D.2561.e[0] = 1.0e+0;
  D.2561.e[1] = 0.0;
  D.2561.e[2] = 0.0;
  D.2562.e[0] = 0.0;
  D.2562.e[1] = 0.0;
  D.2562.e[2] = -1.0e+0;
  D.2563.e[0] = 0.0;
  D.2563.e[1] = 1.0e+0;
  D.2563.e[2] = 0.0;
  D.2573.U = D.2561;
  D.2573.V = D.2562;
  D.2573.W = D.2563;
  VHR_1(D)->UVW = D.2573;


Whereas with SRA we had:

  MEM[(struct mrViewingHitRecord &)VHR_1(D)] = 1.0e+0;
  MEM[(struct mrViewingHitRecord &)VHR_1(D) + 8] = 0.0;
  MEM[(struct mrViewingHitRecord &)VHR_1(D) + 16] = 0.0;
  MEM[(struct mrViewingHitRecord &)VHR_1(D) + 24] = 0.0;
  MEM[(struct mrViewingHitRecord &)VHR_1(D) + 32] = 0.0;
  MEM[(struct mrViewingHitRecord &)VHR_1(D) + 40] = -1.0e+0;
  MEM[(struct mrViewingHitRecord &)VHR_1(D) + 48] = 0.0;
  MEM[(struct mrViewingHitRecord &)VHR_1(D) + 56] = 1.0e+0;
  MEM[(struct mrViewingHitRecord &)VHR_1(D) + 64] = 0.0;

Reply via email to