aboutsummaryrefslogtreecommitdiff
path: root/gcc/expr.c
diff options
context:
space:
mode:
authorRichard Kenner <kenner@vlsi1.ultra.nyu.edu>2001-11-18 19:36:01 +0000
committerRichard Kenner <kenner@gcc.gnu.org>2001-11-18 14:36:01 -0500
commitc3d321205faccb3dc6c1360fe96b80b44f0682ab (patch)
treee65409914fec6e66c9baf2b8cc7705fd81ee165a /gcc/expr.c
parent69deb6e055c718a94929ffd3012b149c461bb9a0 (diff)
downloadgcc-c3d321205faccb3dc6c1360fe96b80b44f0682ab.zip
gcc-c3d321205faccb3dc6c1360fe96b80b44f0682ab.tar.gz
gcc-c3d321205faccb3dc6c1360fe96b80b44f0682ab.tar.bz2
tree.h (TYPE_ALIGN_OK): New flag.
* tree.h (TYPE_ALIGN_OK): New flag. * emit-rtl.c (set_mem_attributes): Handle it. * expr.c (emit_single_push_insn): Only set to alias set 0 if doing sibcall optimization. (expand_expr, case COMPONENT_REF): Call set_mem_attributes on case when make temporary. (expand_expr, case CONVERT_EXPR): Simplify convert-to-union case. (expand_expr, case ADDR_EXPR): Abort if TYPE_ALIGN_OK and need copy. From-SVN: r47149
Diffstat (limited to 'gcc/expr.c')
-rw-r--r--gcc/expr.c41
1 files changed, 25 insertions, 16 deletions
diff --git a/gcc/expr.c b/gcc/expr.c
index 92397ee..5d933b2 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -3199,11 +3199,13 @@ emit_single_push_insn (mode, x, type)
if (type != 0)
{
set_mem_attributes (dest, type, 1);
- /* Function incoming arguments may overlap with sibling call
- outgoing arguments and we cannot allow reordering of reads
- from function arguments with stores to outgoing arguments
- of sibling calls. */
- set_mem_alias_set (dest, 0);
+
+ if (flag_optimize_sibling_calls)
+ /* Function incoming arguments may overlap with sibling call
+ outgoing arguments and we cannot allow reordering of reads
+ from function arguments with stores to outgoing arguments
+ of sibling calls. */
+ set_mem_alias_set (dest, 0);
}
emit_move_insn (dest, x);
}
@@ -7180,13 +7182,14 @@ expand_expr (exp, target, tmode, modifier)
if (mode == BLKmode)
{
- tree nt = build_qualified_type (type_for_mode (ext_mode, 0),
- TYPE_QUAL_CONST);
- rtx new = assign_temp (nt, 0, 1, 1);
+ rtx new = assign_temp (build_qualified_type
+ (type_for_mode (ext_mode, 0),
+ TYPE_QUAL_CONST), 0, 1, 1);
emit_move_insn (new, op0);
op0 = copy_rtx (new);
PUT_MODE (op0, BLKmode);
+ set_mem_attributes (op0, exp, 1);
}
return op0;
@@ -7423,14 +7426,17 @@ expand_expr (exp, target, tmode, modifier)
{
tree valtype = TREE_TYPE (TREE_OPERAND (exp, 0));
- /* If both input and output are BLKmode, this conversion
- isn't actually doing anything unless we need to make the
- alignment stricter. */
- if (mode == BLKmode && TYPE_MODE (valtype) == BLKmode
- && (TYPE_ALIGN (type) <= TYPE_ALIGN (valtype)
- || TYPE_ALIGN (type) >= BIGGEST_ALIGNMENT))
- return expand_expr (TREE_OPERAND (exp, 0), target, tmode,
- modifier);
+ /* If both input and output are BLKmode, this conversion isn't doing
+ anything except possibly changing memory attribute. */
+ if (mode == BLKmode && TYPE_MODE (valtype) == BLKmode)
+ {
+ rtx result = expand_expr (TREE_OPERAND (exp, 0), target, tmode,
+ modifier);
+
+ result = copy_rtx (result);
+ set_mem_attributes (result, exp, 0);
+ return result;
+ }
if (target == 0)
target = assign_temp (type, 0, 1, 1);
@@ -8673,6 +8679,9 @@ expand_expr (exp, target, tmode, modifier)
(TYPE_QUALS (inner_type)
| TYPE_QUAL_CONST)));
+ if (TYPE_ALIGN_OK (inner_type))
+ abort ();
+
emit_block_move (new, op0, expr_size (TREE_OPERAND (exp, 0)));
op0 = new;
}