This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Severe Tire Damage


There are at least two PRs in GNATS caused by an abort in
extract_bit_field in expmed.c (near line 1115):

	  if (GET_CODE (op0) == SUBREG)
	    {
	      if (GET_MODE (SUBREG_REG (op0)) == mode1
		  || GET_MODE_CLASS (mode1) == MODE_INT
		  || GET_MODE_CLASS (mode1) == MODE_PARTIAL_INT)
		op0 = SUBREG_REG (op0);
	      else
		/* Else we've got some float mode source being extracted into
		   a different float mode destination -- this combination of
		   subregs results in Severe Tire Damage.  */
		abort ();

I've created the most cut-down testcase I could:

int
main()
{
  double v8;

  struct {
    float  f34;
    char c;
  } f;
		 
  f.f34 = *(float *)&v8;

  return 0;
}

Here, extract_bit_field is called because of the store of the cast
double into the struct's float.  The RHS of the store enters as 

(reg/v:DF 62)

to be extracted as mode SFmode, so it gets punned to

(subreg:DI (reg/v:DF 62) 0)

which then hits the above abort since the desired mode class mode1
is SFmode is not integral, and it doesn't match the subreg's mode
of DFmode either.

I'm not clued in enough to know exactly where the bug is in the
above sequence of events.  Can anyone lend me a hint?

Neil.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]