------- Comment #3 from jakub at gcc dot gnu dot org  2009-07-17 08:42 -------
I believe we should do:
--- gimplify.c.jj72009-07-08 11:28:03.000000000 +0200
+++ gimplify.c2009-07-17 10:40:56.000000000 +0200
@@ -1826,7 +1826,7 @@ gimplify_conversion (tree *expr_p)

   /* If we have a conversion to a non-register type force the
      use of a VIEW_CONVERT_EXPR instead.  */
-  if (!is_gimple_reg_type (TREE_TYPE (*expr_p)))
+  if (CONVERT_EXPR_P (*expr_p) && !is_gimple_reg_type (TREE_TYPE (*expr_p)))
     *expr_p = fold_build1 (VIEW_CONVERT_EXPR, TREE_TYPE (*expr_p),
    TREE_OPERAND (*expr_p, 0));


which fixes the testcase (see earlier ifs in gimplify_conversion which also
test CONVERT_EXPR_P (*expr_p), as each step might turn the conversion into
something different and blindly using TREE_OPERAND (*expr_p, 0) on something
that doesn't have operands is wrong.


-- 

jakub at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |jakub at gcc dot gnu dot org
                   |dot org                     |
             Status|UNCONFIRMED                 |ASSIGNED
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2009-07-17 08:42:41
               date|                            |


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

Reply via email to