Commit 342f368c by Eric Botcazou Committed by Eric Botcazou

utils2.c (build_binary_op): Do not use the type of the left operand if...

	* gcc-interface/utils2.c (build_binary_op) <MODIFY_EXPR>: Do not use
	the type of the left operand if it pads a self-referential type when
	the right operand is a constructor.

	* gcc-interface/lang-specs.h: Fix copyright date.

From-SVN: r149115
parent 9fb374d6
2009-06-30 Eric Botcazou <ebotcazou@adacore.com> 2009-06-30 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/utils2.c (build_binary_op) <MODIFY_EXPR>: Do not use
the type of the left operand if it pads a self-referential type when
the right operand is a constructor.
* gcc-interface/lang-specs.h: Fix copyright date.
2009-06-30 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/decl.c: Include tree-inline.h. * gcc-interface/decl.c: Include tree-inline.h.
(annotate_value) <CALL_EXPR>: Try to inline the call in the expression. (annotate_value) <CALL_EXPR>: Try to inline the call in the expression.
* gcc-interface/utils.c (max_size) <CALL_EXPR>: Likewise. * gcc-interface/utils.c (max_size) <CALL_EXPR>: Likewise.
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
* * * *
* C Header File * * C Header File *
* * * *
* Copyright (C) 1992-2008, Free Software Foundation, Inc. * * Copyright (C) 1992-2009, Free Software Foundation, Inc. *
* * * *
* GNAT is free software; you can redistribute it and/or modify it under * * GNAT is free software; you can redistribute it and/or modify it under *
* terms of the GNU General Public License as published by the Free Soft- * * terms of the GNU General Public License as published by the Free Soft- *
......
...@@ -707,9 +707,10 @@ build_binary_op (enum tree_code op_code, tree result_type, ...@@ -707,9 +707,10 @@ build_binary_op (enum tree_code op_code, tree result_type,
/* If we are copying between padded objects with compatible types, use /* If we are copying between padded objects with compatible types, use
the padded view of the objects, this is very likely more efficient. the padded view of the objects, this is very likely more efficient.
Likewise for a padded that is assigned a constructor, in order to Likewise for a padded object that is assigned a constructor, if we
avoid putting a VIEW_CONVERT_EXPR on the LHS. But don't do this if can convert the constructor to the inner type, to avoid putting a
we wouldn't have actually copied anything. */ VIEW_CONVERT_EXPR on the LHS. But don't do so if we wouldn't have
actually copied anything. */
else if (TREE_CODE (left_type) == RECORD_TYPE else if (TREE_CODE (left_type) == RECORD_TYPE
&& TYPE_IS_PADDING_P (left_type) && TYPE_IS_PADDING_P (left_type)
&& TREE_CONSTANT (TYPE_SIZE (left_type)) && TREE_CONSTANT (TYPE_SIZE (left_type))
...@@ -719,9 +720,11 @@ build_binary_op (enum tree_code op_code, tree result_type, ...@@ -719,9 +720,11 @@ build_binary_op (enum tree_code op_code, tree result_type,
&& TYPE_IS_PADDING_P && TYPE_IS_PADDING_P
(TREE_TYPE (TREE_OPERAND (right_operand, 0))) (TREE_TYPE (TREE_OPERAND (right_operand, 0)))
&& gnat_types_compatible_p && gnat_types_compatible_p
(left_type, (left_type,
TREE_TYPE (TREE_OPERAND (right_operand, 0)))) TREE_TYPE (TREE_OPERAND (right_operand, 0))))
|| TREE_CODE (right_operand) == CONSTRUCTOR) || (TREE_CODE (right_operand) == CONSTRUCTOR
&& !CONTAINS_PLACEHOLDER_P
(DECL_SIZE (TYPE_FIELDS (left_type)))))
&& !integer_zerop (TYPE_SIZE (right_type))) && !integer_zerop (TYPE_SIZE (right_type)))
operation_type = left_type; operation_type = left_type;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment