You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
+the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+Boston, MA 02110-1301, USA. */
#include "config.h"
#include "system.h"
then we could either have the languages register the optimization or
we could change the gating function to check the current language. */
-static void
+static unsigned int
tree_nrv (void)
{
tree result = DECL_RESULT (current_function_decl);
/* If this function does not return an aggregate type in memory, then
there is nothing to do. */
if (!aggregate_value_p (result, current_function_decl))
- return;
+ return 0;
/* Look through each block for assignments to the RESULT_DECL. */
FOR_EACH_BB (bb)
than previous return statements, then we can not perform
NRV optimizations. */
if (found != ret_expr)
- return;
+ return 0;
}
else
found = ret_expr;
|| DECL_ALIGN (found) > DECL_ALIGN (result)
|| !lang_hooks.types_compatible_p (TREE_TYPE (found),
result_type))
- return;
+ return 0;
}
}
}
if (!found)
- return;
+ return 0;
/* If dumping details, then note once and only the NRV replacement. */
if (dump_file && (dump_flags & TDF_DETAILS))
if (TREE_CODE (*tp) == MODIFY_EXPR
&& TREE_OPERAND (*tp, 0) == result
&& TREE_OPERAND (*tp, 1) == found)
- bsi_remove (&bsi);
+ bsi_remove (&bsi, true);
else
{
walk_tree (tp, finalize_nrv_r, &data, 0);
/* FOUND is no longer used. Ensure it gets removed. */
var_ann (found)->used = 0;
+ return 0;
}
struct tree_opt_pass pass_nrv =
escaped prior to the call. If it has, modifications to the local
variable will produce visible changes elsewhere, as in PR c++/19317. */
-static void
+static unsigned int
execute_return_slot_opt (void)
{
basic_block bb;
}
}
}
+ return 0;
}
struct tree_opt_pass pass_return_slot =