+2010-04-27 Richard Guenther <rguenther@suse.de>
+
+ PR c++/40561
+ Backport from mainline
+ 2008-12-29 Richard Guenther <rguenther@suse.de>
+
+ PR middle-end/38564
+ * fold-const.c (fold_comparison): Use the correct result type.
+
2010-04-27 Richard Guenther <rguenther@suse.de>
Backport from mainline:
switch (code)
{
case EQ_EXPR:
- return build_int_cst (boolean_type_node, bitpos0 == bitpos1);
+ return constant_boolean_node (bitpos0 == bitpos1, type);
case NE_EXPR:
- return build_int_cst (boolean_type_node, bitpos0 != bitpos1);
+ return constant_boolean_node (bitpos0 != bitpos1, type);
case LT_EXPR:
- return build_int_cst (boolean_type_node, bitpos0 < bitpos1);
+ return constant_boolean_node (bitpos0 < bitpos1, type);
case LE_EXPR:
- return build_int_cst (boolean_type_node, bitpos0 <= bitpos1);
+ return constant_boolean_node (bitpos0 <= bitpos1, type);
case GE_EXPR:
- return build_int_cst (boolean_type_node, bitpos0 >= bitpos1);
+ return constant_boolean_node (bitpos0 >= bitpos1, type);
case GT_EXPR:
- return build_int_cst (boolean_type_node, bitpos0 > bitpos1);
+ return constant_boolean_node (bitpos0 > bitpos1, type);
default:;
}
}
+2010-04-27 Richard Guenther <rguenther@suse.de>
+
+ PR c++/40561
+ Backport from mainline
+ 2008-12-29 Richard Guenther <rguenther@suse.de>
+
+ PR middle-end/38564
+ * gcc.c-torture/compile/pr38564.c: New testcase.
+ * g++.dg/other/pr40561.C: Likewise.
+
2010-04-27 Richard Guenther <rguenther@suse.de>
Backport from mainline:
--- /dev/null
+// { dg-do compile }
+
+#include <set>
+
+class SyAccess;
+class VamsBase
+{
+ public:
+ virtual ~VamsBase(void);
+};
+
+class VamsFnct : public VamsBase
+{
+ public:
+ ~VamsFnct(void);
+ std::set<SyAccess*> getNullDependencies(void) const
+ { return std::set<SyAccess*>();
+ }
+};
+
+class VamsFnctSystem:public VamsFnct
+{ public:
+ VamsFnctSystem(
+ const bool _bPassDependencies);
+};
+
+template< std::set<SyAccess*> (VamsFnct::*__GET_DEP__)(void) const >
+class VamsSystemFunction:public VamsFnctSystem
+{ public:
+ VamsSystemFunction()
+ :VamsFnctSystem(
+ __GET_DEP__ != &VamsFnct::getNullDependencies
+ )
+ {
+ }
+};
+
+VamsSystemFunction<&VamsFnct::getNullDependencies> s;
--- /dev/null
+struct S
+{
+ struct S *n, *p;
+} *s;
+
+void bar (void *);
+
+int
+foo (int x)
+{
+ struct S p = { &p, &p };
+ int i;
+ for (i = 0; i < x; i++)
+ bar (s);
+ return p.n == &p;
+}
+
+int dialog_calendar(int state)
+{
+ int *obj = (state == 1 ? &state : 0);
+ return (obj == &state);
+}