public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/49478] New: ice in expand_widen_pattern_expr with -O3
@ 2011-06-20 19:47 dcb314 at hotmail dot com
  2011-06-21  0:32 ` [Bug middle-end/49478] " hjl.tools at gmail dot com
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: dcb314 at hotmail dot com @ 2011-06-20 19:47 UTC (permalink / raw)
  To: gcc-bugs

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

           Summary: ice in expand_widen_pattern_expr with -O3
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: dcb314@hotmail.com


Created attachment 24569
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=24569
C source code

I just tried to compile the groona-1.2.2 package with the latest trunk
snapshot 20110618 on an AMD x86_64 box.

The compiler said

io.c: In function 'grn_io_create_with_array':
io.c:287:13: internal compiler error: in expand_widen_pattern_expr, at
optabs.c:535
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

Preprocessed source code attached. Flag -O3 required.


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

* [Bug middle-end/49478] ice in expand_widen_pattern_expr with -O3
  2011-06-20 19:47 [Bug c/49478] New: ice in expand_widen_pattern_expr with -O3 dcb314 at hotmail dot com
@ 2011-06-21  0:32 ` hjl.tools at gmail dot com
  2011-06-21  7:33 ` irar at il dot ibm.com
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: hjl.tools at gmail dot com @ 2011-06-21  0:32 UTC (permalink / raw)
  To: gcc-bugs

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

H.J. Lu <hjl.tools at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2011.06.21 00:31:48
                 CC|                            |irar at gcc dot gnu.org
   Target Milestone|---                         |4.7.0
     Ever Confirmed|0                           |1

--- Comment #1 from H.J. Lu <hjl.tools at gmail dot com> 2011-06-21 00:31:48 UTC ---
It is caused by revision 174735:

http://gcc.gnu.org/ml/gcc-cvs/2011-06/msg00223.html


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

* [Bug middle-end/49478] ice in expand_widen_pattern_expr with -O3
  2011-06-20 19:47 [Bug c/49478] New: ice in expand_widen_pattern_expr with -O3 dcb314 at hotmail dot com
  2011-06-21  0:32 ` [Bug middle-end/49478] " hjl.tools at gmail dot com
@ 2011-06-21  7:33 ` irar at il dot ibm.com
  2011-06-21  9:40 ` rguenth at gcc dot gnu.org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: irar at il dot ibm.com @ 2011-06-21  7:33 UTC (permalink / raw)
  To: gcc-bugs

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

Ira Rosen <irar at il dot ibm.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |irar at il dot ibm.com

--- Comment #2 from Ira Rosen <irar at il dot ibm.com> 2011-06-21 07:33:15 UTC ---
I am testing this patch:

Index: tree-vect-loop.c
===================================================================
--- tree-vect-loop.c    (revision 175238)
+++ tree-vect-loop.c    (working copy)
@@ -4591,6 +4591,29 @@ vectorizable_reduction (gimple stmt, gim
       return false;
     }

+  /* In case of widenning multiplication by a constant, we update the type
+     of the constant to be the type of the other operand.  We check that the
+     constant fits the type in the pattern recognition pass.  */
+  if (code == DOT_PROD_EXPR
+      && !types_compatible_p (TREE_TYPE (ops[0]), TREE_TYPE (ops[1])))
+    {
+      if (TREE_CODE (ops[0]) == INTEGER_CST)
+        ops[0] = build_int_cst_wide (TREE_TYPE (ops[1]),
+                                    TREE_INT_CST_LOW (ops[0]),
+                                    TREE_INT_CST_HIGH (ops[0]));
+      else if (TREE_CODE (ops[1]) == INTEGER_CST)
+        ops[1] = build_int_cst_wide (TREE_TYPE (ops[0]),
+                                    TREE_INT_CST_LOW (ops[1]),
+                                    TREE_INT_CST_HIGH (ops[1]));
+      else
+        {
+          if (vect_print_dump_info (REPORT_DETAILS))
+            fprintf (vect_dump, "invalid types in dot-prod");
+
+          return false;
+        }
+    }
+
   if (!vec_stmt) /* transformation not required.  */
     {
       if (!vect_model_reduction_cost (stmt_info, epilog_reduc_code, ncopies))


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

* [Bug middle-end/49478] ice in expand_widen_pattern_expr with -O3
  2011-06-20 19:47 [Bug c/49478] New: ice in expand_widen_pattern_expr with -O3 dcb314 at hotmail dot com
  2011-06-21  0:32 ` [Bug middle-end/49478] " hjl.tools at gmail dot com
  2011-06-21  7:33 ` irar at il dot ibm.com
@ 2011-06-21  9:40 ` rguenth at gcc dot gnu.org
  2011-06-21 10:03 ` irar at il dot ibm.com
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-06-21  9:40 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-06-21 09:39:47 UTC ---
(In reply to comment #2)
> I am testing this patch:
> 
> Index: tree-vect-loop.c
> ===================================================================
> --- tree-vect-loop.c    (revision 175238)
> +++ tree-vect-loop.c    (working copy)
> @@ -4591,6 +4591,29 @@ vectorizable_reduction (gimple stmt, gim
>        return false;
>      }
> 
> +  /* In case of widenning multiplication by a constant, we update the type
> +     of the constant to be the type of the other operand.  We check that the
> +     constant fits the type in the pattern recognition pass.  */
> +  if (code == DOT_PROD_EXPR
> +      && !types_compatible_p (TREE_TYPE (ops[0]), TREE_TYPE (ops[1])))
> +    {
> +      if (TREE_CODE (ops[0]) == INTEGER_CST)
> +        ops[0] = build_int_cst_wide (TREE_TYPE (ops[1]),
> +                                    TREE_INT_CST_LOW (ops[0]),
> +                                    TREE_INT_CST_HIGH (ops[0]));
> +      else if (TREE_CODE (ops[1]) == INTEGER_CST)
> +        ops[1] = build_int_cst_wide (TREE_TYPE (ops[0]),
> +                                    TREE_INT_CST_LOW (ops[1]),
> +                                    TREE_INT_CST_HIGH (ops[1]));
> +      else
> +        {
> +          if (vect_print_dump_info (REPORT_DETAILS))
> +            fprintf (vect_dump, "invalid types in dot-prod");
> +
> +          return false;
> +        }
> +    }

Please instead simply do

       if (code == DOT_PROD_EXPR
           && !types_compatible_p (TREE_TYPE (ops[0]), TREE_TYPE (ops[1])))
         {
           if (TREE_CODE (ops[0]) == INTEGER_CST)
             ops[0] = fold_convert (TREE_TYPE (ops[1]), ops[0]);
           else if (TREE_CODE (ops[1]) == INTEEGER_CST)
             ops[1] = fold_convert (TREE_TYPE (ops[0]), ops[1]);
> +      else
> +        {
> +          if (vect_print_dump_info (REPORT_DETAILS))
> +            fprintf (vect_dump, "invalid types in dot-prod");
> +
> +          return false;
           }
         }

Thanks.

> +
>    if (!vec_stmt) /* transformation not required.  */
>      {
>        if (!vect_model_reduction_cost (stmt_info, epilog_reduc_code, ncopies))


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

* [Bug middle-end/49478] ice in expand_widen_pattern_expr with -O3
  2011-06-20 19:47 [Bug c/49478] New: ice in expand_widen_pattern_expr with -O3 dcb314 at hotmail dot com
                   ` (2 preceding siblings ...)
  2011-06-21  9:40 ` rguenth at gcc dot gnu.org
@ 2011-06-21 10:03 ` irar at il dot ibm.com
  2011-06-21 11:59 ` [Bug tree-optimization/49478] " irar at gcc dot gnu.org
  2011-06-21 12:14 ` irar at il dot ibm.com
  5 siblings, 0 replies; 7+ messages in thread
From: irar at il dot ibm.com @ 2011-06-21 10:03 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Ira Rosen <irar at il dot ibm.com> 2011-06-21 10:03:05 UTC ---
OK.
Thanks,
Ira


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

* [Bug tree-optimization/49478] ice in expand_widen_pattern_expr with -O3
  2011-06-20 19:47 [Bug c/49478] New: ice in expand_widen_pattern_expr with -O3 dcb314 at hotmail dot com
                   ` (3 preceding siblings ...)
  2011-06-21 10:03 ` irar at il dot ibm.com
@ 2011-06-21 11:59 ` irar at gcc dot gnu.org
  2011-06-21 12:14 ` irar at il dot ibm.com
  5 siblings, 0 replies; 7+ messages in thread
From: irar at gcc dot gnu.org @ 2011-06-21 11:59 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from irar at gcc dot gnu.org 2011-06-21 11:58:36 UTC ---
Author: irar
Date: Tue Jun 21 11:58:33 2011
New Revision: 175255

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=175255
Log:

        PR tree-optimization/49478
        * tree-vect-loop.c (vectorizable_reduction): Handle DOT_PROD_EXPR
        with constant operand.


Added:
    trunk/gcc/testsuite/gcc.dg/vect/pr49478.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/tree-vect-loop.c


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

* [Bug tree-optimization/49478] ice in expand_widen_pattern_expr with -O3
  2011-06-20 19:47 [Bug c/49478] New: ice in expand_widen_pattern_expr with -O3 dcb314 at hotmail dot com
                   ` (4 preceding siblings ...)
  2011-06-21 11:59 ` [Bug tree-optimization/49478] " irar at gcc dot gnu.org
@ 2011-06-21 12:14 ` irar at il dot ibm.com
  5 siblings, 0 replies; 7+ messages in thread
From: irar at il dot ibm.com @ 2011-06-21 12:14 UTC (permalink / raw)
  To: gcc-bugs

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

Ira Rosen <irar at il dot ibm.com> changed:

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

--- Comment #6 from Ira Rosen <irar at il dot ibm.com> 2011-06-21 12:14:09 UTC ---
Fixed.


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

end of thread, other threads:[~2011-06-21 12:14 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-20 19:47 [Bug c/49478] New: ice in expand_widen_pattern_expr with -O3 dcb314 at hotmail dot com
2011-06-21  0:32 ` [Bug middle-end/49478] " hjl.tools at gmail dot com
2011-06-21  7:33 ` irar at il dot ibm.com
2011-06-21  9:40 ` rguenth at gcc dot gnu.org
2011-06-21 10:03 ` irar at il dot ibm.com
2011-06-21 11:59 ` [Bug tree-optimization/49478] " irar at gcc dot gnu.org
2011-06-21 12:14 ` irar at il dot ibm.com

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