View | Details | Raw Unified | Return to bug 41952
Collapse All | Expand All

(-)fold-const.c (+22 lines)
Lines 66-71 along with GCC; see the file COPYING3. Link Here
66
#include "langhooks.h"
66
#include "langhooks.h"
67
#include "md5.h"
67
#include "md5.h"
68
#include "gimple.h"
68
#include "gimple.h"
69
#include "tree-flow.h"
70
#include "tree-flow-inline.h"
69
71
70
/* Nonzero if we are folding constants inside an initializer; zero
72
/* Nonzero if we are folding constants inside an initializer; zero
71
   otherwise.  */
73
   otherwise.  */
Lines 9572-9577 fold_comparison (location_t loc, enum tr Link Here
9572
      return fold_build2_loc (loc, cmp_code, type, variable1, const2);
9574
      return fold_build2_loc (loc, cmp_code, type, variable1, const2);
9573
    }
9575
    }
9574
9576
9577
  /* Fold comparison using aliasing guarantee:
9578
     &local_var != parameter_default
9579
     &local_var == parameter_default
9580
9581
     A local variable can never be pointed to by
9582
     the default SSA name of an incoming parameter.  */
9583
9584
  if (TREE_CODE (arg0) == ADDR_EXPR
9585
      && TREE_CODE (TREE_OPERAND (arg0, 0)) == VAR_DECL
9586
      && !is_global_var (TREE_OPERAND (arg0, 0))
9587
      && TREE_CODE (arg1) == SSA_NAME
9588
      && TREE_CODE (SSA_NAME_VAR (arg1)) == PARM_DECL
9589
      && SSA_NAME_IS_DEFAULT_DEF (arg1))
9590
    {
9591
      if (code == NE_EXPR)
9592
        return constant_boolean_node (1, type);
9593
      else if (code == EQ_EXPR)
9594
        return constant_boolean_node (0, type);
9595
    }
9596
9575
  tem = maybe_canonicalize_comparison (loc, code, type, op0, op1);
9597
  tem = maybe_canonicalize_comparison (loc, code, type, op0, op1);
9576
  if (tem)
9598
  if (tem)
9577
    return tem;
9599
    return tem;
(-)Makefile.in (-1 / +1 lines)
Lines 2668-2674 tree-pretty-print.o : tree-pretty-print. Link Here
2668
fold-const.o : fold-const.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
2668
fold-const.o : fold-const.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
2669
   $(TREE_H) $(FLAGS_H) $(REAL_H) $(TOPLEV_H) $(HASHTAB_H) $(EXPR_H) $(RTL_H) \
2669
   $(TREE_H) $(FLAGS_H) $(REAL_H) $(TOPLEV_H) $(HASHTAB_H) $(EXPR_H) $(RTL_H) \
2670
   $(GGC_H) $(TM_P_H) langhooks.h $(MD5_H) intl.h fixed-value.h $(TARGET_H) \
2670
   $(GGC_H) $(TM_P_H) langhooks.h $(MD5_H) intl.h fixed-value.h $(TARGET_H) \
2671
   $(GIMPLE_H)
2671
   $(GIMPLE_H) tree-flow.h tree-flow-inline.h
2672
diagnostic.o : diagnostic.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
2672
diagnostic.o : diagnostic.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
2673
   $(TREE_H) version.h $(TM_P_H) $(FLAGS_H) $(INPUT_H) $(TOPLEV_H) intl.h \
2673
   $(TREE_H) version.h $(TM_P_H) $(FLAGS_H) $(INPUT_H) $(TOPLEV_H) intl.h \
2674
   $(DIAGNOSTIC_H) langhooks.h $(LANGHOOKS_DEF_H) diagnostic.def opts.h \
2674
   $(DIAGNOSTIC_H) langhooks.h $(LANGHOOKS_DEF_H) diagnostic.def opts.h \

Return to bug 41952