]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c++/37217 (-Wconversion causes ICE with __builtin_strcmp with one char compare)
authorManuel López-Ibáñez <manu@gcc.gnu.org>
Thu, 28 Aug 2008 00:00:49 +0000 (00:00 +0000)
committerManuel López-Ibáñez <manu@gcc.gnu.org>
Thu, 28 Aug 2008 00:00:49 +0000 (00:00 +0000)
2008-08-27  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>

PR 37217
* c-common.c (conversion_warning): Check for null operands.
testsuite/
* gcc.dg/pr37217.c: New.

From-SVN: r139682

gcc/ChangeLog
gcc/c-common.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/pr37217.c [new file with mode: 0644]

index 63b1981daae6da0e6eaee483f45deca259cae5a3..4175e0232511a97da25bf85bb9891a15f3cb7644 100644 (file)
@@ -1,3 +1,8 @@
+2008-08-27  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
+
+       PR 37217
+       * c-common.c (convesion_warning): Check for null operands.
+
 2008-08-27  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
 
        PR c/31673
index d06c96940f41cccb51801951a58426f22468e1a5..e0a0829ec58ecc2b9e1f3b6f5e9c50327d6d3968 100644 (file)
@@ -1568,7 +1568,7 @@ conversion_warning (tree type, tree expr)
   for (i = 0; i < expr_num_operands; i++)
     {
       tree op = TREE_OPERAND (expr, i);
-      if (DECL_P (op) && DECL_ARTIFICIAL (op))
+      if (op && DECL_P (op) && DECL_ARTIFICIAL (op))
        return;
     }
 
index d5d73d74a0c186282140aa8ce76ba1f4a6547b59..707ccb7431d55945c50ce56d4e1b3a69e7d84488 100644 (file)
@@ -1,3 +1,8 @@
+2008-08-27  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
+
+       PR 37217
+       * gcc.dg/pr37217.c: New.
+
 2008-08-27  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
 
        PR c/31673
diff --git a/gcc/testsuite/gcc.dg/pr37217.c b/gcc/testsuite/gcc.dg/pr37217.c
new file mode 100644 (file)
index 0000000..989eda2
--- /dev/null
@@ -0,0 +1,10 @@
+/* PR 37217 ICE with -Wconversion */
+/* { dg-do compile } */
+/* { dg-options "-Wconversion" } */
+typedef struct Tcl_ResolvedVarInfo {
+  char *re_guts;
+} regex_t;
+void TclReComp(regex_t *re)
+{
+  if (re->re_guts == ((void *)0)) ;
+}