Incomplete TREE_CONSTANT-propagation in build() ?
Ziemowit Laski
zlaski@apple.com
Tue Nov 4 20:37:00 GMT 2003
Here is a fragment from the build() routine, in gcc/tree.c:
/* Expressions without side effects may be constant if their
arguments are as well. */
constant = (TREE_CODE_CLASS (code) == '<'
|| TREE_CODE_CLASS (code) == '1'
|| TREE_CODE_CLASS (code) == '2'
|| TREE_CODE_CLASS (code) == 'c');
Class 'e' expressions (COMPOUND_EXPR, COND_EXPR, etc.) are excluded,
meaning that the build() routine will never mark them TREE_CONSTANT,
even if all their operands are TREE_CONSTANT.
Is there some reason for this?
Thanks,
--Zem
P.S. For the morbidly curious, I'm working on Motorola-style AltiVec
support in the 3.4 tree, and I really need compound expressions like
'(1, 2, 3, 4)' to be marked TREE_CONSTANT. :-)
--------------------------------------------------------------
Ziemowit Laski 1 Infinite Loop, MS 301-2K
Mac OS X Compiler Group Cupertino, CA USA 95014-2083
Apple Computer, Inc. +1.408.974.6229 Fax .5477
More information about the Gcc
mailing list