re PR c++/37217 (-Wconversion causes ICE with __builtin_strcmp with one char compare)

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
This commit is contained in:
Manuel López-Ibáñez 2008-08-28 00:00:49 +00:00
parent e9527cfd96
commit 1bfb8f513f
4 changed files with 21 additions and 1 deletions

View 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

View 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;
}

View 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

View file

@ -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)) ;
}