backport: re PR c/39903 (ICE on flexible member)

gcc/

2009-04-28  H.J. Lu  <hongjiu.lu@intel.com>

	Backport from mainline:
	2009-04-27  H.J. Lu  <hongjiu.lu@intel.com>

	PR target/39903
	* config/i386/i386.c (construct_container): Don't call
	gen_reg_or_parallel with BLKmode on X86_64_SSE_CLASS,
	X86_64_SSESF_CLASS and X86_64_SSEDF_CLASS.

gcc/testsuite/

2009-04-28  H.J. Lu  <hongjiu.lu@intel.com>

	Backport from mainline:
	2009-04-27  H.J. Lu  <hongjiu.lu@intel.com>

	PR target/39903
	* gcc.dg/torture/pr39903-1.c: New.
	* gcc.dg/torture/pr39903-2.c: Likewise.

From-SVN: r146895
This commit is contained in:
H.J. Lu 2009-04-28 14:35:12 +00:00 committed by H.J. Lu
parent 5c8bd1089b
commit c30cae9e66
5 changed files with 71 additions and 1 deletions

View File

@ -1,3 +1,13 @@
2009-04-28 H.J. Lu <hongjiu.lu@intel.com>
Backport from mainline:
2009-04-27 H.J. Lu <hongjiu.lu@intel.com>
PR target/39903
* config/i386/i386.c (construct_container): Don't call
gen_reg_or_parallel with BLKmode on X86_64_SSE_CLASS,
X86_64_SSESF_CLASS and X86_64_SSEDF_CLASS.
2009-04-27 Jakub Jelinek <jakub@redhat.com>
PR rtl-optimization/39794

View File

@ -5357,7 +5357,10 @@ construct_container (enum machine_mode mode, enum machine_mode orig_mode,
case X86_64_SSE_CLASS:
case X86_64_SSESF_CLASS:
case X86_64_SSEDF_CLASS:
return gen_reg_or_parallel (mode, orig_mode, SSE_REGNO (sse_regno));
if (mode != BLKmode)
return gen_reg_or_parallel (mode, orig_mode,
SSE_REGNO (sse_regno));
break;
case X86_64_X87_CLASS:
case X86_64_COMPLEX_X87_CLASS:
return gen_rtx_REG (mode, FIRST_STACK_REG);

View File

@ -1,3 +1,12 @@
2009-04-28 H.J. Lu <hongjiu.lu@intel.com>
Backport from mainline:
2009-04-27 H.J. Lu <hongjiu.lu@intel.com>
PR target/39903
* gcc.dg/torture/pr39903-1.c: New.
* gcc.dg/torture/pr39903-2.c: Likewise.
2009-04-27 Jakub Jelinek <jakub@redhat.com>
PR rtl-optimization/39794

View File

@ -0,0 +1,24 @@
/* PR target/39903 */
/* { dg-do run } */
/* { dg-options "-Wno-psabi" } */
struct X {
double d;
double b[];
};
struct X __attribute__((noinline))
foo (double d)
{
struct X x;
x.d = d;
return x;
}
extern void abort (void);
int main()
{
struct X x = foo(3.0);
if (x.d != 3.0)
abort ();
return 0;
}

View File

@ -0,0 +1,24 @@
/* PR target/39903 */
/* { dg-do run } */
/* { dg-options "-Wno-psabi" } */
struct X {
float d;
float b[];
};
struct X __attribute__((noinline))
foo (float d)
{
struct X x;
x.d = d;
return x;
}
extern void abort (void);
int main()
{
struct X x = foo(3.0);
if (x.d != 3.0)
abort ();
return 0;
}