This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug target/32441] ICE in expand_expr_real_1, at expr.c:7109



------- Comment #3 from pinskia at gcc dot gnu dot org  2007-06-21 08:58 -------
Patch which fixes this bug:
Index: builtins.c
===================================================================
--- builtins.c  (revision 125776)
+++ builtins.c  (working copy)
@@ -4649,7 +4649,18 @@
 std_expand_builtin_va_start (tree valist, rtx nextarg)
 {
   tree t;
-  t = make_tree (sizetype, nextarg);
+  /* Use the correct type/mode for make_tree, can't use a pointer type as
+     PLUS_EXPR is not appliable to pointers.  type_for_mode might return
+     a type with a different mode (SI vs PSI) so we might need to convert
+     to the different mode.  */
+  tree type = lang_hooks.types.type_for_mode (TYPE_MODE (ptr_type_node),
true);
+  if (TYPE_MODE (type) != GET_MODE (nextarg))
+    {
+      rtx reg = gen_reg_rtx (TYPE_MODE (type));
+      convert_move (reg, nextarg, false);
+      nextarg = reg;
+    }
+  t = make_tree (type, nextarg);
   t = fold_convert (ptr_type_node, t);

   t = build2 (MODIFY_EXPR, TREE_TYPE (valist), valist, t);


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2007-06-21 08:58:35
               date|                            |


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]