This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/37217] [4.4 Regression] -Wconversion causes ICE with __builtin_strcmp with one char compare
- From: "manu at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 25 Aug 2008 12:36:55 -0000
- Subject: [Bug c++/37217] [4.4 Regression] -Wconversion causes ICE with __builtin_strcmp with one char compare
- References: <bug-37217-6183@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #8 from manu at gcc dot gnu dot org 2008-08-25 12:36 -------
The fix is trivial:
Index: gcc/c-common.c
===================================================================
--- gcc/c-common.c (revision 139373)
+++ gcc/c-common.c (working copy)
@@ -1566,11 +1566,11 @@ conversion_warning (tree type, tree expr
/* If any operand is artificial, then this expression was generated
by the compiler and we do not warn. */
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;
}
switch (TREE_CODE (expr))
{
However, the testcase is too big for the testsuite...
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37217