Changeset 676
- Timestamp:
- Sep 9, 2003, 8:37:41 PM (22 years ago)
- Location:
- trunk/src/gcc/gcc
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/gcc/gcc/calls.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r675 r676 2274 2274 2275 2275 /* Cater to broken compilers. */ 2276 if (aggregate_value_p (exp))2276 if (aggregate_value_p2 (exp, fndecl)) /* bird: #631: return struct */ 2277 2277 { 2278 2278 /* This call returns a big structure. */ -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/gcc/gcc/config/i386/emx.c
-
Property cvs2svn:cvs-rev
changed from
1.24
to1.25
r675 r676 130 130 tree id, type; 131 131 int rc = 1; 132 132 133 /* 133 134 dfprintf((stderr, "emx_c_set_decl_assembler_name\n")); 134 135 DUMP(decl); 136 */ 135 137 136 138 /* Sometimes we recursively call DECL_ASSEMBLER_NAME to apply the default … … 421 423 } 422 424 } 425 426 427 /* Checks if the function is using either optlink or system calling convention 428 and returns 1 in those cases forcing the return value to be in memory. 429 The problem (#631) was that structures less than 8 bytes were returned in 430 registers. _System and _Optlink requires them to be passed in as a hidden 431 parameter. 432 @type is the return type. 433 @fntype is function type, call expression, function declaration or null. 434 The return value is 1 to force the return value into memory. Return 0 if we 435 don't know. */ 436 437 int emx_return_in_memory_with_fntype (tree type, tree fntype) 438 { 439 /* (from aggregate_value_p() CVS trunk) */ 440 if (fntype) 441 switch (TREE_CODE (fntype)) 442 { 443 case CALL_EXPR: 444 fntype = get_callee_fndecl (fntype); 445 fntype = fntype ? TREE_TYPE (fntype) : 0; 446 break; 447 case FUNCTION_DECL: 448 fntype = TREE_TYPE (fntype); 449 break; 450 case FUNCTION_TYPE: 451 case METHOD_TYPE: 452 break; 453 case IDENTIFIER_NODE: 454 fntype = 0; 455 break; 456 default: 457 /* We don't expect other rtl types here. */ 458 abort(); 459 } 460 461 /* (future targetm.calls.return_in_memory additions) */ 462 if (fntype 463 && AGGREGATE_TYPE_P (type) 464 && ( lookup_attribute ("optlink", TYPE_ATTRIBUTES (fntype)) 465 || lookup_attribute ("system", TYPE_ATTRIBUTES (fntype)))) 466 { 467 dfprintf((stderr, "emx_return_in_memory_with_fntype: returns 1\n")); 468 return 1; 469 } 470 471 /* return ix86_return_in_memory (exp); - future */ 472 dfprintf((stderr, "emx_return_in_memory_with_fntype: returns 0\n")); 473 return 0; 474 } 475 -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/gcc/gcc/config/i386/emx.h
-
Property cvs2svn:cvs-rev
changed from
1.20
to1.21
r675 r676 108 108 #define TARGET_CXX_SET_DECL_ASSEMBLER_NAME(decl) \ 109 109 (emx_c_set_decl_assembler_name (decl, DECL_LANG_SPECIFIC(decl) && DECL_FUNCTION_MEMBER_P (decl))) 110 111 /* #631: Hack (temporary, will be fixed properly 3.4.x it seems) for _Optlink and 112 _System functions which returns structures. (breaks some tcpip stuff.) */ 113 extern int emx_return_in_memory_with_fntype PARAMS ((tree type, tree fntype)); 114 #define RETURN_IN_MEMORY_WITH_FNTYPE emx_return_in_memory_with_fntype 110 115 111 116 /* This macros will stick a label to exception table for current file, -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/gcc/gcc/cp/decl.c
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r675 r676 14337 14337 simpler, since we don't have to worry about promoted modes. */ 14338 14338 if (r != error_mark_node 14339 && aggregate_value_p (TREE_TYPE (TREE_TYPE (fndecl))))14339 && aggregate_value_p2 (TREE_TYPE (TREE_TYPE (fndecl)), fndecl)) /* bird: #631: return struct */ 14340 14340 { 14341 14341 DECL_ALIGN (r) = DECL_ALIGN (DECL_RESULT (fndecl)); -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/gcc/gcc/cp/semantics.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r675 r676 2229 2229 copy_from_buffer_p = 0; 2230 2230 #ifdef PCC_STATIC_STRUCT_RETURN 2231 if (!AGGR_INIT_VIA_CTOR_P (aggr_init_expr) && aggregate_value_p (type))2231 if (!AGGR_INIT_VIA_CTOR_P (aggr_init_expr) && aggregate_value_p2 (type, fn)) /* bird: #631: return struct */ 2232 2232 { 2233 2233 int old_ac = flag_access_control; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/gcc/gcc/expr.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r675 r676 3791 3791 needs to be done. Handling this in the normal way is safe because no 3792 3792 computation is done before the call. */ 3793 if (TREE_CODE (from) == CALL_EXPR && ! aggregate_value_p (from)3793 if (TREE_CODE (from) == CALL_EXPR && ! aggregate_value_p2 (from, from) /* bird: #631: return struct */ 3794 3794 && TREE_CODE (TYPE_SIZE (TREE_TYPE (from))) == INTEGER_CST 3795 3795 && ! ((TREE_CODE (to) == VAR_DECL || TREE_CODE (to) == PARM_DECL) -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/gcc/gcc/function.c
-
Property cvs2svn:cvs-rev
changed from
1.3
to1.4
r675 r676 4278 4278 EXP may be a type node or an expression (whose type is tested). */ 4279 4279 4280 /* bird: #631: We need this change now to get _System and _Optlink working on 4281 the EMX target. In the CVS trunk aggregate_value_p is extended with fntype 4282 so this hack will eventually go away. */ 4283 #ifdef RETURN_IN_MEMORY_WITH_FNTYPE 4280 4284 int 4281 4285 aggregate_value_p (exp) 4282 4286 tree exp; 4283 4287 { 4288 return aggregate_value_p2 (exp, NULL_TREE); 4289 } 4290 4291 int 4292 aggregate_value_p2 (exp, fntype) 4293 tree exp, fntype; 4294 #else 4295 int 4296 aggregate_value_p (exp) 4297 tree exp; 4298 #endif 4299 { 4284 4300 int i, regno, nregs; 4285 4301 rtx reg; … … 4289 4305 if (TREE_CODE (type) == VOID_TYPE) 4290 4306 return 0; 4307 #ifdef RETURN_IN_MEMORY_WITH_FNTYPE /* bird: #631: return struct */ 4308 if (RETURN_IN_MEMORY_WITH_FNTYPE(type, fntype)) 4309 return 1; 4310 #endif 4291 4311 if (RETURN_IN_MEMORY (type)) 4292 4312 return 1; … … 4386 4406 4387 4407 /* If struct value address is treated as the first argument, make it so. */ 4388 if (aggregate_value_p (DECL_RESULT (fndecl))4408 if (aggregate_value_p2 (DECL_RESULT (fndecl), fndecl) /* bird: #631: return struct */ 4389 4409 && ! current_function_returns_pcc_struct 4390 4410 && struct_value_incoming_rtx == 0) … … 6408 6428 6409 6429 /* Set flags used by final.c. */ 6410 if (aggregate_value_p (DECL_RESULT (subr)))6430 if (aggregate_value_p2 (DECL_RESULT (subr), subr)) /* bird: #631: return struct */ 6411 6431 { 6412 6432 #ifdef PCC_STATIC_STRUCT_RETURN … … 6585 6605 6586 6606 /* Decide whether to return the value in memory or in a register. */ 6587 if (aggregate_value_p (DECL_RESULT (subr)))6607 if (aggregate_value_p2 (DECL_RESULT (subr), subr)) /* bird: #631: return struct */ 6588 6608 { 6589 6609 /* Returning something that won't go in a register. */ -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/gcc/gcc/integrate.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r675 r676 1030 1030 { 1031 1031 if (! structure_value_addr 1032 || ! aggregate_value_p (DECL_RESULT (fndecl)))1032 || ! aggregate_value_p2 (DECL_RESULT (fndecl), fndecl)) /* bird: #631: return struct */ 1033 1033 abort (); 1034 1034 … … 1285 1285 if (target 1286 1286 && TYPE_MODE (TREE_TYPE (TREE_TYPE (fndecl))) == BLKmode 1287 && ! aggregate_value_p (TREE_TYPE (TREE_TYPE (fndecl))))1287 && ! aggregate_value_p2 (TREE_TYPE (TREE_TYPE (fndecl)), fndecl)) /* bird: #631: return struct */ 1288 1288 target = copy_blkmode_from_reg (0, target, TREE_TYPE (TREE_TYPE (fndecl))); 1289 1289 -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/gcc/gcc/reg-stack.c
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r675 r676 832 832 /* If the value is supposed to be returned in memory, then clearly 833 833 it is not returned in a stack register. */ 834 if (aggregate_value_p (DECL_RESULT (decl)))834 if (aggregate_value_p2 (DECL_RESULT (decl), decl)) /* bird: #631: return struct */ 835 835 return 0; 836 836 -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/gcc/gcc/tree.h
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r675 r676 3020 3020 extern void preserve_rtl_expr_temps PARAMS ((tree)); 3021 3021 extern int aggregate_value_p PARAMS ((tree)); 3022 #ifdef RETURN_IN_MEMORY_WITH_FNTYPE /* bird: #631: return struct */ 3023 extern int aggregate_value_p2 PARAMS ((tree, tree)); 3024 #else 3025 #define aggregate_value_p2(exp, fntype) aggregate_value_p (exp) 3026 #endif 3022 3027 extern void free_temps_for_rtl_expr PARAMS ((tree)); 3023 3028 extern void instantiate_virtual_regs PARAMS ((tree, rtx)); -
Property cvs2svn:cvs-rev
changed from
Note:
See TracChangeset
for help on using the changeset viewer.