tree.c (build1_stat): Also propagate the TREE_CONSTANT and TREE_INVARIANT flags for a VIEW_CONVERT_EXPR.

* tree.c (build1_stat): Also propagate the TREE_CONSTANT and
	TREE_INVARIANT flags for a VIEW_CONVERT_EXPR.

From-SVN: r116071
This commit is contained in:
Eric Botcazou 2006-08-10 22:13:42 +00:00 committed by Eric Botcazou
parent b576b3a7fd
commit 5d5995f105
4 changed files with 25 additions and 2 deletions

View File

@ -1,3 +1,8 @@
2006-08-11 Eric Botcazou <ebotcazou@adacore.com>
* tree.c (build1_stat): Also propagate the TREE_CONSTANT and
TREE_INVARIANT flags for a VIEW_CONVERT_EXPR.
2006-08-10 Paul Brook <paul@codesourcery.com>
* final.c (final_scan_insn): Clear current_insn_predicate before

View File

@ -1,3 +1,7 @@
2006-08-10 Eric Botcazou <ebotcazou@adacore.com>
* gnat.dg/specs/static_initializer.ads: New test.
2006-08-10 Paul Brook <paul@codesourcery.com>
* gcc.target/arm/cond-asm.c: New test.

View File

@ -0,0 +1,14 @@
-- { dg-do compile }
package static_initializer is
type Vector is array (1 .. 3) of Float;
type Arr is array (Integer range 1 .. 3) of Vector;
Pos : constant Arr := ((0.0, 1.0, 2.0),
(0.5, 1.5, 2.5),
(1.0, 2.0, 4.0));
end;
-- { dg-final { scan-assembler-not "elabs" } }

View File

@ -2923,11 +2923,11 @@ build1_stat (enum tree_code code, tree type, tree node MEM_STAT_DECL)
break;
default:
if (TREE_CODE_CLASS (code) == tcc_unary
if ((TREE_CODE_CLASS (code) == tcc_unary || code == VIEW_CONVERT_EXPR)
&& node && !TYPE_P (node)
&& TREE_CONSTANT (node))
TREE_CONSTANT (t) = 1;
if (TREE_CODE_CLASS (code) == tcc_unary
if ((TREE_CODE_CLASS (code) == tcc_unary || code == VIEW_CONVERT_EXPR)
&& node && TREE_INVARIANT (node))
TREE_INVARIANT (t) = 1;
if (TREE_CODE_CLASS (code) == tcc_reference