Mercurial > hg > CbC > CbC_gcc
comparison gcc/tree-nrv.c @ 145:1830386684a0
gcc-9.2.0
author | anatofuz |
---|---|
date | Thu, 13 Feb 2020 11:34:05 +0900 |
parents | 84e7813d76e9 |
children |
comparison
equal
deleted
inserted
replaced
131:84e7813d76e9 | 145:1830386684a0 |
---|---|
1 /* Language independent return value optimizations | 1 /* Language independent return value optimizations |
2 Copyright (C) 2004-2018 Free Software Foundation, Inc. | 2 Copyright (C) 2004-2020 Free Software Foundation, Inc. |
3 | 3 |
4 This file is part of GCC. | 4 This file is part of GCC. |
5 | 5 |
6 GCC is free software; you can redistribute it and/or modify | 6 GCC is free software; you can redistribute it and/or modify |
7 it under the terms of the GNU General Public License as published by | 7 it under the terms of the GNU General Public License as published by |
191 /* Now verify that this return statement uses the same value | 191 /* Now verify that this return statement uses the same value |
192 as any previously encountered return statement. */ | 192 as any previously encountered return statement. */ |
193 if (found != NULL) | 193 if (found != NULL) |
194 { | 194 { |
195 /* If we found a return statement using a different variable | 195 /* If we found a return statement using a different variable |
196 than previous return statements, then we can not perform | 196 than previous return statements, then we cannot perform |
197 NRV optimizations. */ | 197 NRV optimizations. */ |
198 if (found != rhs) | 198 if (found != rhs) |
199 return 0; | 199 return 0; |
200 } | 200 } |
201 else | 201 else |
376 | 376 |
377 stmt = dyn_cast <gcall *> (gsi_stmt (gsi)); | 377 stmt = dyn_cast <gcall *> (gsi_stmt (gsi)); |
378 if (stmt | 378 if (stmt |
379 && gimple_call_lhs (stmt) | 379 && gimple_call_lhs (stmt) |
380 && !gimple_call_return_slot_opt_p (stmt) | 380 && !gimple_call_return_slot_opt_p (stmt) |
381 /* Ignore internal functions without direct optabs, | 381 /* Ignore internal functions, those are expanded specially |
382 those are expanded specially and aggregate_value_p | 382 and aggregate_value_p on their result might result in |
383 on their result might result in undesirable warnings | 383 undesirable warnings with some backends. */ |
384 with some backends. */ | 384 && !gimple_call_internal_p (stmt) |
385 && (!gimple_call_internal_p (stmt) | |
386 || direct_internal_fn_p (gimple_call_internal_fn (stmt))) | |
387 && aggregate_value_p (TREE_TYPE (gimple_call_lhs (stmt)), | 385 && aggregate_value_p (TREE_TYPE (gimple_call_lhs (stmt)), |
388 gimple_call_fndecl (stmt))) | 386 gimple_call_fndecl (stmt))) |
389 { | 387 { |
390 /* Check if the location being assigned to is | 388 /* Check if the location being assigned to is |
391 clobbered by the call. */ | 389 clobbered by the call. */ |