public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* PATCH: PR target/39903: [4.4/4.5 Regression] ICE on flexible member
@ 2009-04-26 22:10 H.J. Lu
  2009-04-27  7:16 ` Uros Bizjak
  0 siblings, 1 reply; 5+ messages in thread
From: H.J. Lu @ 2009-04-26 22:10 UTC (permalink / raw)
  To: gcc-patches; +Cc: ubizjak

Hi,

construct_container isn't prepared to deal with

struct X {
  double d;
  double b[];
};

This patch fixes it.  I am testing it on Linux/Intel64. OK for
trunk and 4.4 if there are no regressions?

Thanks.


H.J.
----
gcc/

2009-04-26  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 for X86_64_SSE_CLASS,
	X86_64_SSESF_CLASS and X86_64_SSEDF_CLASS.

gcc/testsuite/

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

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

Index: gcc/testsuite/gcc.dg/torture/pr39903-1.c
===================================================================
--- gcc/testsuite/gcc.dg/torture/pr39903-1.c	(revision 0)
+++ gcc/testsuite/gcc.dg/torture/pr39903-1.c	(revision 0)
@@ -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;
+}
Index: gcc/testsuite/gcc.dg/torture/pr39903-2.c
===================================================================
--- gcc/testsuite/gcc.dg/torture/pr39903-2.c	(revision 0)
+++ gcc/testsuite/gcc.dg/torture/pr39903-2.c	(revision 0)
@@ -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;
+}
Index: gcc/config/i386/i386.c
===================================================================
--- gcc/config/i386/i386.c	(revision 146817)
+++ gcc/config/i386/i386.c	(working copy)
@@ -5466,7 +5466,10 @@ construct_container (enum machine_mode m
       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);

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: PATCH: PR target/39903: [4.4/4.5 Regression] ICE on flexible  member
  2009-04-26 22:10 PATCH: PR target/39903: [4.4/4.5 Regression] ICE on flexible member H.J. Lu
@ 2009-04-27  7:16 ` Uros Bizjak
  2009-04-27 14:21   ` Jakub Jelinek
  0 siblings, 1 reply; 5+ messages in thread
From: Uros Bizjak @ 2009-04-27  7:16 UTC (permalink / raw)
  To: H.J. Lu; +Cc: gcc-patches

H.J. Lu wrote:

> construct_container isn't prepared to deal with
>
> struct X {
>   double d;
>   double b[];
> };
>
> This patch fixes it.  I am testing it on Linux/Intel64. OK for
> trunk and 4.4 if there are no regressions?
>   
OK for mainline.

Thanks,
Uros.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: PATCH: PR target/39903: [4.4/4.5 Regression] ICE on flexible  member
  2009-04-27  7:16 ` Uros Bizjak
@ 2009-04-27 14:21   ` Jakub Jelinek
  2009-04-27 17:20     ` H.J. Lu
  2009-04-27 17:44     ` Uros Bizjak
  0 siblings, 2 replies; 5+ messages in thread
From: Jakub Jelinek @ 2009-04-27 14:21 UTC (permalink / raw)
  To: Uros Bizjak; +Cc: H.J. Lu, gcc-patches

On Mon, Apr 27, 2009 at 08:56:56AM +0200, Uros Bizjak wrote:
> H.J. Lu wrote:
>
>> construct_container isn't prepared to deal with
>>
>> struct X {
>>   double d;
>>   double b[];
>> };
>>
>> This patch fixes it.  I am testing it on Linux/Intel64. OK for
>> trunk and 4.4 if there are no regressions?
>>   
> OK for mainline.

This is a 4.4 regression from 4.3 as well.  Did you mean by the above
that it should be backported after some time on the trunk, or never to 4.4?

	Jakub

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: PATCH: PR target/39903: [4.4/4.5 Regression] ICE on flexible   member
  2009-04-27 14:21   ` Jakub Jelinek
@ 2009-04-27 17:20     ` H.J. Lu
  2009-04-27 17:44     ` Uros Bizjak
  1 sibling, 0 replies; 5+ messages in thread
From: H.J. Lu @ 2009-04-27 17:20 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: Uros Bizjak, gcc-patches

On Mon, Apr 27, 2009 at 7:17 AM, Jakub Jelinek <jakub@redhat.com> wrote:
> On Mon, Apr 27, 2009 at 08:56:56AM +0200, Uros Bizjak wrote:
>> H.J. Lu wrote:
>>
>>> construct_container isn't prepared to deal with
>>>
>>> struct X {
>>>   double d;
>>>   double b[];
>>> };
>>>
>>> This patch fixes it.  I am testing it on Linux/Intel64. OK for
>>> trunk and 4.4 if there are no regressions?
>>>
>> OK for mainline.
>
> This is a 4.4 regression from 4.3 as well.  Did you mean by the above
> that it should be backported after some time on the trunk, or never to 4.4?
>

I'd like to backport it to 4.4.


-- 
H.J.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: PATCH: PR target/39903: [4.4/4.5 Regression] ICE on flexible  member
  2009-04-27 14:21   ` Jakub Jelinek
  2009-04-27 17:20     ` H.J. Lu
@ 2009-04-27 17:44     ` Uros Bizjak
  1 sibling, 0 replies; 5+ messages in thread
From: Uros Bizjak @ 2009-04-27 17:44 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: H.J. Lu, gcc-patches

Jakub Jelinek wrote:

>>> construct_container isn't prepared to deal with
>>>
>>> struct X {
>>>   double d;
>>>   double b[];
>>> };
>>>
>>> This patch fixes it.  I am testing it on Linux/Intel64. OK for
>>> trunk and 4.4 if there are no regressions?
>>>   
>>>       
>> OK for mainline.
>>     
>
> This is a 4.4 regression from 4.3 as well.  Did you mean by the above
> that it should be backported after some time on the trunk, or never to 4.4?
>   

Uh, yes - also OK for backport to 4.4 after some time.

Uros.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-04-27 17:36 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-04-26 22:10 PATCH: PR target/39903: [4.4/4.5 Regression] ICE on flexible member H.J. Lu
2009-04-27  7:16 ` Uros Bizjak
2009-04-27 14:21   ` Jakub Jelinek
2009-04-27 17:20     ` H.J. Lu
2009-04-27 17:44     ` Uros Bizjak

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).