Deleted Added
full compact
c-typeck.c (260011) c-typeck.c (260074)
1/* Build expressions with type checking for C compiler.
2 Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
3 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
4 Free Software Foundation, Inc.
5
6This file is part of GCC.
7
8GCC is free software; you can redistribute it and/or modify it under

--- 3879 unchanged lines hidden (view full) ---

3888 if (TREE_TYPE (TREE_TYPE (rhs)) != TREE_TYPE (type))
3889 rhs = build1 (NOP_EXPR, build_pointer_type (TREE_TYPE (type)), rhs);
3890
3891 rhs = build1 (NOP_EXPR, type, rhs);
3892 return rhs;
3893 }
3894 /* Some types can interconvert without explicit casts. */
3895 else if (codel == VECTOR_TYPE && coder == VECTOR_TYPE
1/* Build expressions with type checking for C compiler.
2 Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
3 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
4 Free Software Foundation, Inc.
5
6This file is part of GCC.
7
8GCC is free software; you can redistribute it and/or modify it under

--- 3879 unchanged lines hidden (view full) ---

3888 if (TREE_TYPE (TREE_TYPE (rhs)) != TREE_TYPE (type))
3889 rhs = build1 (NOP_EXPR, build_pointer_type (TREE_TYPE (type)), rhs);
3890
3891 rhs = build1 (NOP_EXPR, type, rhs);
3892 return rhs;
3893 }
3894 /* Some types can interconvert without explicit casts. */
3895 else if (codel == VECTOR_TYPE && coder == VECTOR_TYPE
3896 && vector_types_convertible_p (type, TREE_TYPE (rhs)))
3896 && vector_types_convertible_p (type, TREE_TYPE (rhs), true))
3897 return convert (type, rhs);
3898 /* Arithmetic types all interconvert, and enum is treated like int. */
3899 else if ((codel == INTEGER_TYPE || codel == REAL_TYPE
3900 || codel == ENUMERAL_TYPE || codel == COMPLEX_TYPE
3901 || codel == BOOLEAN_TYPE)
3902 && (coder == INTEGER_TYPE || coder == REAL_TYPE
3903 || coder == ENUMERAL_TYPE || coder == COMPLEX_TYPE
3904 || coder == BOOLEAN_TYPE))

--- 719 unchanged lines hidden (view full) ---

4624 }
4625 }
4626
4627 /* Build a VECTOR_CST from a *constant* vector constructor. If the
4628 vector constructor is not constant (e.g. {1,2,3,foo()}) then punt
4629 below and handle as a constructor. */
4630 if (code == VECTOR_TYPE
4631 && TREE_CODE (TREE_TYPE (inside_init)) == VECTOR_TYPE
3897 return convert (type, rhs);
3898 /* Arithmetic types all interconvert, and enum is treated like int. */
3899 else if ((codel == INTEGER_TYPE || codel == REAL_TYPE
3900 || codel == ENUMERAL_TYPE || codel == COMPLEX_TYPE
3901 || codel == BOOLEAN_TYPE)
3902 && (coder == INTEGER_TYPE || coder == REAL_TYPE
3903 || coder == ENUMERAL_TYPE || coder == COMPLEX_TYPE
3904 || coder == BOOLEAN_TYPE))

--- 719 unchanged lines hidden (view full) ---

4624 }
4625 }
4626
4627 /* Build a VECTOR_CST from a *constant* vector constructor. If the
4628 vector constructor is not constant (e.g. {1,2,3,foo()}) then punt
4629 below and handle as a constructor. */
4630 if (code == VECTOR_TYPE
4631 && TREE_CODE (TREE_TYPE (inside_init)) == VECTOR_TYPE
4632 && vector_types_convertible_p (TREE_TYPE (inside_init), type)
4632 && vector_types_convertible_p (TREE_TYPE (inside_init), type, true)
4633 && TREE_CONSTANT (inside_init))
4634 {
4635 if (TREE_CODE (inside_init) == VECTOR_CST
4636 && comptypes (TYPE_MAIN_VARIANT (TREE_TYPE (inside_init)),
4637 TYPE_MAIN_VARIANT (type)))
4638 return inside_init;
4639
4640 if (TREE_CODE (inside_init) == CONSTRUCTOR)

--- 4124 unchanged lines hidden ---
4633 && TREE_CONSTANT (inside_init))
4634 {
4635 if (TREE_CODE (inside_init) == VECTOR_CST
4636 && comptypes (TYPE_MAIN_VARIANT (TREE_TYPE (inside_init)),
4637 TYPE_MAIN_VARIANT (type)))
4638 return inside_init;
4639
4640 if (TREE_CODE (inside_init) == CONSTRUCTOR)

--- 4124 unchanged lines hidden ---