[Bug middle-end/61853] [4.9/5 Regression] ICE: SIGSEGV in store_field

2014-09-14 Thread danglin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61853

--- Comment #12 from John David Anglin danglin at gcc dot gnu.org ---
I have a patch to pa_function_value that avoids the issue but I tend to
think there is a bug in expand.

This code

typedef struct { double x; } sd_t;
sd_t foo1 (double d)
{
  sd_t s;
  s.x = d;
  return s;
}

results in the following gimple

foo1 (double d)
{
  struct sd_t D.1360;

;;   basic block 2, loop depth 0
;;pred:   ENTRY
  MEM[(struct  *)D.1360] = d_2(D);
  return D.1360;
;;succ:   EXIT

}

This gimple seems similar to that in comment #10 but
it doesn't trigger the ICE.


[Bug middle-end/61853] [4.9/5 Regression] ICE: SIGSEGV in store_field

2014-09-13 Thread danglin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61853

--- Comment #9 from John David Anglin danglin at gcc dot gnu.org ---
Introduced in r202592:

* tree-into-ssa.c (gate_into_ssa): New.
(pass_data_build_ssa): Use it.
* cgraph.h (expand_thunk): Update prototype.
* cgraphunit.c (analyze_function): Expand thunks early.
(expand_thunk): Fix DECL_CONTEXT of reust_decl;
build proper cgraph; set in_ssa_p; clear bogus TREE_ASM_WRITTEN;
set lowered flag; do not add new function.
(assemble_thunks_and_aliases): Update.
* tree-ssa.c (gate_init_datastructures): New gate.
(pass_data_init_datastructures): Use it.

PA bug fix in r202594 needs to be backported to r202592 to see this.


[Bug middle-end/61853] [4.9/5 Regression] ICE: SIGSEGV in store_field

2014-09-13 Thread danglin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61853

--- Comment #10 from John David Anglin danglin at gcc dot gnu.org ---
Gimple from expand:

virtual ThePEG::Units::Energy
ThePEG::ConstituentParticleData::_ZTv0_n64_NK6TheP
EG23ConstituentParticleData15constituentMassEv() const (const struct
Constituent
ParticleData * const this)
{
  double SR.221;
  int (*Td579) () vcalloffset.173;
  int (*Td579) () * vtableaddr.172;
  struct Energy retval;
  sizetype _1;
  const struct ConstituentParticleData * _2;

;;   basic block 2, loop depth 0
;;pred:   ENTRY
  vtableaddr.172_5 = MEM[(int (*Td579) () * *)this_3(D)];
  vcalloffset.173_6 = MEM[(int (*Td579) () *)vtableaddr.172_5 + -64B];
  _1 = (sizetype) vcalloffset.173_6;
  _2 = this_3(D) + _1;
  # DEBUG this = _2
  SR.221_8 = MEM[(const struct ConstituentParticleData *)_2 + 8B];
  MEM[(struct Qty *)retval] = SR.221_8;
  return retval;
;;succ:   EXIT


[Bug middle-end/61853] [4.9/5 Regression] ICE: SIGSEGV in store_field

2014-09-13 Thread danglin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61853

--- Comment #11 from John David Anglin danglin at gcc dot gnu.org ---
This is probably a bug in pa_function_value.  Nominally, we return
5 to 8 byte aggregate values in a BLKmode because of the odd right
justification of the object.  However in this case, we have a DFmode
aggregate and treating it as BLKmode causes the ICE.