comparison gcc/c-decl.c @ 90:99e7b6776dd1

implemeted __rectype expression. add CbC-exanples/fact-rectype.s
author Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
date Sun, 25 Dec 2011 04:04:42 +0900
parents f26ecf70364b
children 5c3ad79fc15b
comparison
equal deleted inserted replaced
89:3356a4c26abc 90:99e7b6776dd1
5634 } 5634 }
5635 break; 5635 break;
5636 } 5636 }
5637 case cdk_pointer: 5637 case cdk_pointer:
5638 { 5638 {
5639 #ifndef noCbC
5640 if ( declspecs->typespec_word == cts_CbC_rec )
5641 {
5642 type = build_code_segment_type (type, NULL_TREE);
5643 }
5644 #endif
5639 /* Merge any constancy or volatility into the target type 5645 /* Merge any constancy or volatility into the target type
5640 for the pointer. */ 5646 for the pointer. */
5641 5647
5642 if (pedantic && TREE_CODE (type) == FUNCTION_TYPE 5648 if (pedantic && TREE_CODE (type) == FUNCTION_TYPE
5643 && type_quals) 5649 && type_quals)
8887 error_at (loc, 8893 error_at (loc,
8888 ("both %<long%> and %<void%> in " 8894 ("both %<long%> and %<void%> in "
8889 "declaration specifiers")); 8895 "declaration specifiers"));
8890 #ifndef noCbC 8896 #ifndef noCbC
8891 else if (specs->typespec_word == cts_CbC_code) 8897 else if (specs->typespec_word == cts_CbC_code)
8898 error_at (loc,
8899 ("both %<long%> and %<void%> in "
8900 "declaration specifiers"));
8901 else if (specs->typespec_word == cts_CbC_rec)
8892 error_at (loc, 8902 error_at (loc,
8893 ("both %<long%> and %<void%> in " 8903 ("both %<long%> and %<void%> in "
8894 "declaration specifiers")); 8904 "declaration specifiers"));
8895 #endif 8905 #endif
8896 else if (specs->typespec_word == cts_int128) 8906 else if (specs->typespec_word == cts_int128)
8934 error_at (loc, 8944 error_at (loc,
8935 ("both %<short%> and %<void%> in " 8945 ("both %<short%> and %<void%> in "
8936 "declaration specifiers")); 8946 "declaration specifiers"));
8937 #ifndef noCbC 8947 #ifndef noCbC
8938 else if (specs->typespec_word == cts_CbC_code) 8948 else if (specs->typespec_word == cts_CbC_code)
8949 error_at (loc,
8950 ("both %<short%> and %<void%> in "
8951 "declaration specifiers"));
8952 else if (specs->typespec_word == cts_CbC_rec)
8939 error_at (loc, 8953 error_at (loc,
8940 ("both %<short%> and %<void%> in " 8954 ("both %<short%> and %<void%> in "
8941 "declaration specifiers")); 8955 "declaration specifiers"));
8942 #endif 8956 #endif
8943 else if (specs->typespec_word == cts_int128) 8957 else if (specs->typespec_word == cts_int128)
8988 #ifndef noCbC 9002 #ifndef noCbC
8989 else if (specs->typespec_word == cts_CbC_code) 9003 else if (specs->typespec_word == cts_CbC_code)
8990 error_at (loc, 9004 error_at (loc,
8991 ("both %<signed%> and %<void%> in " 9005 ("both %<signed%> and %<void%> in "
8992 "declaration specifiers")); 9006 "declaration specifiers"));
9007 else if (specs->typespec_word == cts_CbC_rec)
9008 error_at (loc,
9009 ("both %<signed%> and %<void%> in "
9010 "declaration specifiers"));
8993 #endif 9011 #endif
8994 else if (specs->typespec_word == cts_bool) 9012 else if (specs->typespec_word == cts_bool)
8995 error_at (loc, 9013 error_at (loc,
8996 ("both %<signed%> and %<_Bool%> in " 9014 ("both %<signed%> and %<_Bool%> in "
8997 "declaration specifiers")); 9015 "declaration specifiers"));
9031 #ifndef noCbC 9049 #ifndef noCbC
9032 else if (specs->typespec_word == cts_CbC_code) 9050 else if (specs->typespec_word == cts_CbC_code)
9033 error_at (loc, 9051 error_at (loc,
9034 ("both %<unsigned%> and %<void%> in " 9052 ("both %<unsigned%> and %<void%> in "
9035 "declaration specifiers")); 9053 "declaration specifiers"));
9054 else if (specs->typespec_word == cts_CbC_rec)
9055 error_at (loc,
9056 ("both %<unsigned%> and %<void%> in "
9057 "declaration specifiers"));
9036 #endif 9058 #endif
9037 else if (specs->typespec_word == cts_bool) 9059 else if (specs->typespec_word == cts_bool)
9038 error_at (loc, 9060 error_at (loc,
9039 ("both %<unsigned%> and %<_Bool%> in " 9061 ("both %<unsigned%> and %<_Bool%> in "
9040 "declaration specifiers")); 9062 "declaration specifiers"));
9070 error_at (loc, 9092 error_at (loc,
9071 ("both %<complex%> and %<void%> in " 9093 ("both %<complex%> and %<void%> in "
9072 "declaration specifiers")); 9094 "declaration specifiers"));
9073 #ifndef noCbC 9095 #ifndef noCbC
9074 else if (specs->typespec_word == cts_CbC_code) 9096 else if (specs->typespec_word == cts_CbC_code)
9097 error_at (loc,
9098 ("both %<complex%> and %<void%> in "
9099 "declaration specifiers"));
9100 else if (specs->typespec_word == cts_CbC_rec)
9075 error_at (loc, 9101 error_at (loc,
9076 ("both %<complex%> and %<void%> in " 9102 ("both %<complex%> and %<void%> in "
9077 "declaration specifiers")); 9103 "declaration specifiers"));
9078 #endif 9104 #endif
9079 else if (specs->typespec_word == cts_bool) 9105 else if (specs->typespec_word == cts_bool)
9235 specs->typespec_word = cts_void; 9261 specs->typespec_word = cts_void;
9236 return specs; 9262 return specs;
9237 #ifndef noCbC 9263 #ifndef noCbC
9238 case RID_CbC_CODE: 9264 case RID_CbC_CODE:
9239 if (specs->long_p) 9265 if (specs->long_p)
9240 error ("both %<long%> and %<void%> in " 9266 error_at (loc,
9241 "declaration specifiers"); 9267 ("both %<long%> and %<_Bool%> in "
9242 else if (specs->short_p) 9268 "declaration specifiers"));
9243 error ("both %<short%> and %<void%> in " 9269 else if (specs->short_p)
9244 "declaration specifiers"); 9270 error_at (loc,
9245 else if (specs->signed_p) 9271 ("both %<short%> and %<_Bool%> in "
9246 error ("both %<signed%> and %<void%> in " 9272 "declaration specifiers"));
9247 "declaration specifiers"); 9273 else if (specs->signed_p)
9248 else if (specs->unsigned_p) 9274 error_at (loc,
9249 error ("both %<unsigned%> and %<void%> in " 9275 ("both %<signed%> and %<_Bool%> in "
9250 "declaration specifiers"); 9276 "declaration specifiers"));
9251 else if (specs->complex_p) 9277 else if (specs->unsigned_p)
9252 error ("both %<complex%> and %<void%> in " 9278 error_at (loc,
9253 "declaration specifiers"); 9279 ("both %<unsigned%> and %<_Bool%> in "
9280 "declaration specifiers"));
9281 else if (specs->complex_p)
9282 error_at (loc,
9283 ("both %<complex%> and %<_Bool%> in "
9284 "declaration specifiers"));
9254 else 9285 else
9255 specs->typespec_word = cts_CbC_code; 9286 specs->typespec_word = cts_CbC_code;
9287 return specs;
9288 case RID_CbC_REC:
9289 if (specs->long_p)
9290 error_at (loc,
9291 ("both %<long%> and %<_Bool%> in "
9292 "declaration specifiers"));
9293 else if (specs->short_p)
9294 error_at (loc,
9295 ("both %<short%> and %<_Bool%> in "
9296 "declaration specifiers"));
9297 else if (specs->signed_p)
9298 error_at (loc,
9299 ("both %<signed%> and %<_Bool%> in "
9300 "declaration specifiers"));
9301 else if (specs->unsigned_p)
9302 error_at (loc,
9303 ("both %<unsigned%> and %<_Bool%> in "
9304 "declaration specifiers"));
9305 else if (specs->complex_p)
9306 error_at (loc,
9307 ("both %<complex%> and %<_Bool%> in "
9308 "declaration specifiers"));
9309 else
9310 specs->typespec_word = cts_CbC_rec;
9256 return specs; 9311 return specs;
9257 #endif 9312 #endif
9258 case RID_BOOL: 9313 case RID_BOOL:
9259 if (specs->long_p) 9314 if (specs->long_p)
9260 error_at (loc, 9315 error_at (loc,
9674 switch (specs->typespec_word) 9729 switch (specs->typespec_word)
9675 { 9730 {
9676 case cts_void: 9731 case cts_void:
9677 #ifndef noCbC 9732 #ifndef noCbC
9678 case cts_CbC_code: 9733 case cts_CbC_code:
9734 case cts_CbC_rec:
9679 #endif 9735 #endif
9680 gcc_assert (!specs->long_p && !specs->short_p 9736 gcc_assert (!specs->long_p && !specs->short_p
9681 && !specs->signed_p && !specs->unsigned_p 9737 && !specs->signed_p && !specs->unsigned_p
9682 && !specs->complex_p); 9738 && !specs->complex_p);
9683 specs->type = void_type_node; 9739 specs->type = void_type_node;