Hi,

const_binop is now invoked on MEM_EXPR, which doesn't make much sense given 
the assertion at the end:

  /* Make sure type and arg0 have the same saturating flag.  */
  gcc_checking_assert (TYPE_SATURATING (type)
                       == TYPE_SATURATING (TREE_TYPE (arg1)));

Tested on x86_64-suse-linux, OK for the mainline?


2015-01-22  Eric Botcazou  <ebotca...@adacore.com>

        * fold-const.c (fold_binary_loc): Do not call const_binop on MEM_REF.


-- 
Eric Botcazou
Index: fold-const.c
===================================================================
--- fold-const.c	(revision 219928)
+++ fold-const.c	(working copy)
@@ -9884,7 +9884,7 @@ fold_binary_loc (location_t loc,
 
   /* Note that TREE_CONSTANT isn't enough: static var addresses are
      constant but we can't do arithmetic on them.  */
-  if (CONSTANT_CLASS_P (arg0) && CONSTANT_CLASS_P (arg1))
+  if (code != MEM_REF && CONSTANT_CLASS_P (arg0) && CONSTANT_CLASS_P (arg1))
     {
       tem = const_binop (code, type, arg0, arg1);
       if (tem != NULL_TREE)

Reply via email to