aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-common.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/c-common.c')
-rw-r--r--gcc/c-common.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/gcc/c-common.c b/gcc/c-common.c
index 639601d..92e58c9 100644
--- a/gcc/c-common.c
+++ b/gcc/c-common.c
@@ -1556,11 +1556,22 @@ conversion_warning (tree type, tree expr)
{
bool give_warning = false;
+ int i;
+ const int expr_num_operands = TREE_OPERAND_LENGTH (expr);
tree expr_type = TREE_TYPE (expr);
if (!warn_conversion && !warn_sign_conversion)
return;
+ /* 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))
+ return;
+ }
+
switch (TREE_CODE (expr))
{
case EQ_EXPR: