public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/36444]  New: [4.4 Regression] ICE in gen_lowpart_general with -O1 with vector registers
@ 2008-06-05 21:34 pinskia at gcc dot gnu dot org
  2008-06-05 21:37 ` [Bug middle-end/36444] " pinskia at gcc dot gnu dot org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-06-05 21:34 UTC (permalink / raw)
  To: gcc-bugs

Testcase:
#define vector __attribute__((vector_size(16) ))
struct struct1  {
  union {}    vmx;
  struct struct2   {
    struct2(const struct2& r) {}
  } w;
} __attribute__((aligned(16)));
struct struct3  {
  vector float vmx;
  operator const struct1& () const{
    return *reinterpret_cast<const struct1*>(this);
  }
};
struct3 func3( struct3 V1);
struct3 func2( void );
void func1( )  {
  struct1 vVec = func2() ;
  func3 ( (struct3&)vVec );
}

--- CUT ---
On PowerPC use -O1 -maltivec, on x86 use -msse2 -O1.  This was exposed by my
using VCE more patch.


-- 
           Summary: [4.4 Regression] ICE in gen_lowpart_general with -O1
                    with vector registers
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: middle-end
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: pinskia at gcc dot gnu dot org
GCC target triplet: powerpc*-*-*


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


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

* [Bug middle-end/36444] [4.4 Regression] ICE in gen_lowpart_general with -O1 with vector registers
  2008-06-05 21:34 [Bug middle-end/36444] New: [4.4 Regression] ICE in gen_lowpart_general with -O1 with vector registers pinskia at gcc dot gnu dot org
@ 2008-06-05 21:37 ` pinskia at gcc dot gnu dot org
  2008-06-05 22:57 ` pinskia at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-06-05 21:37 UTC (permalink / raw)
  To: gcc-bugs



-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.4.0


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


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

* [Bug middle-end/36444] [4.4 Regression] ICE in gen_lowpart_general with -O1 with vector registers
  2008-06-05 21:34 [Bug middle-end/36444] New: [4.4 Regression] ICE in gen_lowpart_general with -O1 with vector registers pinskia at gcc dot gnu dot org
  2008-06-05 21:37 ` [Bug middle-end/36444] " pinskia at gcc dot gnu dot org
@ 2008-06-05 22:57 ` pinskia at gcc dot gnu dot org
  2008-06-05 23:13 ` pinskia at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-06-05 22:57 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pinskia at gcc dot gnu dot org  2008-06-05 22:56 -------
Fix for at least PowerPC (we should be trying to get the correct sized vector
mode):
Index: expmed.c
===================================================================
--- expmed.c    (revision 2510)
+++ expmed.c    (working copy)
@@ -1129,7 +1129,7 @@ extract_bit_field (rtx str_rtx, unsigned
        new_mode = MIN_MODE_VECTOR_INT;

       for (; new_mode != VOIDmode ; new_mode = GET_MODE_WIDER_MODE (new_mode))
-       if (GET_MODE_NUNITS (new_mode) == nunits
+       if (GET_MODE_SIZE (new_mode) == GET_MODE_SIZE (new_mode)
            && GET_MODE_INNER (new_mode) == tmode
            && targetm.vector_mode_supported_p (new_mode))
          break;


-- 


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


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

* [Bug middle-end/36444] [4.4 Regression] ICE in gen_lowpart_general with -O1 with vector registers
  2008-06-05 21:34 [Bug middle-end/36444] New: [4.4 Regression] ICE in gen_lowpart_general with -O1 with vector registers pinskia at gcc dot gnu dot org
  2008-06-05 21:37 ` [Bug middle-end/36444] " pinskia at gcc dot gnu dot org
  2008-06-05 22:57 ` pinskia at gcc dot gnu dot org
@ 2008-06-05 23:13 ` pinskia at gcc dot gnu dot org
  2008-06-25 12:09 ` rguenth at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-06-05 23:13 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from pinskia at gcc dot gnu dot org  2008-06-05 23:13 -------
And the fix for the second issue:
Index: expr.c
===================================================================
--- expr.c      (revision 2510)
+++ expr.c      (working copy)
@@ -7654,6 +7654,16 @@ expand_expr_real_1 (tree exp, rtx target
              {
                if (target == 0)
                  target = assign_temp (type, 0, 1, 1);
+
+               /* If we don't have a memory location for op0, make a new
location for it. */
+               if (!MEM_P (op0))
+                 {
+                   rtx op0_mem = assign_stack_temp (GET_MODE (op0),
+                                                    GET_MODE_SIZE (GET_MODE
(op0)),
+                                                    0);
+                   emit_move_insn (op0_mem, op0);
+                   op0 = op0_mem;
+                 }

                if (bitsize == 0)
                  return target;


-- 


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


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

* [Bug middle-end/36444] [4.4 Regression] ICE in gen_lowpart_general with -O1 with vector registers
  2008-06-05 21:34 [Bug middle-end/36444] New: [4.4 Regression] ICE in gen_lowpart_general with -O1 with vector registers pinskia at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2008-06-05 23:13 ` pinskia at gcc dot gnu dot org
@ 2008-06-25 12:09 ` rguenth at gcc dot gnu dot org
  2008-06-30  0:29 ` pinskia at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2008-06-25 12:09 UTC (permalink / raw)
  To: gcc-bugs



-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P2


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


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

* [Bug middle-end/36444] [4.4 Regression] ICE in gen_lowpart_general with -O1 with vector registers
  2008-06-05 21:34 [Bug middle-end/36444] New: [4.4 Regression] ICE in gen_lowpart_general with -O1 with vector registers pinskia at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2008-06-25 12:09 ` rguenth at gcc dot gnu dot org
@ 2008-06-30  0:29 ` pinskia at gcc dot gnu dot org
  2008-08-28 21:15 ` hjl dot tools at gmail dot com
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-06-30  0:29 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from pinskia at gcc dot gnu dot org  2008-06-30 00:29 -------
Mine, I will post the patch for this later this week.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |pinskia at gcc dot gnu dot
                   |dot org                     |org
             Status|UNCONFIRMED                 |ASSIGNED
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2008-06-30 00:29:08
               date|                            |


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


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

* [Bug middle-end/36444] [4.4 Regression] ICE in gen_lowpart_general with -O1 with vector registers
  2008-06-05 21:34 [Bug middle-end/36444] New: [4.4 Regression] ICE in gen_lowpart_general with -O1 with vector registers pinskia at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2008-06-30  0:29 ` pinskia at gcc dot gnu dot org
@ 2008-08-28 21:15 ` hjl dot tools at gmail dot com
  2008-08-28 21:21 ` pinskia at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: hjl dot tools at gmail dot com @ 2008-08-28 21:15 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from hjl dot tools at gmail dot com  2008-08-28 21:14 -------
(In reply to comment #1)
> Fix for at least PowerPC (we should be trying to get the correct sized vector
> mode):
> Index: expmed.c
> ===================================================================
> --- expmed.c    (revision 2510)
> +++ expmed.c    (working copy)
> @@ -1129,7 +1129,7 @@ extract_bit_field (rtx str_rtx, unsigned
>         new_mode = MIN_MODE_VECTOR_INT;
> 
>        for (; new_mode != VOIDmode ; new_mode = GET_MODE_WIDER_MODE (new_mode))
> -       if (GET_MODE_NUNITS (new_mode) == nunits
> +       if (GET_MODE_SIZE (new_mode) == GET_MODE_SIZE (new_mode)

I may have missed something. Is this always true?

>             && GET_MODE_INNER (new_mode) == tmode
>             && targetm.vector_mode_supported_p (new_mode))
>           break;
> 


-- 

hjl dot tools at gmail dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |hjl dot tools at gmail dot
                   |                            |com


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


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

* [Bug middle-end/36444] [4.4 Regression] ICE in gen_lowpart_general with -O1 with vector registers
  2008-06-05 21:34 [Bug middle-end/36444] New: [4.4 Regression] ICE in gen_lowpart_general with -O1 with vector registers pinskia at gcc dot gnu dot org
                   ` (5 preceding siblings ...)
  2008-08-28 21:15 ` hjl dot tools at gmail dot com
@ 2008-08-28 21:21 ` pinskia at gcc dot gnu dot org
  2008-08-28 21:30 ` hjl dot tools at gmail dot com
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-08-28 21:21 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from pinskia at gcc dot gnu dot org  2008-08-28 21:19 -------
(In reply to comment #4)
> (In reply to comment #1)
> > Fix for at least PowerPC (we should be trying to get the correct sized vector
> > mode):
> > Index: expmed.c
> > ===================================================================
> > --- expmed.c    (revision 2510)
> > +++ expmed.c    (working copy)
> > @@ -1129,7 +1129,7 @@ extract_bit_field (rtx str_rtx, unsigned
> >         new_mode = MIN_MODE_VECTOR_INT;
> > 
> >        for (; new_mode != VOIDmode ; new_mode = GET_MODE_WIDER_MODE (new_mode))
> > -       if (GET_MODE_NUNITS (new_mode) == nunits
> > +       if (GET_MODE_SIZE (new_mode) == GET_MODE_SIZE (new_mode)
> 
> I may have missed something. Is this always true?

Try replacing one of the new_mode with GET_MODE (op0) :).

-- Pinski


-- 


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


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

* [Bug middle-end/36444] [4.4 Regression] ICE in gen_lowpart_general with -O1 with vector registers
  2008-06-05 21:34 [Bug middle-end/36444] New: [4.4 Regression] ICE in gen_lowpart_general with -O1 with vector registers pinskia at gcc dot gnu dot org
                   ` (6 preceding siblings ...)
  2008-08-28 21:21 ` pinskia at gcc dot gnu dot org
@ 2008-08-28 21:30 ` hjl dot tools at gmail dot com
  2008-08-28 21:51 ` hjl dot tools at gmail dot com
  2008-08-31  2:46 ` pinskia at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: hjl dot tools at gmail dot com @ 2008-08-28 21:30 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from hjl dot tools at gmail dot com  2008-08-28 21:28 -------
(In reply to comment #5)
> (In reply to comment #4)
> > (In reply to comment #1)
> > > Fix for at least PowerPC (we should be trying to get the correct sized vector
> > > mode):
> > > Index: expmed.c
> > > ===================================================================
> > > --- expmed.c    (revision 2510)
> > > +++ expmed.c    (working copy)
> > > @@ -1129,7 +1129,7 @@ extract_bit_field (rtx str_rtx, unsigned
> > >         new_mode = MIN_MODE_VECTOR_INT;
> > > 
> > >        for (; new_mode != VOIDmode ; new_mode = GET_MODE_WIDER_MODE (new_mode))
> > > -       if (GET_MODE_NUNITS (new_mode) == nunits
> > > +       if (GET_MODE_SIZE (new_mode) == GET_MODE_SIZE (new_mode)
> > 
> > I may have missed something. Is this always true?
> 
> Try replacing one of the new_mode with GET_MODE (op0) :).
> 

Both patches avoid ICE on my testcase. But my patch generates short code.
Can you try my patch on your testcase?


-- 


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


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

* [Bug middle-end/36444] [4.4 Regression] ICE in gen_lowpart_general with -O1 with vector registers
  2008-06-05 21:34 [Bug middle-end/36444] New: [4.4 Regression] ICE in gen_lowpart_general with -O1 with vector registers pinskia at gcc dot gnu dot org
                   ` (7 preceding siblings ...)
  2008-08-28 21:30 ` hjl dot tools at gmail dot com
@ 2008-08-28 21:51 ` hjl dot tools at gmail dot com
  2008-08-31  2:46 ` pinskia at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: hjl dot tools at gmail dot com @ 2008-08-28 21:51 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from hjl dot tools at gmail dot com  2008-08-28 21:49 -------
*** Bug 37269 has been marked as a duplicate of this bug. ***


-- 


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


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

* [Bug middle-end/36444] [4.4 Regression] ICE in gen_lowpart_general with -O1 with vector registers
  2008-06-05 21:34 [Bug middle-end/36444] New: [4.4 Regression] ICE in gen_lowpart_general with -O1 with vector registers pinskia at gcc dot gnu dot org
                   ` (8 preceding siblings ...)
  2008-08-28 21:51 ` hjl dot tools at gmail dot com
@ 2008-08-31  2:46 ` pinskia at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-08-31  2:46 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from pinskia at gcc dot gnu dot org  2008-08-31 02:45 -------
Fixed.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED


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


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

end of thread, other threads:[~2008-08-31  2:46 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-06-05 21:34 [Bug middle-end/36444] New: [4.4 Regression] ICE in gen_lowpart_general with -O1 with vector registers pinskia at gcc dot gnu dot org
2008-06-05 21:37 ` [Bug middle-end/36444] " pinskia at gcc dot gnu dot org
2008-06-05 22:57 ` pinskia at gcc dot gnu dot org
2008-06-05 23:13 ` pinskia at gcc dot gnu dot org
2008-06-25 12:09 ` rguenth at gcc dot gnu dot org
2008-06-30  0:29 ` pinskia at gcc dot gnu dot org
2008-08-28 21:15 ` hjl dot tools at gmail dot com
2008-08-28 21:21 ` pinskia at gcc dot gnu dot org
2008-08-28 21:30 ` hjl dot tools at gmail dot com
2008-08-28 21:51 ` hjl dot tools at gmail dot com
2008-08-31  2:46 ` pinskia at gcc dot gnu dot org

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).