From 092313ae6b053cf8479a74c65789be450e674f7a Mon Sep 17 00:00:00 2001 From: Nathan Sidwell Date: Mon, 16 Aug 2004 16:44:29 +0000 Subject: [PATCH] c-typeck.c (build_c_cast): Only copy overflow from expr nodes. * c-typeck.c (build_c_cast): Only copy overflow from expr nodes. * tree.h (IS_NON_TYPE_CODE_CLASS): Simplify. (struct tree_common): Update public_flag documentation. From-SVN: r86065 --- gcc/ChangeLog | 8 +++++++- gcc/c-typeck.c | 7 +++++-- gcc/tree.h | 4 +--- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a74aa20fc77..b7e9bb38676 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2004-08-16 Nathan Sidwell + + * c-typeck.c (build_c_cast): Only copy overflow from expr nodes. + * tree.h (IS_NON_TYPE_CODE_CLASS): Simplify. + (struct tree_common): Update public_flag documentation. + 2004-08-16 Nathanael Nerode * tree-ssa-copyrename.c (copy_rename_partition_coalesce): @@ -1681,7 +1687,7 @@ * config/i386/xmmintrin.h: Include . 2004-08-03 H.J. Lu - Tanguy Fautrà + Tanguy Fautrà * config/i386/pmm_malloc.h: New file. diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c index 2c89c73b449..5fca42def6e 100644 --- a/gcc/c-typeck.c +++ b/gcc/c-typeck.c @@ -3108,8 +3108,11 @@ build_c_cast (tree type, tree expr) /* Ignore any integer overflow caused by the cast. */ if (TREE_CODE (value) == INTEGER_CST) { - TREE_OVERFLOW (value) = TREE_OVERFLOW (ovalue); - + if (EXPR_P (ovalue)) + TREE_OVERFLOW (value) = TREE_OVERFLOW (ovalue); + else + TREE_OVERFLOW (value) = 0; + if (TREE_CODE_CLASS (TREE_CODE (ovalue)) == 'c') TREE_CONSTANT_OVERFLOW (value) = TREE_CONSTANT_OVERFLOW (ovalue); } diff --git a/gcc/tree.h b/gcc/tree.h index 1df73ca87cd..a0cc1361133 100644 --- a/gcc/tree.h +++ b/gcc/tree.h @@ -56,7 +56,7 @@ extern const char tree_code_type[]; /* Returns nonzero iff CLASS is not the tree code of a type. */ -#define IS_NON_TYPE_CODE_CLASS(CLASS) (strchr ("xbcdr<12se", (CLASS)) != 0) +#define IS_NON_TYPE_CODE_CLASS(CLASS) ((CLASS) != 't') /* Returns nonzero iff CLASS is the tree-code class of an expression. */ @@ -228,8 +228,6 @@ struct tree_common GTY(()) ??? and other expressions? TREE_PUBLIC in VAR_DECL or FUNCTION_DECL or IDENTIFIER_NODE - TREE_VIA_PUBLIC in - TREE_LIST or TREE_VEC ASM_VOLATILE_P in ASM_EXPR -- 2.30.2