OSDN Git Service

2008-08-27 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
authormanu <manu@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 28 Aug 2008 00:00:49 +0000 (00:00 +0000)
committermanu <manu@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 28 Aug 2008 00:00:49 +0000 (00:00 +0000)
PR 37217
* c-common.c (convesion_warning): Check for null operands.
testsuite/
* gcc.dg/pr37217.c: New.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@139682 138bc75d-0d04-0410-961f-82ee72b054a4

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

index 63b1981..4175e02 100644 (file)
@@ -1,5 +1,10 @@
 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
        * c-decl.c (check_for_loop_decls): Improve error message. Give
        hint.
index d06c969..e0a0829 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 d5d73d7..707ccb7 100644 (file)
@@ -1,5 +1,10 @@
 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
        * gcc.dg/c90-fordecl-1.c: Update.
 
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)) ;
+}