2009-05-17 Manuel López-Ibáñez <manu@gcc.gnu.org>
PR c/40172
* c-common.c (warn_logical_operator): Don't warn if one of
expression isn't always true or false.
gcc/testscase/
2009-05-17 H.J. Lu <hongjiu.lu@intel.com>
PR c/40172
* gcc.dg/pr40172.c: New.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@147639
138bc75d-0d04-0410-961f-
82ee72b054a4
+2009-05-17 Manuel López-Ibáñez <manu@gcc.gnu.org>
+
+ PR c/40172
+ * c-common.c (warn_logical_operator): Don't warn if one of
+ expression isn't always true or false.
+
2009-05-17 Kai Tietz <kai.tietz@onevision.com>
- * config/i386/biarch32.h: New file.
- * config.gcc: Add for target i386-w64-* the biarch32.h to tm_file.
+ * config/i386/biarch32.h: New file.
+ * config.gcc: Add for target i386-w64-* the biarch32.h to tm_file.
2009-05-17 Adam Nemet <anemet@caviumnetworks.com>
in0_p = !in0_p, in1_p = !in1_p;
/* If both expressions are the same, if we can merge the ranges, and we
- can build the range test, return it or it inverted. If one of the
- ranges is always true or always false, consider it to be the same
- expression as the other. */
- if ((lhs == 0 || rhs == 0 || operand_equal_p (lhs, rhs, 0))
+ can build the range test, return it or it inverted. */
+ if (lhs && rhs && operand_equal_p (lhs, rhs, 0)
&& merge_ranges (&in_p, &low, &high, in0_p, low0, high0,
in1_p, low1, high1)
&& 0 != (tem = build_range_check (type,
+2009-05-17 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR c/40172
+ * gcc.dg/pr40172.c: New.
+
2009-05-17 Jason Merrill <jason@redhat.com>
PR c++/40139
--- /dev/null
+/* PR middle-end/40172 */
+/* { dg-do compile } */
+/* { dg-options "-Wall -W -Werror" } */
+
+struct rtx_def;
+typedef struct rtx_def *rtx;
+
+extern int foo;
+extern int bar;
+extern int xxx;
+
+int
+test (void)
+{
+ if (((rtx) 0 != (rtx) 0) && xxx ? foo : bar)
+ return 1;
+ else if ((foo & 0) && xxx)
+ return 2;
+ else if (foo & 0)
+ return 3;
+ else if (0 && xxx)
+ return 4;
+ else if (0)
+ return 5;
+ if (((int) 0 != (int) 0) && bar ? foo : xxx)
+ return 6;
+ else if (0 != 0 && foo ? xxx : bar)
+ return 7;
+ else
+ return 0;
+}