This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Incomplete TREE_CONSTANT-propagation in build() ?


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]