Deleted Added
full compact
c-typeck.c (259584) c-typeck.c (259947)
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

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

1918 TREE_READONLY (ref) = TYPE_READONLY (t);
1919 TREE_SIDE_EFFECTS (ref)
1920 = TYPE_VOLATILE (t) || TREE_SIDE_EFFECTS (pointer);
1921 TREE_THIS_VOLATILE (ref) = TYPE_VOLATILE (t);
1922 return ref;
1923 }
1924 }
1925 else if (TREE_CODE (pointer) != ERROR_MARK)
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

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

1918 TREE_READONLY (ref) = TYPE_READONLY (t);
1919 TREE_SIDE_EFFECTS (ref)
1920 = TYPE_VOLATILE (t) || TREE_SIDE_EFFECTS (pointer);
1921 TREE_THIS_VOLATILE (ref) = TYPE_VOLATILE (t);
1922 return ref;
1923 }
1924 }
1925 else if (TREE_CODE (pointer) != ERROR_MARK)
1926 error ("invalid type argument of %qs", errorstring);
1926 error ("invalid type argument of %qs (have %qT)", errorstring, type);
1927 return error_mark_node;
1928}
1929
1930/* This handles expressions of the form "a[i]", which denotes
1931 an array reference.
1932
1933 This is logically equivalent in C to *(a+i), but we may do it differently.
1934 If A is a variable or a member, we generate a primitive ARRAY_REF.

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

8130 if (code0 == ERROR_MARK || code1 == ERROR_MARK)
8131 return error_mark_node;
8132
8133 if (code0 == VECTOR_TYPE && code1 == VECTOR_TYPE
8134 && (!tree_int_cst_equal (TYPE_SIZE (type0), TYPE_SIZE (type1))
8135 || !same_scalar_type_ignoring_signedness (TREE_TYPE (type0),
8136 TREE_TYPE (type1))))
8137 {
1927 return error_mark_node;
1928}
1929
1930/* This handles expressions of the form "a[i]", which denotes
1931 an array reference.
1932
1933 This is logically equivalent in C to *(a+i), but we may do it differently.
1934 If A is a variable or a member, we generate a primitive ARRAY_REF.

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

8130 if (code0 == ERROR_MARK || code1 == ERROR_MARK)
8131 return error_mark_node;
8132
8133 if (code0 == VECTOR_TYPE && code1 == VECTOR_TYPE
8134 && (!tree_int_cst_equal (TYPE_SIZE (type0), TYPE_SIZE (type1))
8135 || !same_scalar_type_ignoring_signedness (TREE_TYPE (type0),
8136 TREE_TYPE (type1))))
8137 {
8138 binary_op_error (code);
8138 binary_op_error (code, type0, type1);
8139 return error_mark_node;
8140 }
8141
8142 if ((code0 == INTEGER_TYPE || code0 == REAL_TYPE || code0 == COMPLEX_TYPE
8143 || code0 == VECTOR_TYPE)
8144 &&
8145 (code1 == INTEGER_TYPE || code1 == REAL_TYPE || code1 == COMPLEX_TYPE
8146 || code1 == VECTOR_TYPE))

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

8426 /* At this point, RESULT_TYPE must be nonzero to avoid an error message.
8427 If CONVERTED is zero, both args will be converted to type RESULT_TYPE.
8428 Then the expression will be built.
8429 It will be given type FINAL_TYPE if that is nonzero;
8430 otherwise, it will be given type RESULT_TYPE. */
8431
8432 if (!result_type)
8433 {
8139 return error_mark_node;
8140 }
8141
8142 if ((code0 == INTEGER_TYPE || code0 == REAL_TYPE || code0 == COMPLEX_TYPE
8143 || code0 == VECTOR_TYPE)
8144 &&
8145 (code1 == INTEGER_TYPE || code1 == REAL_TYPE || code1 == COMPLEX_TYPE
8146 || code1 == VECTOR_TYPE))

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

8426 /* At this point, RESULT_TYPE must be nonzero to avoid an error message.
8427 If CONVERTED is zero, both args will be converted to type RESULT_TYPE.
8428 Then the expression will be built.
8429 It will be given type FINAL_TYPE if that is nonzero;
8430 otherwise, it will be given type RESULT_TYPE. */
8431
8432 if (!result_type)
8433 {
8434 binary_op_error (code);
8434 binary_op_error (code, TREE_TYPE (op0), TREE_TYPE (op1));
8435 return error_mark_node;
8436 }
8437
8438 if (!converted)
8439 {
8440 if (TREE_TYPE (op0) != result_type)
8441 op0 = convert_and_check (result_type, op0);
8442 if (TREE_TYPE (op1) != result_type)

--- 322 unchanged lines hidden ---
8435 return error_mark_node;
8436 }
8437
8438 if (!converted)
8439 {
8440 if (TREE_TYPE (op0) != result_type)
8441 op0 = convert_and_check (result_type, op0);
8442 if (TREE_TYPE (op1) != result_type)

--- 322 unchanged lines hidden ---