public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Side-step wide_int_to_tree issue
@ 2015-09-03 13:18 Richard Biener
  0 siblings, 0 replies; only message in thread
From: Richard Biener @ 2015-09-03 13:18 UTC (permalink / raw)
  To: gcc-patches


In this particular place which otherwise triggers with

Index: gcc/tree.c
===================================================================
--- gcc/tree.c  (revision 227429)
+++ gcc/tree.c  (working copy)
@@ -1395,6 +1395,8 @@ wide_int_to_tree (tree type, const wide_
        gcc_checking_assert (pcst.elt (l - 2) >= 0);
     }
 
+  gcc_assert (prec <= pcst.get_precision ());
+
   wide_int cst = wide_int::from (pcst, prec, sgn);
   unsigned int ext_len = get_int_cst_ext_nunits (type, cst);
 


Bootstrapped / tested on x86_64-unknown-linux-gnu, applied.

Richard.

2015-09-03  Richard Biener  <rguenther@suse.de>

	* varasm.c (output_constant): Use fold_convert instead of
	wide_int_to_tree.

Index: gcc/varasm.c
===================================================================
--- gcc/varasm.c	(revision 227429)
+++ gcc/varasm.c	(working copy)
@@ -4699,7 +4699,7 @@ output_constant (tree exp, unsigned HOST
 	exp = build1 (ADDR_EXPR, saved_type, TREE_OPERAND (exp, 0));
       /* Likewise for constant ints.  */
       else if (TREE_CODE (exp) == INTEGER_CST)
-	exp = wide_int_to_tree (saved_type, exp);
+	exp = fold_convert (saved_type, exp);
 
     }
 

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-09-03 12:42 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-03 13:18 [PATCH] Side-step wide_int_to_tree issue Richard Biener

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