2005-01-30 16:36:13 +01:00
|
|
|
@c Copyright (c) 1999, 2000, 2001, 2002, 2003, 2004, 2005
|
2001-05-27 19:09:47 +02:00
|
|
|
@c Free Software Foundation, Inc.
|
|
|
|
@c This is part of the GCC manual.
|
|
|
|
@c For copying conditions, see the file gcc.texi.
|
1999-09-19 17:50:40 +02:00
|
|
|
|
|
|
|
@c ---------------------------------------------------------------------
|
2001-05-27 19:09:47 +02:00
|
|
|
@c Trees
|
1999-09-19 17:50:40 +02:00
|
|
|
@c ---------------------------------------------------------------------
|
|
|
|
|
2001-05-27 19:09:47 +02:00
|
|
|
@node Trees
|
2001-06-21 02:03:48 +02:00
|
|
|
@chapter Trees: The intermediate representation used by the C and C++ front ends
|
2001-05-27 19:09:47 +02:00
|
|
|
@cindex Trees
|
|
|
|
@cindex C/C++ Internal Representation
|
2000-09-24 23:47:45 +02:00
|
|
|
|
2001-12-17 14:08:51 +01:00
|
|
|
This chapter documents the internal representation used by GCC to
|
2000-09-24 23:47:45 +02:00
|
|
|
represent C and C++ source programs. When presented with a C or C++
|
|
|
|
source program, GCC parses the program, performs semantic analysis
|
|
|
|
(including the generation of error messages), and then produces the
|
|
|
|
internal representation described here. This representation contains a
|
|
|
|
complete representation for the entire translation unit provided as
|
2001-06-21 02:03:48 +02:00
|
|
|
input to the front end. This representation is then typically processed
|
2000-09-24 23:47:45 +02:00
|
|
|
by a code-generator in order to produce machine code, but could also be
|
|
|
|
used in the creation of source browsers, intelligent editors, automatic
|
1999-09-19 17:50:40 +02:00
|
|
|
documentation generators, interpreters, and any other programs needing
|
2000-09-24 23:47:45 +02:00
|
|
|
the ability to process C or C++ code.
|
1999-09-19 17:50:40 +02:00
|
|
|
|
2001-05-27 19:09:47 +02:00
|
|
|
This chapter explains the internal representation. In particular, it
|
|
|
|
documents the internal representation for C and C++ source
|
2000-09-24 23:47:45 +02:00
|
|
|
constructs, and the macros, functions, and variables that can be used to
|
2002-04-25 11:30:11 +02:00
|
|
|
access these constructs. The C++ representation is largely a superset
|
2001-06-21 02:03:48 +02:00
|
|
|
of the representation used in the C front end. There is only one
|
|
|
|
construct used in C that does not appear in the C++ front end and that
|
2001-05-27 19:09:47 +02:00
|
|
|
is the GNU ``nested function'' extension. Many of the macros documented
|
|
|
|
here do not apply in C because the corresponding language constructs do
|
c-tree.texi, [...]: Replace . at end of sentences preceded by a capital letter with @..
* doc/c-tree.texi, doc/contrib.texi, doc/cpp.texi,
doc/cppinternals.texi, doc/extend.texi, doc/gcc.texi,
doc/gcov.texi, doc/install-old.texi, doc/install.texi,
doc/invoke.texi, doc/md.texi, doc/rtl.texi, doc/tm.texi: Replace
. at end of sentences preceded by a capital letter with @..
From-SVN: r43611
2001-06-27 17:04:16 +02:00
|
|
|
not appear in C@.
|
1999-09-19 17:50:40 +02:00
|
|
|
|
2001-06-21 02:03:48 +02:00
|
|
|
If you are developing a ``back end'', be it is a code-generator or some
|
1999-09-19 17:50:40 +02:00
|
|
|
other tool, that uses this representation, you may occasionally find
|
|
|
|
that you need to ask questions not easily answered by the functions and
|
|
|
|
macros available here. If that situation occurs, it is quite likely
|
2000-09-24 23:47:45 +02:00
|
|
|
that GCC already supports the functionality you desire, but that the
|
1999-09-19 17:50:40 +02:00
|
|
|
interface is simply not documented here. In that case, you should ask
|
2000-09-30 10:04:01 +02:00
|
|
|
the GCC maintainers (via mail to @email{gcc@@gcc.gnu.org}) about
|
1999-09-19 17:50:40 +02:00
|
|
|
documenting the functionality you require. Similarly, if you find
|
2001-06-21 02:03:48 +02:00
|
|
|
yourself writing functions that do not deal directly with your back end,
|
|
|
|
but instead might be useful to other people using the GCC front end, you
|
c-tree.texi, [...]: Replace . at end of sentences preceded by a capital letter with @..
* doc/c-tree.texi, doc/contrib.texi, doc/cpp.texi,
doc/cppinternals.texi, doc/extend.texi, doc/gcc.texi,
doc/gcov.texi, doc/install-old.texi, doc/install.texi,
doc/invoke.texi, doc/md.texi, doc/rtl.texi, doc/tm.texi: Replace
. at end of sentences preceded by a capital letter with @..
From-SVN: r43611
2001-06-27 17:04:16 +02:00
|
|
|
should submit your patches for inclusion in GCC@.
|
2000-09-24 23:47:45 +02:00
|
|
|
|
1999-09-19 17:50:40 +02:00
|
|
|
@menu
|
|
|
|
* Deficiencies:: Topics net yet covered in this document.
|
2001-05-27 19:09:47 +02:00
|
|
|
* Tree overview:: All about @code{tree}s.
|
c-tree.texi, [...]: Remove trailing whitespace.
* c-tree.texi, contrib.texi, cpp.texi, extend.texi, gcc.texi,
gcov.texi, install.texi, md.texi, objc.texi, rtl.texi, tm.texi:
Remove trailing whitespace.
From-SVN: r42678
2001-05-28 22:57:50 +02:00
|
|
|
* Types:: Fundamental and aggregate types.
|
1999-09-19 17:50:40 +02:00
|
|
|
* Scopes:: Namespaces and classes.
|
|
|
|
* Functions:: Overloading, function bodies, and linkage.
|
|
|
|
* Declarations:: Type declarations and variables.
|
2001-07-09 01:12:31 +02:00
|
|
|
* Attributes:: Declaration and type attributes.
|
2001-05-27 19:09:47 +02:00
|
|
|
* Expression trees:: From @code{typeid} to @code{throw}.
|
1999-09-19 17:50:40 +02:00
|
|
|
@end menu
|
|
|
|
|
|
|
|
@c ---------------------------------------------------------------------
|
|
|
|
@c Deficiencies
|
|
|
|
@c ---------------------------------------------------------------------
|
|
|
|
|
|
|
|
@node Deficiencies
|
2001-05-27 19:09:47 +02:00
|
|
|
@section Deficiencies
|
1999-09-19 17:50:40 +02:00
|
|
|
|
2002-12-17 20:59:45 +01:00
|
|
|
There are many places in which this document is incomplet and incorrekt.
|
1999-09-19 17:50:40 +02:00
|
|
|
It is, as of yet, only @emph{preliminary} documentation.
|
|
|
|
|
|
|
|
@c ---------------------------------------------------------------------
|
|
|
|
@c Overview
|
|
|
|
@c ---------------------------------------------------------------------
|
|
|
|
|
2001-05-27 19:09:47 +02:00
|
|
|
@node Tree overview
|
|
|
|
@section Overview
|
1999-09-19 17:50:40 +02:00
|
|
|
@cindex tree
|
|
|
|
@findex TREE_CODE
|
|
|
|
|
|
|
|
The central data structure used by the internal representation is the
|
|
|
|
@code{tree}. These nodes, while all of the C type @code{tree}, are of
|
|
|
|
many varieties. A @code{tree} is a pointer type, but the object to
|
|
|
|
which it points may be of a variety of types. From this point forward,
|
|
|
|
we will refer to trees in ordinary type, rather than in @code{this
|
|
|
|
font}, except when talking about the actual C type @code{tree}.
|
|
|
|
|
|
|
|
You can tell what kind of node a particular tree is by using the
|
2002-10-29 23:39:49 +01:00
|
|
|
@code{TREE_CODE} macro. Many, many macros take trees as input and
|
|
|
|
return trees as output. However, most macros require a certain kind of
|
1999-09-19 17:50:40 +02:00
|
|
|
tree node as input. In other words, there is a type-system for trees,
|
|
|
|
but it is not reflected in the C type-system.
|
|
|
|
|
c-tree.texi, [...]: Be more consistent about the use of "GCC" and related terms.
* doc/c-tree.texi, doc/contrib.texi, doc/extend.texi,
doc/gcc.texi, doc/gcov.texi, doc/install.texi, doc/invoke.texi,
doc/md.texi, doc/rtl.texi, doc/tm.texi: Be more consistent about
the use of "GCC" and related terms.
* doc/gcc.1, doc/gcov.1: Regenerate.
From-SVN: r43547
2001-06-25 02:21:28 +02:00
|
|
|
For safety, it is useful to configure GCC with @option{--enable-checking}.
|
1999-09-19 17:50:40 +02:00
|
|
|
Although this results in a significant performance penalty (since all
|
|
|
|
tree types are checked at run-time), and is therefore inappropriate in a
|
|
|
|
release version, it is extremely helpful during the development process.
|
|
|
|
|
|
|
|
Many macros behave as predicates. Many, although not all, of these
|
|
|
|
predicates end in @samp{_P}. Do not rely on the result type of these
|
|
|
|
macros being of any particular type. You may, however, rely on the fact
|
|
|
|
that the type can be compared to @code{0}, so that statements like
|
c-tree.texi, [...]: Use @smallexample instead of @example.
* doc/c-tree.texi, doc/compat.texi, doc/cpp.texi,
doc/cppopts.texi, doc/extend.texi, doc/install.texi,
doc/interface.texi, doc/invoke.texi, doc/libgcc.texi, doc/md.texi,
doc/objc.texi, doc/rtl.texi, doc/tm.texi, doc/trouble.texi: Use
@smallexample instead of @example.
From-SVN: r76075
2004-01-18 02:20:48 +01:00
|
|
|
@smallexample
|
1999-09-19 17:50:40 +02:00
|
|
|
if (TEST_P (t) && !TEST_P (y))
|
|
|
|
x = 1;
|
c-tree.texi, [...]: Use @smallexample instead of @example.
* doc/c-tree.texi, doc/compat.texi, doc/cpp.texi,
doc/cppopts.texi, doc/extend.texi, doc/install.texi,
doc/interface.texi, doc/invoke.texi, doc/libgcc.texi, doc/md.texi,
doc/objc.texi, doc/rtl.texi, doc/tm.texi, doc/trouble.texi: Use
@smallexample instead of @example.
From-SVN: r76075
2004-01-18 02:20:48 +01:00
|
|
|
@end smallexample
|
1999-09-19 17:50:40 +02:00
|
|
|
@noindent
|
|
|
|
and
|
c-tree.texi, [...]: Use @smallexample instead of @example.
* doc/c-tree.texi, doc/compat.texi, doc/cpp.texi,
doc/cppopts.texi, doc/extend.texi, doc/install.texi,
doc/interface.texi, doc/invoke.texi, doc/libgcc.texi, doc/md.texi,
doc/objc.texi, doc/rtl.texi, doc/tm.texi, doc/trouble.texi: Use
@smallexample instead of @example.
From-SVN: r76075
2004-01-18 02:20:48 +01:00
|
|
|
@smallexample
|
1999-09-19 17:50:40 +02:00
|
|
|
int i = (TEST_P (t) != 0);
|
c-tree.texi, [...]: Use @smallexample instead of @example.
* doc/c-tree.texi, doc/compat.texi, doc/cpp.texi,
doc/cppopts.texi, doc/extend.texi, doc/install.texi,
doc/interface.texi, doc/invoke.texi, doc/libgcc.texi, doc/md.texi,
doc/objc.texi, doc/rtl.texi, doc/tm.texi, doc/trouble.texi: Use
@smallexample instead of @example.
From-SVN: r76075
2004-01-18 02:20:48 +01:00
|
|
|
@end smallexample
|
1999-09-19 17:50:40 +02:00
|
|
|
@noindent
|
|
|
|
are legal. Macros that return @code{int} values now may be changed to
|
|
|
|
return @code{tree} values, or other pointers in the future. Even those
|
2001-10-10 01:11:55 +02:00
|
|
|
that continue to return @code{int} may return multiple nonzero codes
|
1999-09-19 17:50:40 +02:00
|
|
|
where previously they returned only zero and one. Therefore, you should
|
|
|
|
not write code like
|
c-tree.texi, [...]: Use @smallexample instead of @example.
* doc/c-tree.texi, doc/compat.texi, doc/cpp.texi,
doc/cppopts.texi, doc/extend.texi, doc/install.texi,
doc/interface.texi, doc/invoke.texi, doc/libgcc.texi, doc/md.texi,
doc/objc.texi, doc/rtl.texi, doc/tm.texi, doc/trouble.texi: Use
@smallexample instead of @example.
From-SVN: r76075
2004-01-18 02:20:48 +01:00
|
|
|
@smallexample
|
1999-09-19 17:50:40 +02:00
|
|
|
if (TEST_P (t) == 1)
|
c-tree.texi, [...]: Use @smallexample instead of @example.
* doc/c-tree.texi, doc/compat.texi, doc/cpp.texi,
doc/cppopts.texi, doc/extend.texi, doc/install.texi,
doc/interface.texi, doc/invoke.texi, doc/libgcc.texi, doc/md.texi,
doc/objc.texi, doc/rtl.texi, doc/tm.texi, doc/trouble.texi: Use
@smallexample instead of @example.
From-SVN: r76075
2004-01-18 02:20:48 +01:00
|
|
|
@end smallexample
|
1999-09-19 17:50:40 +02:00
|
|
|
@noindent
|
|
|
|
as this code is not guaranteed to work correctly in the future.
|
|
|
|
|
|
|
|
You should not take the address of values returned by the macros or
|
|
|
|
functions described here. In particular, no guarantee is given that the
|
|
|
|
values are lvalues.
|
|
|
|
|
|
|
|
In general, the names of macros are all in uppercase, while the names of
|
2003-07-31 03:32:24 +02:00
|
|
|
functions are entirely in lowercase. There are rare exceptions to this
|
1999-09-19 17:50:40 +02:00
|
|
|
rule. You should assume that any macro or function whose name is made
|
|
|
|
up entirely of uppercase letters may evaluate its arguments more than
|
|
|
|
once. You may assume that a macro or function whose name is made up
|
|
|
|
entirely of lowercase letters will evaluate its arguments only once.
|
|
|
|
|
|
|
|
The @code{error_mark_node} is a special tree. Its tree code is
|
|
|
|
@code{ERROR_MARK}, but since there is only ever one node with that code,
|
|
|
|
the usual practice is to compare the tree against
|
|
|
|
@code{error_mark_node}. (This test is just a test for pointer
|
|
|
|
equality.) If an error has occurred during front-end processing the
|
2001-06-21 02:03:48 +02:00
|
|
|
flag @code{errorcount} will be set. If the front end has encountered
|
1999-09-19 17:50:40 +02:00
|
|
|
code it cannot handle, it will issue a message to the user and set
|
|
|
|
@code{sorrycount}. When these flags are set, any macro or function
|
|
|
|
which normally returns a tree of a particular kind may instead return
|
|
|
|
the @code{error_mark_node}. Thus, if you intend to do any processing of
|
|
|
|
erroneous code, you must be prepared to deal with the
|
|
|
|
@code{error_mark_node}.
|
|
|
|
|
|
|
|
Occasionally, a particular tree slot (like an operand to an expression,
|
|
|
|
or a particular field in a declaration) will be referred to as
|
2004-10-28 02:20:42 +02:00
|
|
|
``reserved for the back end''. These slots are used to store RTL when
|
2001-06-21 02:03:48 +02:00
|
|
|
the tree is converted to RTL for use by the GCC back end. However, if
|
|
|
|
that process is not taking place (e.g., if the front end is being hooked
|
1999-09-19 17:50:40 +02:00
|
|
|
up to an intelligent editor), then those slots may be used by the
|
2001-06-21 02:03:48 +02:00
|
|
|
back end presently in use.
|
1999-09-19 17:50:40 +02:00
|
|
|
|
|
|
|
If you encounter situations that do not match this documentation, such
|
|
|
|
as tree nodes of types not mentioned here, or macros documented to
|
|
|
|
return entities of a particular kind that instead return entities of
|
2001-06-21 02:03:48 +02:00
|
|
|
some different kind, you have found a bug, either in the front end or in
|
1999-09-19 17:50:40 +02:00
|
|
|
the documentation. Please report these bugs as you would any other
|
|
|
|
bug.
|
|
|
|
|
|
|
|
@menu
|
2001-05-27 19:09:47 +02:00
|
|
|
* Macros and Functions::Macros and functions that can be used with all trees.
|
1999-09-19 17:50:40 +02:00
|
|
|
* Identifiers:: The names of things.
|
|
|
|
* Containers:: Lists and vectors.
|
|
|
|
@end menu
|
|
|
|
|
|
|
|
@c ---------------------------------------------------------------------
|
|
|
|
@c Trees
|
|
|
|
@c ---------------------------------------------------------------------
|
|
|
|
|
2001-05-27 19:09:47 +02:00
|
|
|
@node Macros and Functions
|
|
|
|
@subsection Trees
|
1999-09-19 17:50:40 +02:00
|
|
|
@cindex tree
|
|
|
|
|
|
|
|
This section is not here yet.
|
|
|
|
|
|
|
|
@c ---------------------------------------------------------------------
|
|
|
|
@c Identifiers
|
|
|
|
@c ---------------------------------------------------------------------
|
|
|
|
|
|
|
|
@node Identifiers
|
2001-05-27 19:09:47 +02:00
|
|
|
@subsection Identifiers
|
1999-09-19 17:50:40 +02:00
|
|
|
@cindex identifier
|
|
|
|
@cindex name
|
|
|
|
@tindex IDENTIFIER_NODE
|
|
|
|
|
|
|
|
An @code{IDENTIFIER_NODE} represents a slightly more general concept
|
|
|
|
that the standard C or C++ concept of identifier. In particular, an
|
|
|
|
@code{IDENTIFIER_NODE} may contain a @samp{$}, or other extraordinary
|
|
|
|
characters.
|
|
|
|
|
|
|
|
There are never two distinct @code{IDENTIFIER_NODE}s representing the
|
|
|
|
same identifier. Therefore, you may use pointer equality to compare
|
|
|
|
@code{IDENTIFIER_NODE}s, rather than using a routine like @code{strcmp}.
|
|
|
|
|
|
|
|
You can use the following macros to access identifiers:
|
|
|
|
@ftable @code
|
|
|
|
@item IDENTIFIER_POINTER
|
|
|
|
The string represented by the identifier, represented as a
|
|
|
|
@code{char*}. This string is always @code{NUL}-terminated, and contains
|
|
|
|
no embedded @code{NUL} characters.
|
|
|
|
|
|
|
|
@item IDENTIFIER_LENGTH
|
|
|
|
The length of the string returned by @code{IDENTIFIER_POINTER}, not
|
|
|
|
including the trailing @code{NUL}. This value of
|
2001-01-23 19:36:53 +01:00
|
|
|
@code{IDENTIFIER_LENGTH (x)} is always the same as @code{strlen
|
1999-09-19 17:50:40 +02:00
|
|
|
(IDENTIFIER_POINTER (x))}.
|
|
|
|
|
|
|
|
@item IDENTIFIER_OPNAME_P
|
|
|
|
This predicate holds if the identifier represents the name of an
|
|
|
|
overloaded operator. In this case, you should not depend on the
|
|
|
|
contents of either the @code{IDENTIFIER_POINTER} or the
|
|
|
|
@code{IDENTIFIER_LENGTH}.
|
|
|
|
|
|
|
|
@item IDENTIFIER_TYPENAME_P
|
|
|
|
This predicate holds if the identifier represents the name of a
|
|
|
|
user-defined conversion operator. In this case, the @code{TREE_TYPE} of
|
|
|
|
the @code{IDENTIFIER_NODE} holds the type to which the conversion
|
|
|
|
operator converts.
|
|
|
|
|
|
|
|
@end ftable
|
|
|
|
|
|
|
|
@c ---------------------------------------------------------------------
|
|
|
|
@c Containers
|
|
|
|
@c ---------------------------------------------------------------------
|
|
|
|
|
|
|
|
@node Containers
|
2001-05-27 19:09:47 +02:00
|
|
|
@subsection Containers
|
1999-09-19 17:50:40 +02:00
|
|
|
@cindex container
|
|
|
|
@cindex list
|
|
|
|
@cindex vector
|
|
|
|
@tindex TREE_LIST
|
|
|
|
@tindex TREE_VEC
|
|
|
|
@findex TREE_PURPOSE
|
|
|
|
@findex TREE_VALUE
|
|
|
|
@findex TREE_VEC_LENGTH
|
|
|
|
@findex TREE_VEC_ELT
|
|
|
|
|
|
|
|
Two common container data structures can be represented directly with
|
|
|
|
tree nodes. A @code{TREE_LIST} is a singly linked list containing two
|
|
|
|
trees per node. These are the @code{TREE_PURPOSE} and @code{TREE_VALUE}
|
|
|
|
of each node. (Often, the @code{TREE_PURPOSE} contains some kind of
|
|
|
|
tag, or additional information, while the @code{TREE_VALUE} contains the
|
|
|
|
majority of the payload. In other cases, the @code{TREE_PURPOSE} is
|
|
|
|
simply @code{NULL_TREE}, while in still others both the
|
|
|
|
@code{TREE_PURPOSE} and @code{TREE_VALUE} are of equal stature.) Given
|
|
|
|
one @code{TREE_LIST} node, the next node is found by following the
|
|
|
|
@code{TREE_CHAIN}. If the @code{TREE_CHAIN} is @code{NULL_TREE}, then
|
|
|
|
you have reached the end of the list.
|
|
|
|
|
|
|
|
A @code{TREE_VEC} is a simple vector. The @code{TREE_VEC_LENGTH} is an
|
|
|
|
integer (not a tree) giving the number of nodes in the vector. The
|
|
|
|
nodes themselves are accessed using the @code{TREE_VEC_ELT} macro, which
|
|
|
|
takes two arguments. The first is the @code{TREE_VEC} in question; the
|
|
|
|
second is an integer indicating which element in the vector is desired.
|
|
|
|
The elements are indexed from zero.
|
|
|
|
|
|
|
|
@c ---------------------------------------------------------------------
|
|
|
|
@c Types
|
|
|
|
@c ---------------------------------------------------------------------
|
|
|
|
|
|
|
|
@node Types
|
2001-05-27 19:09:47 +02:00
|
|
|
@section Types
|
1999-09-19 17:50:40 +02:00
|
|
|
@cindex type
|
|
|
|
@cindex pointer
|
|
|
|
@cindex reference
|
|
|
|
@cindex fundamental type
|
|
|
|
@cindex array
|
|
|
|
@tindex VOID_TYPE
|
|
|
|
@tindex INTEGER_TYPE
|
|
|
|
@tindex TYPE_MIN_VALUE
|
|
|
|
@tindex TYPE_MAX_VALUE
|
|
|
|
@tindex REAL_TYPE
|
|
|
|
@tindex COMPLEX_TYPE
|
|
|
|
@tindex ENUMERAL_TYPE
|
|
|
|
@tindex BOOLEAN_TYPE
|
|
|
|
@tindex POINTER_TYPE
|
|
|
|
@tindex REFERENCE_TYPE
|
|
|
|
@tindex FUNCTION_TYPE
|
|
|
|
@tindex METHOD_TYPE
|
|
|
|
@tindex ARRAY_TYPE
|
|
|
|
@tindex RECORD_TYPE
|
|
|
|
@tindex UNION_TYPE
|
2000-09-07 10:42:34 +02:00
|
|
|
@tindex UNKNOWN_TYPE
|
|
|
|
@tindex OFFSET_TYPE
|
|
|
|
@tindex TYPENAME_TYPE
|
|
|
|
@tindex TYPEOF_TYPE
|
1999-09-19 17:50:40 +02:00
|
|
|
@findex CP_TYPE_QUALS
|
|
|
|
@findex TYPE_UNQUALIFIED
|
|
|
|
@findex TYPE_QUAL_CONST
|
|
|
|
@findex TYPE_QUAL_VOLATILE
|
|
|
|
@findex TYPE_QUAL_RESTRICT
|
2000-09-07 10:42:34 +02:00
|
|
|
@findex TYPE_MAIN_VARIANT
|
1999-09-19 17:50:40 +02:00
|
|
|
@cindex qualified type
|
|
|
|
@findex TYPE_SIZE
|
|
|
|
@findex TYPE_ALIGN
|
|
|
|
@findex TYPE_PRECISION
|
|
|
|
@findex TYPE_ARG_TYPES
|
|
|
|
@findex TYPE_METHOD_BASETYPE
|
|
|
|
@findex TYPE_PTRMEM_P
|
2000-09-07 10:42:34 +02:00
|
|
|
@findex TYPE_OFFSET_BASETYPE
|
|
|
|
@findex TREE_TYPE
|
|
|
|
@findex TYPE_CONTEXT
|
|
|
|
@findex TYPE_NAME
|
|
|
|
@findex TYPENAME_TYPE_FULLNAME
|
|
|
|
@findex TYPE_FIELDS
|
2000-09-12 10:54:21 +02:00
|
|
|
@findex TYPE_PTROBV_P
|
c-common.c (c_common_nodes_and_builtins): Since variants of void_type_node get built before it is given a name...
2007-01-02 Douglas Gregor <doug.gregor@gmail.com>
* c-common.c(c_common_nodes_and_builtins): Since variants of
void_type_node get built before it is given a name, we need to
give those variants the name, too.
(complete_array_type): We need to work with the canonical main
type of the array, from which we will build the qualified version.
* params.def (PARAM_VERIFY_CANONICAL_TYPES): New.
* print-tree.c (print_node): Display canonical type information
for each type.
* stor-layout.c (layout_type): When we don't know the
alignment of a type for which we're building an array, we end up
guessing wrong, so make the type require structural equality.
* tree.c (make_node_stat): When we build a new type, it is its
own canonical type.
(build_type_attribute_qual_variant): When building an attribute
variant, its canonical type is the non-attribute variant. However,
if the attributes are target-dependent and they differ, we need to
use structural equality checks for this type.
(build_qualified_type): A qualified type is not equivalent to its
unqualified variant; set the canonical type appropriately.
(build_distinct_type_copy): When building a distinct type from
another type, the new type is its own canonical type.
(build_variant_type_copy): When building a new type variant, we
assume that it is equivalent to the original type.
(build_pointer_type_for_mode): When building a pointer type, also
build a canonical type pointer.
(build_reference_type_for_mode): When building a reference type,
also build a canonical type reference.
(build_index_type): When we can't hash an index type (e.g.,
because its maximum value is negative), the index type requires
structural equality tests.
(build_array_type): Build the canonical form of an array type.
(build_function_type): Function types require structural equality,
because they contain default arguments, attributes, etc.
(build_method_type_directly): Ditto for method types.
(build_offset_type): Build the canonical offset type.
(build_complex_type): Build the canonical vector type.
(make_vector_type): Build the canonical vector type.
* tree.h (TYPE_CANONICAL): New.
(TYPE_STRUCTURAL_EQUALITY_P): New.
(SET_TYPE_STRUCTURAL_EQUALITY): New.
(struct tree_type): Added "canonical" field.
* params.h (VERIFY_CANONICAL_TYPES): New.
* doc/c-tree.texi (TYPE_CANONICAL): Document.
(TYPE_STRUCTURAL_EQUALITY_P): Document.
(SET_TYPE_STRUCTURAL_EQUALITY): Document.
* doc/invoke.texi (verify-canonical-types): Document --param
parameter for verifying canonical types.
2007-01-02 Douglas Gregor <doug.gregor@gmail.com>
* typeck.c (structural_comptypes): Renamed from "comptypes".
(comptypes): Use canonical type information to perform fast type
comparison. When VERIFY_CANONICAL_TYPES, verify that the
canonical type comparison returns the same results as we would see
from the current, structural check. Support COMPARE_STRUCTURAL
when we need structural checks.
* decl.c (typename_compare): Fix comment.
(build_typename_type): TYPENAME_TYPE nodes require structural
equality checks, because they resolve different based on the
current class type.
(make_unbound_class_template): UNBOUND_CLASS_TEMPLATE nodes
require structural equality checks (for now).
(build_ptrmemfunc_type): Build the canonical pointer to member
function type.
(compute_array_index_type): Whenever we build a new index type
to represent the size of an array in a template, we need to mark
this index type as requiring structural equality. This goes for
arrays with value-dependent sizes with the current ABI, or all
arrays with ABI-1.
* tree.c (cplus_array_hash): New.
(struct cplus_array_info): New.
(cplus_array_compare): New.
(cplus_array_htab): New.
(build_cplus_array_type_1): Use a hash table to cache the array
types we build. Build the canonical array type for each array
type.
(cp_build_qualified_type_real): When building a cv-qualified array
type, use the hash table of array types and build canonical array
types as necessary.
(bind_template_template_parm): BOUND_TEMPLATE_TEMPLATE_PARM nodes
use structural equality (for now).
* cp-tree.h (COMPARE_STRUCTURAL): New.
* pt.c (canonical_template_parms): New.
(canonical_type_parameter): New.
(process_template_parm): Find the canonical type parameter.
(lookup_template_class): When we have named the primary template
type, set the canonical type for our template class to the primary
template type. If any of the template arguments need structural
equality checks, the template class needs structural equality
checks.
(tsubst): When reducing the level of a template template
parameter, we require structural equality tests for the resulting
parameter because its template parameters have not had their types
canonicalized. When reducing a template type parameter, find the
canonical reduced type parameter.
(any_template_arguments_need_structural_equality_p): New.
2007-01-02 Douglas Gregor <doug.gregor@gmail.com>
* objc-act.c (objc_build_volatilized_type): Keep track of
canonical types.
(objc_get_protocol_qualified_type): Ditto.
From-SVN: r120341
2007-01-02 15:23:26 +01:00
|
|
|
@findex TYPE_CANONICAL
|
|
|
|
@findex TYPE_STRUCTURAL_EQUALITY_P
|
|
|
|
@findex SET_TYPE_STRUCTURAL_EQUALITY
|
1999-09-19 17:50:40 +02:00
|
|
|
|
2000-09-24 23:47:45 +02:00
|
|
|
All types have corresponding tree nodes. However, you should not assume
|
|
|
|
that there is exactly one tree node corresponding to each type. There
|
|
|
|
are often several nodes each of which correspond to the same type.
|
1999-09-19 17:50:40 +02:00
|
|
|
|
|
|
|
For the most part, different kinds of types have different tree codes.
|
|
|
|
(For example, pointer types use a @code{POINTER_TYPE} code while arrays
|
|
|
|
use an @code{ARRAY_TYPE} code.) However, pointers to member functions
|
|
|
|
use the @code{RECORD_TYPE} code. Therefore, when writing a
|
|
|
|
@code{switch} statement that depends on the code associated with a
|
|
|
|
particular type, you should take care to handle pointers to member
|
|
|
|
functions under the @code{RECORD_TYPE} case label.
|
|
|
|
|
|
|
|
In C++, an array type is not qualified; rather the type of the array
|
|
|
|
elements is qualified. This situation is reflected in the intermediate
|
|
|
|
representation. The macros described here will always examine the
|
|
|
|
qualification of the underlying element type when applied to an array
|
|
|
|
type. (If the element type is itself an array, then the recursion
|
|
|
|
continues until a non-array type is found, and the qualification of this
|
|
|
|
type is examined.) So, for example, @code{CP_TYPE_CONST_P} will hold of
|
|
|
|
the type @code{const int ()[7]}, denoting an array of seven @code{int}s.
|
|
|
|
|
|
|
|
The following functions and macros deal with cv-qualification of types:
|
|
|
|
@ftable @code
|
|
|
|
@item CP_TYPE_QUALS
|
|
|
|
This macro returns the set of type qualifiers applied to this type.
|
|
|
|
This value is @code{TYPE_UNQUALIFIED} if no qualifiers have been
|
|
|
|
applied. The @code{TYPE_QUAL_CONST} bit is set if the type is
|
|
|
|
@code{const}-qualified. The @code{TYPE_QUAL_VOLATILE} bit is set if the
|
|
|
|
type is @code{volatile}-qualified. The @code{TYPE_QUAL_RESTRICT} bit is
|
|
|
|
set if the type is @code{restrict}-qualified.
|
|
|
|
|
|
|
|
@item CP_TYPE_CONST_P
|
|
|
|
This macro holds if the type is @code{const}-qualified.
|
|
|
|
|
|
|
|
@item CP_TYPE_VOLATILE_P
|
|
|
|
This macro holds if the type is @code{volatile}-qualified.
|
|
|
|
|
|
|
|
@item CP_TYPE_RESTRICT_P
|
|
|
|
This macro holds if the type is @code{restrict}-qualified.
|
|
|
|
|
2000-09-12 10:54:21 +02:00
|
|
|
@item CP_TYPE_CONST_NON_VOLATILE_P
|
|
|
|
This predicate holds for a type that is @code{const}-qualified, but
|
|
|
|
@emph{not} @code{volatile}-qualified; other cv-qualifiers are ignored as
|
c-tree.texi, [...]: Remove trailing whitespace.
* c-tree.texi, contrib.texi, cpp.texi, extend.texi, gcc.texi,
gcov.texi, install.texi, md.texi, objc.texi, rtl.texi, tm.texi:
Remove trailing whitespace.
From-SVN: r42678
2001-05-28 22:57:50 +02:00
|
|
|
well: only the @code{const}-ness is tested.
|
2000-09-12 10:54:21 +02:00
|
|
|
|
1999-09-19 17:50:40 +02:00
|
|
|
@item TYPE_MAIN_VARIANT
|
|
|
|
This macro returns the unqualified version of a type. It may be applied
|
|
|
|
to an unqualified type, but it is not always the identity function in
|
|
|
|
that case.
|
|
|
|
@end ftable
|
|
|
|
|
|
|
|
A few other macros and functions are usable with all types:
|
|
|
|
@ftable @code
|
|
|
|
@item TYPE_SIZE
|
|
|
|
The number of bits required to represent the type, represented as an
|
|
|
|
@code{INTEGER_CST}. For an incomplete type, @code{TYPE_SIZE} will be
|
|
|
|
@code{NULL_TREE}.
|
|
|
|
|
|
|
|
@item TYPE_ALIGN
|
|
|
|
The alignment of the type, in bits, represented as an @code{int}.
|
|
|
|
|
|
|
|
@item TYPE_NAME
|
|
|
|
This macro returns a declaration (in the form of a @code{TYPE_DECL}) for
|
|
|
|
the type. (Note this macro does @emph{not} return a
|
|
|
|
@code{IDENTIFIER_NODE}, as you might expect, given its name!) You can
|
|
|
|
look at the @code{DECL_NAME} of the @code{TYPE_DECL} to obtain the
|
|
|
|
actual name of the type. The @code{TYPE_NAME} will be @code{NULL_TREE}
|
c-tree.texi, [...]: Fix spelling and typos.
* doc/c-tree.texi, doc/contrib.texi, doc/extend.texi,
doc/gcc.texi, doc/install.texi, doc/invoke.texi, doc/md.texi,
doc/objc.texi, doc/rtl.texi, doc/tm.texi: Fix spelling and typos.
Consistently use "built-in" and "bit-field". Minor logical markup
improvements.
* doc/gcc.1: Regenerate.
From-SVN: r43383
2001-06-15 00:51:18 +02:00
|
|
|
for a type that is not a built-in type, the result of a typedef, or a
|
1999-09-19 17:50:40 +02:00
|
|
|
named class type.
|
|
|
|
|
2000-09-12 10:54:21 +02:00
|
|
|
@item CP_INTEGRAL_TYPE
|
|
|
|
This predicate holds if the type is an integral type. Notice that in
|
c-tree.texi, [...]: Remove trailing whitespace.
* c-tree.texi, contrib.texi, cpp.texi, extend.texi, gcc.texi,
gcov.texi, install.texi, md.texi, objc.texi, rtl.texi, tm.texi:
Remove trailing whitespace.
From-SVN: r42678
2001-05-28 22:57:50 +02:00
|
|
|
C++, enumerations are @emph{not} integral types.
|
2000-09-12 10:54:21 +02:00
|
|
|
|
|
|
|
@item ARITHMETIC_TYPE_P
|
|
|
|
This predicate holds if the type is an integral type (in the C++ sense)
|
|
|
|
or a floating point type.
|
|
|
|
|
|
|
|
@item CLASS_TYPE_P
|
|
|
|
This predicate holds for a class-type.
|
|
|
|
|
|
|
|
@item TYPE_BUILT_IN
|
c-tree.texi, [...]: Fix spelling and typos.
* doc/c-tree.texi, doc/contrib.texi, doc/extend.texi,
doc/gcc.texi, doc/install.texi, doc/invoke.texi, doc/md.texi,
doc/objc.texi, doc/rtl.texi, doc/tm.texi: Fix spelling and typos.
Consistently use "built-in" and "bit-field". Minor logical markup
improvements.
* doc/gcc.1: Regenerate.
From-SVN: r43383
2001-06-15 00:51:18 +02:00
|
|
|
This predicate holds for a built-in type.
|
2000-09-12 10:54:21 +02:00
|
|
|
|
|
|
|
@item TYPE_PTRMEM_P
|
|
|
|
This predicate holds if the type is a pointer to data member.
|
|
|
|
|
|
|
|
@item TYPE_PTR_P
|
|
|
|
This predicate holds if the type is a pointer type, and the pointee is
|
c-tree.texi, [...]: Remove trailing whitespace.
* c-tree.texi, contrib.texi, cpp.texi, extend.texi, gcc.texi,
gcov.texi, install.texi, md.texi, objc.texi, rtl.texi, tm.texi:
Remove trailing whitespace.
From-SVN: r42678
2001-05-28 22:57:50 +02:00
|
|
|
not a data member.
|
2000-09-12 10:54:21 +02:00
|
|
|
|
|
|
|
@item TYPE_PTRFN_P
|
|
|
|
This predicate holds for a pointer to function type.
|
|
|
|
|
|
|
|
@item TYPE_PTROB_P
|
|
|
|
This predicate holds for a pointer to object type. Note however that it
|
2001-06-27 00:47:11 +02:00
|
|
|
does not hold for the generic pointer to object type @code{void *}. You
|
2000-09-12 10:54:21 +02:00
|
|
|
may use @code{TYPE_PTROBV_P} to test for a pointer to object type as
|
|
|
|
well as @code{void *}.
|
|
|
|
|
c-common.c (c_common_nodes_and_builtins): Since variants of void_type_node get built before it is given a name...
2007-01-02 Douglas Gregor <doug.gregor@gmail.com>
* c-common.c(c_common_nodes_and_builtins): Since variants of
void_type_node get built before it is given a name, we need to
give those variants the name, too.
(complete_array_type): We need to work with the canonical main
type of the array, from which we will build the qualified version.
* params.def (PARAM_VERIFY_CANONICAL_TYPES): New.
* print-tree.c (print_node): Display canonical type information
for each type.
* stor-layout.c (layout_type): When we don't know the
alignment of a type for which we're building an array, we end up
guessing wrong, so make the type require structural equality.
* tree.c (make_node_stat): When we build a new type, it is its
own canonical type.
(build_type_attribute_qual_variant): When building an attribute
variant, its canonical type is the non-attribute variant. However,
if the attributes are target-dependent and they differ, we need to
use structural equality checks for this type.
(build_qualified_type): A qualified type is not equivalent to its
unqualified variant; set the canonical type appropriately.
(build_distinct_type_copy): When building a distinct type from
another type, the new type is its own canonical type.
(build_variant_type_copy): When building a new type variant, we
assume that it is equivalent to the original type.
(build_pointer_type_for_mode): When building a pointer type, also
build a canonical type pointer.
(build_reference_type_for_mode): When building a reference type,
also build a canonical type reference.
(build_index_type): When we can't hash an index type (e.g.,
because its maximum value is negative), the index type requires
structural equality tests.
(build_array_type): Build the canonical form of an array type.
(build_function_type): Function types require structural equality,
because they contain default arguments, attributes, etc.
(build_method_type_directly): Ditto for method types.
(build_offset_type): Build the canonical offset type.
(build_complex_type): Build the canonical vector type.
(make_vector_type): Build the canonical vector type.
* tree.h (TYPE_CANONICAL): New.
(TYPE_STRUCTURAL_EQUALITY_P): New.
(SET_TYPE_STRUCTURAL_EQUALITY): New.
(struct tree_type): Added "canonical" field.
* params.h (VERIFY_CANONICAL_TYPES): New.
* doc/c-tree.texi (TYPE_CANONICAL): Document.
(TYPE_STRUCTURAL_EQUALITY_P): Document.
(SET_TYPE_STRUCTURAL_EQUALITY): Document.
* doc/invoke.texi (verify-canonical-types): Document --param
parameter for verifying canonical types.
2007-01-02 Douglas Gregor <doug.gregor@gmail.com>
* typeck.c (structural_comptypes): Renamed from "comptypes".
(comptypes): Use canonical type information to perform fast type
comparison. When VERIFY_CANONICAL_TYPES, verify that the
canonical type comparison returns the same results as we would see
from the current, structural check. Support COMPARE_STRUCTURAL
when we need structural checks.
* decl.c (typename_compare): Fix comment.
(build_typename_type): TYPENAME_TYPE nodes require structural
equality checks, because they resolve different based on the
current class type.
(make_unbound_class_template): UNBOUND_CLASS_TEMPLATE nodes
require structural equality checks (for now).
(build_ptrmemfunc_type): Build the canonical pointer to member
function type.
(compute_array_index_type): Whenever we build a new index type
to represent the size of an array in a template, we need to mark
this index type as requiring structural equality. This goes for
arrays with value-dependent sizes with the current ABI, or all
arrays with ABI-1.
* tree.c (cplus_array_hash): New.
(struct cplus_array_info): New.
(cplus_array_compare): New.
(cplus_array_htab): New.
(build_cplus_array_type_1): Use a hash table to cache the array
types we build. Build the canonical array type for each array
type.
(cp_build_qualified_type_real): When building a cv-qualified array
type, use the hash table of array types and build canonical array
types as necessary.
(bind_template_template_parm): BOUND_TEMPLATE_TEMPLATE_PARM nodes
use structural equality (for now).
* cp-tree.h (COMPARE_STRUCTURAL): New.
* pt.c (canonical_template_parms): New.
(canonical_type_parameter): New.
(process_template_parm): Find the canonical type parameter.
(lookup_template_class): When we have named the primary template
type, set the canonical type for our template class to the primary
template type. If any of the template arguments need structural
equality checks, the template class needs structural equality
checks.
(tsubst): When reducing the level of a template template
parameter, we require structural equality tests for the resulting
parameter because its template parameters have not had their types
canonicalized. When reducing a template type parameter, find the
canonical reduced type parameter.
(any_template_arguments_need_structural_equality_p): New.
2007-01-02 Douglas Gregor <doug.gregor@gmail.com>
* objc-act.c (objc_build_volatilized_type): Keep track of
canonical types.
(objc_get_protocol_qualified_type): Ditto.
From-SVN: r120341
2007-01-02 15:23:26 +01:00
|
|
|
@item TYPE_CANONICAL
|
|
|
|
This macro returns the ``canonical'' type for the given type
|
|
|
|
node. Canonical types are used to improve performance in the C++ and
|
|
|
|
Objective-C++ front ends by allowing efficient comparison between two
|
|
|
|
type nodes in @code{same_type_p}: if the @code{TYPE_CANONICAL} values
|
|
|
|
of the types are equal, the types are equivalent; otherwise, the types
|
|
|
|
are not equivalent. The notion of equivalence for canonical types is
|
|
|
|
the same as the notion of type equivalence in the language itself. For
|
|
|
|
instance,
|
|
|
|
|
|
|
|
When @code{TYPE_CANONICAL} is @code{NULL_TREE}, there is no canonical
|
|
|
|
type for the given type node. In this case, comparison between this
|
|
|
|
type and any other type requires the compiler to perform a deep,
|
|
|
|
``structural'' comparison to see if the two type nodes have the same
|
|
|
|
form and properties.
|
|
|
|
|
|
|
|
The canonical type for a node is always the most fundamental type in
|
|
|
|
the equivalence class of types. For instance, @code{int} is its own
|
|
|
|
canonical type. A typedef @code{I} of @code{int} will have @code{int}
|
|
|
|
as its canonical type. Similarly, @code{I*}@ and a typedef @code{IP}@
|
|
|
|
(defined to @code{I*}) will has @code{int*} as their canonical
|
|
|
|
type. When building a new type node, be sure to set
|
|
|
|
@code{TYPE_CANONICAL} to the appropriate canonical type. If the new
|
|
|
|
type is a compound type (built from other types), and any of those
|
|
|
|
other types require structural equality, use
|
|
|
|
@code{SET_TYPE_STRUCTURAL_EQUALITY} to ensure that the new type also
|
|
|
|
requires structural equality. Finally, if for some reason you cannot
|
|
|
|
guarantee that @code{TYPE_CANONICAL} will point to the canonical type,
|
|
|
|
use @code{SET_TYPE_STRUCTURAL_EQUALITY} to make sure that the new
|
|
|
|
type--and any type constructed based on it--requires structural
|
|
|
|
equality. If you suspect that the canonical type system is
|
|
|
|
miscomparing types, pass @code{--param verify-canonical-types=1} to
|
|
|
|
the compiler or configure with @code{--enable-checking} to force the
|
|
|
|
compiler to verify its canonical-type comparisons against the
|
|
|
|
structural comparisons; the compiler will then print any warnings if
|
|
|
|
the canonical types miscompare.
|
|
|
|
|
|
|
|
@item TYPE_STRUCTURAL_EQUALITY_P
|
|
|
|
This predicate holds when the node requires structural equality
|
|
|
|
checks, e.g., when @code{TYPE_CANONICAL} is @code{NULL_TREE}.
|
|
|
|
|
|
|
|
@item SET_TYPE_STRUCTURAL_EQUALITY
|
|
|
|
This macro states that the type node it is given requires structural
|
|
|
|
equality checks, e.g., it sets @code{TYPE_CANONICAL} to
|
|
|
|
@code{NULL_TREE}.
|
|
|
|
|
1999-09-19 17:50:40 +02:00
|
|
|
@item same_type_p
|
|
|
|
This predicate takes two types as input, and holds if they are the same
|
|
|
|
type. For example, if one type is a @code{typedef} for the other, or
|
|
|
|
both are @code{typedef}s for the same type. This predicate also holds if
|
|
|
|
the two trees given as input are simply copies of one another; i.e.,
|
|
|
|
there is no difference between them at the source level, but, for
|
|
|
|
whatever reason, a duplicate has been made in the representation. You
|
|
|
|
should never use @code{==} (pointer equality) to compare types; always
|
|
|
|
use @code{same_type_p} instead.
|
|
|
|
@end ftable
|
|
|
|
|
|
|
|
Detailed below are the various kinds of types, and the macros that can
|
|
|
|
be used to access them. Although other kinds of types are used
|
|
|
|
elsewhere in G++, the types described here are the only ones that you
|
|
|
|
will encounter while examining the intermediate representation.
|
|
|
|
|
|
|
|
@table @code
|
|
|
|
@item VOID_TYPE
|
|
|
|
Used to represent the @code{void} type.
|
|
|
|
|
|
|
|
@item INTEGER_TYPE
|
|
|
|
Used to represent the various integral types, including @code{char},
|
|
|
|
@code{short}, @code{int}, @code{long}, and @code{long long}. This code
|
2006-02-20 16:05:15 +01:00
|
|
|
is not used for enumeration types, nor for the @code{bool} type.
|
|
|
|
The @code{TYPE_PRECISION} is the number of bits used in
|
1999-09-19 17:50:40 +02:00
|
|
|
the representation, represented as an @code{unsigned int}. (Note that
|
|
|
|
in the general case this is not the same value as @code{TYPE_SIZE};
|
|
|
|
suppose that there were a 24-bit integer type, but that alignment
|
|
|
|
requirements for the ABI required 32-bit alignment. Then,
|
|
|
|
@code{TYPE_SIZE} would be an @code{INTEGER_CST} for 32, while
|
|
|
|
@code{TYPE_PRECISION} would be 24.) The integer type is unsigned if
|
2004-05-13 08:41:07 +02:00
|
|
|
@code{TYPE_UNSIGNED} holds; otherwise, it is signed.
|
1999-09-19 17:50:40 +02:00
|
|
|
|
|
|
|
The @code{TYPE_MIN_VALUE} is an @code{INTEGER_CST} for the smallest
|
|
|
|
integer that may be represented by this type. Similarly, the
|
|
|
|
@code{TYPE_MAX_VALUE} is an @code{INTEGER_CST} for the largest integer
|
|
|
|
that may be represented by this type.
|
|
|
|
|
|
|
|
@item REAL_TYPE
|
|
|
|
Used to represent the @code{float}, @code{double}, and @code{long
|
|
|
|
double} types. The number of bits in the floating-point representation
|
|
|
|
is given by @code{TYPE_PRECISION}, as in the @code{INTEGER_TYPE} case.
|
|
|
|
|
|
|
|
@item COMPLEX_TYPE
|
c-tree.texi, [...]: Fix spelling and typos.
* doc/c-tree.texi, doc/contrib.texi, doc/extend.texi,
doc/gcc.texi, doc/install.texi, doc/invoke.texi, doc/md.texi,
doc/objc.texi, doc/rtl.texi, doc/tm.texi: Fix spelling and typos.
Consistently use "built-in" and "bit-field". Minor logical markup
improvements.
* doc/gcc.1: Regenerate.
From-SVN: r43383
2001-06-15 00:51:18 +02:00
|
|
|
Used to represent GCC built-in @code{__complex__} data types. The
|
2000-04-22 14:01:30 +02:00
|
|
|
@code{TREE_TYPE} is the type of the real and imaginary parts.
|
1999-09-19 17:50:40 +02:00
|
|
|
|
|
|
|
@item ENUMERAL_TYPE
|
|
|
|
Used to represent an enumeration type. The @code{TYPE_PRECISION} gives
|
|
|
|
(as an @code{int}), the number of bits used to represent the type. If
|
2004-05-13 08:41:07 +02:00
|
|
|
there are no negative enumeration constants, @code{TYPE_UNSIGNED} will
|
1999-09-19 17:50:40 +02:00
|
|
|
hold. The minimum and maximum enumeration constants may be obtained
|
|
|
|
with @code{TYPE_MIN_VALUE} and @code{TYPE_MAX_VALUE}, respectively; each
|
|
|
|
of these macros returns an @code{INTEGER_CST}.
|
|
|
|
|
|
|
|
The actual enumeration constants themselves may be obtained by looking
|
|
|
|
at the @code{TYPE_VALUES}. This macro will return a @code{TREE_LIST},
|
|
|
|
containing the constants. The @code{TREE_PURPOSE} of each node will be
|
|
|
|
an @code{IDENTIFIER_NODE} giving the name of the constant; the
|
|
|
|
@code{TREE_VALUE} will be an @code{INTEGER_CST} giving the value
|
|
|
|
assigned to that constant. These constants will appear in the order in
|
|
|
|
which they were declared. The @code{TREE_TYPE} of each of these
|
|
|
|
constants will be the type of enumeration type itself.
|
|
|
|
|
|
|
|
@item BOOLEAN_TYPE
|
|
|
|
Used to represent the @code{bool} type.
|
|
|
|
|
|
|
|
@item POINTER_TYPE
|
|
|
|
Used to represent pointer types, and pointer to data member types. The
|
|
|
|
@code{TREE_TYPE} gives the type to which this type points. If the type
|
|
|
|
is a pointer to data member type, then @code{TYPE_PTRMEM_P} will hold.
|
|
|
|
For a pointer to data member type of the form @samp{T X::*},
|
|
|
|
@code{TYPE_PTRMEM_CLASS_TYPE} will be the type @code{X}, while
|
|
|
|
@code{TYPE_PTRMEM_POINTED_TO_TYPE} will be the type @code{T}.
|
|
|
|
|
|
|
|
@item REFERENCE_TYPE
|
|
|
|
Used to represent reference types. The @code{TREE_TYPE} gives the type
|
|
|
|
to which this type refers.
|
|
|
|
|
|
|
|
@item FUNCTION_TYPE
|
|
|
|
Used to represent the type of non-member functions and of static member
|
|
|
|
functions. The @code{TREE_TYPE} gives the return type of the function.
|
|
|
|
The @code{TYPE_ARG_TYPES} are a @code{TREE_LIST} of the argument types.
|
|
|
|
The @code{TREE_VALUE} of each node in this list is the type of the
|
|
|
|
corresponding argument; the @code{TREE_PURPOSE} is an expression for the
|
|
|
|
default argument value, if any. If the last node in the list is
|
|
|
|
@code{void_list_node} (a @code{TREE_LIST} node whose @code{TREE_VALUE}
|
|
|
|
is the @code{void_type_node}), then functions of this type do not take
|
|
|
|
variable arguments. Otherwise, they do take a variable number of
|
|
|
|
arguments.
|
|
|
|
|
2000-11-08 20:05:08 +01:00
|
|
|
Note that in C (but not in C++) a function declared like @code{void f()}
|
|
|
|
is an unprototyped function taking a variable number of arguments; the
|
2001-10-07 13:05:45 +02:00
|
|
|
@code{TYPE_ARG_TYPES} of such a function will be @code{NULL}.
|
2000-11-08 20:05:08 +01:00
|
|
|
|
1999-09-19 17:50:40 +02:00
|
|
|
@item METHOD_TYPE
|
|
|
|
Used to represent the type of a non-static member function. Like a
|
|
|
|
@code{FUNCTION_TYPE}, the return type is given by the @code{TREE_TYPE}.
|
|
|
|
The type of @code{*this}, i.e., the class of which functions of this
|
|
|
|
type are a member, is given by the @code{TYPE_METHOD_BASETYPE}. The
|
|
|
|
@code{TYPE_ARG_TYPES} is the parameter list, as for a
|
|
|
|
@code{FUNCTION_TYPE}, and includes the @code{this} argument.
|
|
|
|
|
|
|
|
@item ARRAY_TYPE
|
|
|
|
Used to represent array types. The @code{TREE_TYPE} gives the type of
|
|
|
|
the elements in the array. If the array-bound is present in the type,
|
|
|
|
the @code{TYPE_DOMAIN} is an @code{INTEGER_TYPE} whose
|
|
|
|
@code{TYPE_MIN_VALUE} and @code{TYPE_MAX_VALUE} will be the lower and
|
|
|
|
upper bounds of the array, respectively. The @code{TYPE_MIN_VALUE} will
|
|
|
|
always be an @code{INTEGER_CST} for zero, while the
|
|
|
|
@code{TYPE_MAX_VALUE} will be one less than the number of elements in
|
|
|
|
the array, i.e., the highest value which may be used to index an element
|
|
|
|
in the array.
|
|
|
|
|
|
|
|
@item RECORD_TYPE
|
|
|
|
Used to represent @code{struct} and @code{class} types, as well as
|
2001-12-05 23:59:09 +01:00
|
|
|
pointers to member functions and similar constructs in other languages.
|
|
|
|
@code{TYPE_FIELDS} contains the items contained in this type, each of
|
|
|
|
which can be a @code{FIELD_DECL}, @code{VAR_DECL}, @code{CONST_DECL}, or
|
|
|
|
@code{TYPE_DECL}. You may not make any assumptions about the ordering
|
|
|
|
of the fields in the type or whether one or more of them overlap. If
|
|
|
|
@code{TYPE_PTRMEMFUNC_P} holds, then this type is a pointer-to-member
|
|
|
|
type. In that case, the @code{TYPE_PTRMEMFUNC_FN_TYPE} is a
|
|
|
|
@code{POINTER_TYPE} pointing to a @code{METHOD_TYPE}. The
|
|
|
|
@code{METHOD_TYPE} is the type of a function pointed to by the
|
|
|
|
pointer-to-member function. If @code{TYPE_PTRMEMFUNC_P} does not hold,
|
|
|
|
this type is a class type. For more information, see @pxref{Classes}.
|
|
|
|
|
|
|
|
@item UNION_TYPE
|
|
|
|
Used to represent @code{union} types. Similar to @code{RECORD_TYPE}
|
|
|
|
except that all @code{FIELD_DECL} nodes in @code{TYPE_FIELD} start at
|
|
|
|
bit position zero.
|
|
|
|
|
|
|
|
@item QUAL_UNION_TYPE
|
|
|
|
Used to represent part of a variant record in Ada. Similar to
|
|
|
|
@code{UNION_TYPE} except that each @code{FIELD_DECL} has a
|
|
|
|
@code{DECL_QUALIFIER} field, which contains a boolean expression that
|
|
|
|
indicates whether the field is present in the object. The type will only
|
|
|
|
have one field, so each field's @code{DECL_QUALIFIER} is only evaluated
|
|
|
|
if none of the expressions in the previous fields in @code{TYPE_FIELDS}
|
|
|
|
are nonzero. Normally these expressions will reference a field in the
|
|
|
|
outer object using a @code{PLACEHOLDER_EXPR}.
|
1999-09-19 17:50:40 +02:00
|
|
|
|
2000-09-07 10:42:34 +02:00
|
|
|
@item UNKNOWN_TYPE
|
|
|
|
This node is used to represent a type the knowledge of which is
|
2000-11-10 06:56:47 +01:00
|
|
|
insufficient for a sound processing.
|
2000-09-07 10:42:34 +02:00
|
|
|
|
|
|
|
@item OFFSET_TYPE
|
2003-07-24 01:44:45 +02:00
|
|
|
This node is used to represent a pointer-to-data member. For a data
|
|
|
|
member @code{X::m} the @code{TYPE_OFFSET_BASETYPE} is @code{X} and the
|
|
|
|
@code{TREE_TYPE} is the type of @code{m}.
|
2000-09-07 10:42:34 +02:00
|
|
|
|
|
|
|
@item TYPENAME_TYPE
|
|
|
|
Used to represent a construct of the form @code{typename T::A}. The
|
|
|
|
@code{TYPE_CONTEXT} is @code{T}; the @code{TYPE_NAME} is an
|
2001-06-27 00:47:11 +02:00
|
|
|
@code{IDENTIFIER_NODE} for @code{A}. If the type is specified via a
|
2000-09-07 10:42:34 +02:00
|
|
|
template-id, then @code{TYPENAME_TYPE_FULLNAME} yields a
|
|
|
|
@code{TEMPLATE_ID_EXPR}. The @code{TREE_TYPE} is non-@code{NULL} if the
|
|
|
|
node is implicitly generated in support for the implicit typename
|
|
|
|
extension; in which case the @code{TREE_TYPE} is a type node for the
|
|
|
|
base-class.
|
|
|
|
|
|
|
|
@item TYPEOF_TYPE
|
|
|
|
Used to represent the @code{__typeof__} extension. The
|
|
|
|
@code{TYPE_FIELDS} is the expression the type of which is being
|
c-tree.texi, [...]: Remove trailing whitespace.
* c-tree.texi, contrib.texi, cpp.texi, extend.texi, gcc.texi,
gcov.texi, install.texi, md.texi, objc.texi, rtl.texi, tm.texi:
Remove trailing whitespace.
From-SVN: r42678
2001-05-28 22:57:50 +02:00
|
|
|
represented.
|
1999-09-19 17:50:40 +02:00
|
|
|
@end table
|
|
|
|
|
|
|
|
There are variables whose values represent some of the basic types.
|
|
|
|
These include:
|
|
|
|
@table @code
|
|
|
|
@item void_type_node
|
|
|
|
A node for @code{void}.
|
|
|
|
|
|
|
|
@item integer_type_node
|
|
|
|
A node for @code{int}.
|
|
|
|
|
|
|
|
@item unsigned_type_node.
|
|
|
|
A node for @code{unsigned int}.
|
|
|
|
|
|
|
|
@item char_type_node.
|
|
|
|
A node for @code{char}.
|
|
|
|
@end table
|
|
|
|
@noindent
|
|
|
|
It may sometimes be useful to compare one of these variables with a type
|
|
|
|
in hand, using @code{same_type_p}.
|
|
|
|
|
|
|
|
@c ---------------------------------------------------------------------
|
|
|
|
@c Scopes
|
|
|
|
@c ---------------------------------------------------------------------
|
|
|
|
|
|
|
|
@node Scopes
|
2001-05-27 19:09:47 +02:00
|
|
|
@section Scopes
|
1999-09-19 17:50:40 +02:00
|
|
|
@cindex namespace, class, scope
|
|
|
|
|
|
|
|
The root of the entire intermediate representation is the variable
|
|
|
|
@code{global_namespace}. This is the namespace specified with @code{::}
|
|
|
|
in C++ source code. All other namespaces, types, variables, functions,
|
|
|
|
and so forth can be found starting with this namespace.
|
|
|
|
|
|
|
|
Besides namespaces, the other high-level scoping construct in C++ is the
|
|
|
|
class. (Throughout this manual the term @dfn{class} is used to mean the
|
|
|
|
types referred to in the ANSI/ISO C++ Standard as classes; these include
|
|
|
|
types defined with the @code{class}, @code{struct}, and @code{union}
|
|
|
|
keywords.)
|
|
|
|
|
|
|
|
@menu
|
|
|
|
* Namespaces:: Member functions, types, etc.
|
|
|
|
* Classes:: Members, bases, friends, etc.
|
|
|
|
@end menu
|
|
|
|
|
|
|
|
@c ---------------------------------------------------------------------
|
|
|
|
@c Namespaces
|
|
|
|
@c ---------------------------------------------------------------------
|
|
|
|
|
|
|
|
@node Namespaces
|
2001-05-27 19:09:47 +02:00
|
|
|
@subsection Namespaces
|
1999-09-19 17:50:40 +02:00
|
|
|
@cindex namespace
|
|
|
|
@tindex NAMESPACE_DECL
|
|
|
|
|
|
|
|
A namespace is represented by a @code{NAMESPACE_DECL} node.
|
|
|
|
|
|
|
|
However, except for the fact that it is distinguished as the root of the
|
|
|
|
representation, the global namespace is no different from any other
|
|
|
|
namespace. Thus, in what follows, we describe namespaces generally,
|
|
|
|
rather than the global namespace in particular.
|
|
|
|
|
|
|
|
The following macros and functions can be used on a @code{NAMESPACE_DECL}:
|
|
|
|
|
|
|
|
@ftable @code
|
|
|
|
@item DECL_NAME
|
|
|
|
This macro is used to obtain the @code{IDENTIFIER_NODE} corresponding to
|
|
|
|
the unqualified name of the name of the namespace (@pxref{Identifiers}).
|
|
|
|
The name of the global namespace is @samp{::}, even though in C++ the
|
|
|
|
global namespace is unnamed. However, you should use comparison with
|
|
|
|
@code{global_namespace}, rather than @code{DECL_NAME} to determine
|
2003-02-07 15:44:19 +01:00
|
|
|
whether or not a namespace is the global one. An unnamed namespace
|
1999-09-19 17:50:40 +02:00
|
|
|
will have a @code{DECL_NAME} equal to @code{anonymous_namespace_name}.
|
|
|
|
Within a single translation unit, all unnamed namespaces will have the
|
|
|
|
same name.
|
|
|
|
|
|
|
|
@item DECL_CONTEXT
|
|
|
|
This macro returns the enclosing namespace. The @code{DECL_CONTEXT} for
|
|
|
|
the @code{global_namespace} is @code{NULL_TREE}.
|
|
|
|
|
1999-12-14 19:11:32 +01:00
|
|
|
@item DECL_NAMESPACE_ALIAS
|
|
|
|
If this declaration is for a namespace alias, then
|
|
|
|
@code{DECL_NAMESPACE_ALIAS} is the namespace for which this one is an
|
c-tree.texi, [...]: Remove trailing whitespace.
* c-tree.texi, contrib.texi, cpp.texi, extend.texi, gcc.texi,
gcov.texi, install.texi, md.texi, objc.texi, rtl.texi, tm.texi:
Remove trailing whitespace.
From-SVN: r42678
2001-05-28 22:57:50 +02:00
|
|
|
alias.
|
1999-12-14 19:11:32 +01:00
|
|
|
|
|
|
|
Do not attempt to use @code{cp_namespace_decls} for a namespace which is
|
|
|
|
an alias. Instead, follow @code{DECL_NAMESPACE_ALIAS} links until you
|
|
|
|
reach an ordinary, non-alias, namespace, and call
|
|
|
|
@code{cp_namespace_decls} there.
|
|
|
|
|
2000-09-12 10:54:21 +02:00
|
|
|
@item DECL_NAMESPACE_STD_P
|
|
|
|
This predicate holds if the namespace is the special @code{::std}
|
c-tree.texi, [...]: Remove trailing whitespace.
* c-tree.texi, contrib.texi, cpp.texi, extend.texi, gcc.texi,
gcov.texi, install.texi, md.texi, objc.texi, rtl.texi, tm.texi:
Remove trailing whitespace.
From-SVN: r42678
2001-05-28 22:57:50 +02:00
|
|
|
namespace.
|
2000-09-12 10:54:21 +02:00
|
|
|
|
1999-09-19 17:50:40 +02:00
|
|
|
@item cp_namespace_decls
|
|
|
|
This function will return the declarations contained in the namespace,
|
|
|
|
including types, overloaded functions, other namespaces, and so forth.
|
|
|
|
If there are no declarations, this function will return
|
|
|
|
@code{NULL_TREE}. The declarations are connected through their
|
c-tree.texi, [...]: Remove trailing whitespace.
* c-tree.texi, contrib.texi, cpp.texi, extend.texi, gcc.texi,
gcov.texi, install.texi, md.texi, objc.texi, rtl.texi, tm.texi:
Remove trailing whitespace.
From-SVN: r42678
2001-05-28 22:57:50 +02:00
|
|
|
@code{TREE_CHAIN} fields.
|
1999-09-19 17:50:40 +02:00
|
|
|
|
|
|
|
Although most entries on this list will be declarations,
|
|
|
|
@code{TREE_LIST} nodes may also appear. In this case, the
|
|
|
|
@code{TREE_VALUE} will be an @code{OVERLOAD}. The value of the
|
2001-06-21 02:03:48 +02:00
|
|
|
@code{TREE_PURPOSE} is unspecified; back ends should ignore this value.
|
1999-09-19 17:50:40 +02:00
|
|
|
As with the other kinds of declarations returned by
|
|
|
|
@code{cp_namespace_decls}, the @code{TREE_CHAIN} will point to the next
|
|
|
|
declaration in this list.
|
|
|
|
|
|
|
|
For more information on the kinds of declarations that can occur on this
|
|
|
|
list, @xref{Declarations}. Some declarations will not appear on this
|
|
|
|
list. In particular, no @code{FIELD_DECL}, @code{LABEL_DECL}, or
|
|
|
|
@code{PARM_DECL} nodes will appear here.
|
|
|
|
|
1999-12-14 19:11:32 +01:00
|
|
|
This function cannot be used with namespaces that have
|
|
|
|
@code{DECL_NAMESPACE_ALIAS} set.
|
|
|
|
|
1999-09-19 17:50:40 +02:00
|
|
|
@end ftable
|
|
|
|
|
|
|
|
@c ---------------------------------------------------------------------
|
|
|
|
@c Classes
|
|
|
|
@c ---------------------------------------------------------------------
|
|
|
|
|
|
|
|
@node Classes
|
2001-05-27 19:09:47 +02:00
|
|
|
@subsection Classes
|
1999-09-19 17:50:40 +02:00
|
|
|
@cindex class
|
|
|
|
@tindex RECORD_TYPE
|
|
|
|
@tindex UNION_TYPE
|
|
|
|
@findex CLASSTYPE_DECLARED_CLASS
|
|
|
|
@findex TYPE_BINFO
|
|
|
|
@findex BINFO_TYPE
|
|
|
|
@findex TYPE_FIELDS
|
1999-10-06 21:01:44 +02:00
|
|
|
@findex TYPE_VFIELD
|
1999-09-19 17:50:40 +02:00
|
|
|
@findex TYPE_METHODS
|
|
|
|
|
|
|
|
A class type is represented by either a @code{RECORD_TYPE} or a
|
|
|
|
@code{UNION_TYPE}. A class declared with the @code{union} tag is
|
|
|
|
represented by a @code{UNION_TYPE}, while classes declared with either
|
1999-09-20 22:19:04 +02:00
|
|
|
the @code{struct} or the @code{class} tag are represented by
|
1999-09-19 17:50:40 +02:00
|
|
|
@code{RECORD_TYPE}s. You can use the @code{CLASSTYPE_DECLARED_CLASS}
|
|
|
|
macro to discern whether or not a particular type is a @code{class} as
|
|
|
|
opposed to a @code{struct}. This macro will be true only for classes
|
|
|
|
declared with the @code{class} tag.
|
|
|
|
|
1999-10-06 21:01:44 +02:00
|
|
|
Almost all non-function members are available on the @code{TYPE_FIELDS}
|
|
|
|
list. Given one member, the next can be found by following the
|
1999-09-19 17:50:40 +02:00
|
|
|
@code{TREE_CHAIN}. You should not depend in any way on the order in
|
|
|
|
which fields appear on this list. All nodes on this list will be
|
2001-06-27 00:47:11 +02:00
|
|
|
@samp{DECL} nodes. A @code{FIELD_DECL} is used to represent a non-static
|
1999-09-19 17:50:40 +02:00
|
|
|
data member, a @code{VAR_DECL} is used to represent a static data
|
|
|
|
member, and a @code{TYPE_DECL} is used to represent a type. Note that
|
|
|
|
the @code{CONST_DECL} for an enumeration constant will appear on this
|
|
|
|
list, if the enumeration type was declared in the class. (Of course,
|
|
|
|
the @code{TYPE_DECL} for the enumeration type will appear here as well.)
|
|
|
|
There are no entries for base classes on this list. In particular,
|
|
|
|
there is no @code{FIELD_DECL} for the ``base-class portion'' of an
|
|
|
|
object.
|
|
|
|
|
1999-10-06 21:01:44 +02:00
|
|
|
The @code{TYPE_VFIELD} is a compiler-generated field used to point to
|
1999-10-21 09:10:36 +02:00
|
|
|
virtual function tables. It may or may not appear on the
|
2001-06-21 02:03:48 +02:00
|
|
|
@code{TYPE_FIELDS} list. However, back ends should handle the
|
1999-10-21 09:10:36 +02:00
|
|
|
@code{TYPE_VFIELD} just like all the entries on the @code{TYPE_FIELDS}
|
|
|
|
list.
|
1999-10-06 21:01:44 +02:00
|
|
|
|
1999-09-19 17:50:40 +02:00
|
|
|
The function members are available on the @code{TYPE_METHODS} list.
|
|
|
|
Again, subsequent members are found by following the @code{TREE_CHAIN}
|
|
|
|
field. If a function is overloaded, each of the overloaded functions
|
|
|
|
appears; no @code{OVERLOAD} nodes appear on the @code{TYPE_METHODS}
|
|
|
|
list. Implicitly declared functions (including default constructors,
|
|
|
|
copy constructors, assignment operators, and destructors) will appear on
|
|
|
|
this list as well.
|
|
|
|
|
|
|
|
Every class has an associated @dfn{binfo}, which can be obtained with
|
|
|
|
@code{TYPE_BINFO}. Binfos are used to represent base-classes. The
|
|
|
|
binfo given by @code{TYPE_BINFO} is the degenerate case, whereby every
|
tree.h: Include vec.h
.: * tree.h: Include vec.h
(DEF_VEC_P(tree)): New type.
(BINFO_BASE_BINFOS, BINFO_N_BASE_BINFOS, BINFO_BASE_BINFO): Adjust.
(BINFO_BASE_APPEND, BINFO_BASE_ITERATE): New.
(BINFO_LANG_SLOT): Remove.
(BINFO_SUBVTT_INDEX, BINFO_VPTR_INDEX, BINFO_PRIMARY_BASE_OF): New.
(struct tree_binfo): Turn base_binfos into a trailing
VEC(tree). Add vtt_subvtt, vtt_vptr, primary fields.
(binfo_lang_slots): Remove.
* tree.c (binfo_lang_slots): Remove.
(make_tree_binfo_stat): Take a base binfo count, not a
lang slot count. Adjust.
* Makefile.in (TREE_H): Add vec.h
* alias.c (record_component_aliases): Adjust BINFO access.
* dbxout.c (dbxout_type): Likewise.
* dwarf2out.c (gen_member_die): Likewise.
* sdbout.c (sdbout_one_type): Likewise.
* tree-dump.c (deque_and_dump): Likewise.
* config/i386/i386.c (classify_argument,
contains_128bit_aligned_vector_p): Likewise.
* config/sh/symbian.c (symbian_export_vtable_and_rtti_p): Likewise.
* doc/c-tree.texi (Classes): Update BINFO documentation.
cp:
* cp-tree.h (DEF_VEC_P(tree)): Remove here.
(BINFO_SUBVTT_INDEX, BINFO_VPTR_INDEX, BINFO_PRIMARY_BASE_OF):
Moved to common.
(BINFO_LANG_SLOTS): Remove.
* tree.c (copy_binfo): Adjust BINFO creation and accessors.
* decl.c (xref_basetypes): Adjust BINFO creation and accessors.
* class.c (check_bases): Adjust BINFO accessors.
(determine_primary_base, finish_struct_bits,
maybe_warn_about_overly_private_class, warn_hidden,
walk_subobject_offsets, propagate_binfo_offsets, end_of_class,
warn_about_ambiguous_bases, get_vfield_name,
dump_class_hierarchy_r, build_vtt_inits, accumulate_vtbl_inits,
add_vcall_offset_vtbl_entries_r): Likewise.
* dump.c (cp_dump_tree): Likewise.
* init.c (sort_mem_initializers, expand_member_init, build_delete,
push_base_cleanups): Likewise.
* method.c (do_build_copy_constructor, do_build_assign_ref,
synthesize_exception_spec): Likewise.
name-lookup.c (arg_assoc_class): Likewise.
* pt.c (instantiate_class_template,
get_template_base_recursive): Likewise.
* rtti.c (get_pseudo_ti_init, get_pseudo_ti_desc): Likewise.
* typeck2.c (process_init_constructor): Likewise.
* search.c (lookup_base_r, dynamic_cast_base_recurse,
dfs_access_in_type, dfs_walk_real, look_for_overrides,
types_overlap_p, copied_binfo, original_binfo): Likewise.
(binfo_for_vtable): Remove
java:
* class.c (add_interface_do): Remove.
(set_super_info, interface_of_p, maybe_add_interface,
add_interface, make_class_data, layout_class,
add_miranda_methods): Adjust BINFO accessors and addition.
* expr.c (can_widen_reference_to, lookup_field): Adjust BINFO
accessors.
* jcf-write.c (generate_classfile): Likewise.
* parse.y (patch_anonymous_class, check_inner_circular_reference,
check_circular_reference, java_complete_class,
check_abstract_method_definitions,
java_check_abstract_method_definitions,
check_interface_throws_clauses, java_check_abstract_methods,
lookup_java_interface_method2,
find_applicable_accessible_methods_list): Adjust BINFO accessors
and addition.
* typeck.c (find_method_in_interfaces): Adjust BINFO accessors.
From-SVN: r84949
2004-07-20 14:26:02 +02:00
|
|
|
class is considered to be its own base-class. The base binfos for a
|
|
|
|
particular binfo are held in a vector, whose length is obtained with
|
|
|
|
@code{BINFO_N_BASE_BINFOS}. The base binfos themselves are obtained
|
|
|
|
with @code{BINFO_BASE_BINFO} and @code{BINFO_BASE_ITERATE}. To add a
|
|
|
|
new binfo, use @code{BINFO_BASE_APPEND}. The vector of base binfos can
|
|
|
|
be obtained with @code{BINFO_BASE_BINFOS}, but normally you do not need
|
|
|
|
to use that. The class type associated with a binfo is given by
|
|
|
|
@code{BINFO_TYPE}. It is not always the case that @code{BINFO_TYPE
|
|
|
|
(TYPE_BINFO (x))}, because of typedefs and qualified types. Neither is
|
|
|
|
it the case that @code{TYPE_BINFO (BINFO_TYPE (y))} is the same binfo as
|
|
|
|
@code{y}. The reason is that if @code{y} is a binfo representing a
|
|
|
|
base-class @code{B} of a derived class @code{D}, then @code{BINFO_TYPE
|
|
|
|
(y)} will be @code{B}, and @code{TYPE_BINFO (BINFO_TYPE (y))} will be
|
|
|
|
@code{B} as its own base-class, rather than as a base-class of @code{D}.
|
|
|
|
|
|
|
|
The access to a base type can be found with @code{BINFO_BASE_ACCESS}.
|
|
|
|
This will produce @code{access_public_node}, @code{access_private_node}
|
|
|
|
or @code{access_protected_node}. If bases are always public,
|
|
|
|
@code{BINFO_BASE_ACCESSES} may be @code{NULL}.
|
|
|
|
|
|
|
|
@code{BINFO_VIRTUAL_P} is used to specify whether the binfo is inherited
|
|
|
|
virtually or not. The other flags, @code{BINFO_MARKED_P} and
|
|
|
|
@code{BINFO_FLAG_1} to @code{BINFO_FLAG_6} can be used for language
|
|
|
|
specific use.
|
1999-09-19 17:50:40 +02:00
|
|
|
|
c-tree.texi, [...]: Remove trailing whitespace.
* c-tree.texi, contrib.texi, cpp.texi, extend.texi, gcc.texi,
gcov.texi, install.texi, md.texi, objc.texi, rtl.texi, tm.texi:
Remove trailing whitespace.
From-SVN: r42678
2001-05-28 22:57:50 +02:00
|
|
|
The following macros can be used on a tree node representing a class-type.
|
2000-09-12 10:54:21 +02:00
|
|
|
|
|
|
|
@ftable @code
|
|
|
|
@item LOCAL_CLASS_P
|
c-tree.texi, [...]: Correct end-of-sentence markup and markup of "etc.", "e.g." and "i.e.".
* doc/c-tree.texi, doc/cfg.texi, doc/contrib.texi, doc/cpp.texi,
doc/cppopts.texi, doc/extend.texi, doc/fragments.texi,
doc/frontends.texi, doc/gcov.texi, doc/hostconfig.texi,
doc/implement-c.texi, doc/install.texi, doc/invoke.texi,
doc/libgcc.texi, doc/md.texi, doc/passes.texi,
doc/portability.texi, doc/rtl.texi, doc/sourcebuild.texi,
doc/standards.texi, doc/tm.texi, doc/tree-ssa.texi,
doc/trouble.texi: Correct end-of-sentence markup and markup of
"etc.", "e.g." and "i.e.". Use @code in various places where
appropriate.
From-SVN: r90101
2004-11-05 02:36:57 +01:00
|
|
|
This predicate holds if the class is local class @emph{i.e.}@: declared
|
2000-09-12 10:54:21 +02:00
|
|
|
inside a function body.
|
|
|
|
|
|
|
|
@item TYPE_POLYMORPHIC_P
|
|
|
|
This predicate holds if the class has at least one virtual function
|
|
|
|
(declared or inherited).
|
|
|
|
|
|
|
|
@item TYPE_HAS_DEFAULT_CONSTRUCTOR
|
|
|
|
This predicate holds whenever its argument represents a class-type with
|
|
|
|
default constructor.
|
|
|
|
|
|
|
|
@item CLASSTYPE_HAS_MUTABLE
|
2003-12-30 16:00:43 +01:00
|
|
|
@itemx TYPE_HAS_MUTABLE_P
|
c-tree.texi, [...]: Remove trailing whitespace.
* c-tree.texi, contrib.texi, cpp.texi, extend.texi, gcc.texi,
gcov.texi, install.texi, md.texi, objc.texi, rtl.texi, tm.texi:
Remove trailing whitespace.
From-SVN: r42678
2001-05-28 22:57:50 +02:00
|
|
|
These predicates hold for a class-type having a mutable data member.
|
2000-09-12 10:54:21 +02:00
|
|
|
|
|
|
|
@item CLASSTYPE_NON_POD_P
|
|
|
|
This predicate holds only for class-types that are not PODs.
|
|
|
|
|
|
|
|
@item TYPE_HAS_NEW_OPERATOR
|
c-tree.texi, [...]: Remove trailing whitespace.
* c-tree.texi, contrib.texi, cpp.texi, extend.texi, gcc.texi,
gcov.texi, install.texi, md.texi, objc.texi, rtl.texi, tm.texi:
Remove trailing whitespace.
From-SVN: r42678
2001-05-28 22:57:50 +02:00
|
|
|
This predicate holds for a class-type that defines
|
2000-09-12 10:54:21 +02:00
|
|
|
@code{operator new}.
|
|
|
|
|
|
|
|
@item TYPE_HAS_ARRAY_NEW_OPERATOR
|
c-tree.texi, [...]: Remove trailing whitespace.
* c-tree.texi, contrib.texi, cpp.texi, extend.texi, gcc.texi,
gcov.texi, install.texi, md.texi, objc.texi, rtl.texi, tm.texi:
Remove trailing whitespace.
From-SVN: r42678
2001-05-28 22:57:50 +02:00
|
|
|
This predicate holds for a class-type for which
|
2000-09-12 10:54:21 +02:00
|
|
|
@code{operator new[]} is defined.
|
|
|
|
|
|
|
|
@item TYPE_OVERLOADS_CALL_EXPR
|
c-tree.texi, [...]: Remove trailing whitespace.
* c-tree.texi, contrib.texi, cpp.texi, extend.texi, gcc.texi,
gcov.texi, install.texi, md.texi, objc.texi, rtl.texi, tm.texi:
Remove trailing whitespace.
From-SVN: r42678
2001-05-28 22:57:50 +02:00
|
|
|
This predicate holds for class-type for which the function call
|
2000-09-12 10:54:21 +02:00
|
|
|
@code{operator()} is overloaded.
|
|
|
|
|
|
|
|
@item TYPE_OVERLOADS_ARRAY_REF
|
c-tree.texi, [...]: Remove trailing whitespace.
* c-tree.texi, contrib.texi, cpp.texi, extend.texi, gcc.texi,
gcov.texi, install.texi, md.texi, objc.texi, rtl.texi, tm.texi:
Remove trailing whitespace.
From-SVN: r42678
2001-05-28 22:57:50 +02:00
|
|
|
This predicate holds for a class-type that overloads
|
2000-09-12 10:54:21 +02:00
|
|
|
@code{operator[]}
|
|
|
|
|
|
|
|
@item TYPE_OVERLOADS_ARROW
|
|
|
|
This predicate holds for a class-type for which @code{operator->} is
|
c-tree.texi, [...]: Remove trailing whitespace.
* c-tree.texi, contrib.texi, cpp.texi, extend.texi, gcc.texi,
gcov.texi, install.texi, md.texi, objc.texi, rtl.texi, tm.texi:
Remove trailing whitespace.
From-SVN: r42678
2001-05-28 22:57:50 +02:00
|
|
|
overloaded.
|
2000-09-12 10:54:21 +02:00
|
|
|
|
|
|
|
@end ftable
|
|
|
|
|
1999-09-19 17:50:40 +02:00
|
|
|
@c ---------------------------------------------------------------------
|
|
|
|
@c Declarations
|
|
|
|
@c ---------------------------------------------------------------------
|
|
|
|
|
|
|
|
@node Declarations
|
2001-05-27 19:09:47 +02:00
|
|
|
@section Declarations
|
1999-09-19 17:50:40 +02:00
|
|
|
@cindex declaration
|
|
|
|
@cindex variable
|
|
|
|
@cindex type declaration
|
|
|
|
@tindex LABEL_DECL
|
|
|
|
@tindex CONST_DECL
|
|
|
|
@tindex TYPE_DECL
|
|
|
|
@tindex VAR_DECL
|
|
|
|
@tindex PARM_DECL
|
|
|
|
@tindex FIELD_DECL
|
|
|
|
@tindex NAMESPACE_DECL
|
1999-09-25 20:16:08 +02:00
|
|
|
@tindex RESULT_DECL
|
1999-09-19 17:50:40 +02:00
|
|
|
@tindex TEMPLATE_DECL
|
1999-09-29 21:00:46 +02:00
|
|
|
@tindex THUNK_DECL
|
1999-09-19 17:50:40 +02:00
|
|
|
@tindex USING_DECL
|
2000-09-12 10:54:21 +02:00
|
|
|
@findex THUNK_DELTA
|
1999-09-19 17:50:40 +02:00
|
|
|
@findex DECL_INITIAL
|
|
|
|
@findex DECL_SIZE
|
|
|
|
@findex DECL_ALIGN
|
1999-09-29 22:07:56 +02:00
|
|
|
@findex DECL_EXTERNAL
|
1999-09-19 17:50:40 +02:00
|
|
|
|
2001-05-27 19:09:47 +02:00
|
|
|
This section covers the various kinds of declarations that appear in the
|
1999-09-19 17:50:40 +02:00
|
|
|
internal representation, except for declarations of functions
|
|
|
|
(represented by @code{FUNCTION_DECL} nodes), which are described in
|
|
|
|
@ref{Functions}.
|
|
|
|
|
2005-07-09 01:37:11 +02:00
|
|
|
@menu
|
|
|
|
* Working with declarations:: Macros and functions that work on
|
|
|
|
declarations.
|
|
|
|
* Internal structure:: How declaration nodes are represented.
|
|
|
|
@end menu
|
|
|
|
|
|
|
|
@node Working with declarations
|
|
|
|
@subsection Working with declarations
|
|
|
|
|
1999-09-19 17:50:40 +02:00
|
|
|
Some macros can be used with any kind of declaration. These include:
|
|
|
|
@ftable @code
|
|
|
|
@item DECL_NAME
|
|
|
|
This macro returns an @code{IDENTIFIER_NODE} giving the name of the
|
|
|
|
entity.
|
|
|
|
|
|
|
|
@item TREE_TYPE
|
|
|
|
This macro returns the type of the entity declared.
|
|
|
|
|
2004-05-13 08:41:07 +02:00
|
|
|
@item TREE_FILENAME
|
1999-09-19 17:50:40 +02:00
|
|
|
This macro returns the name of the file in which the entity was
|
|
|
|
declared, as a @code{char*}. For an entity declared implicitly by the
|
|
|
|
compiler (like @code{__builtin_memcpy}), this will be the string
|
|
|
|
@code{"<internal>"}.
|
|
|
|
|
2004-05-13 08:41:07 +02:00
|
|
|
@item TREE_LINENO
|
1999-09-19 17:50:40 +02:00
|
|
|
This macro returns the line number at which the entity was declared, as
|
|
|
|
an @code{int}.
|
|
|
|
|
c-tree.texi, [...]: Remove trailing whitespace.
* c-tree.texi, contrib.texi, cpp.texi, extend.texi, gcc.texi,
gcov.texi, install.texi, md.texi, objc.texi, rtl.texi, tm.texi:
Remove trailing whitespace.
From-SVN: r42678
2001-05-28 22:57:50 +02:00
|
|
|
@item DECL_ARTIFICIAL
|
1999-09-19 17:50:40 +02:00
|
|
|
This predicate holds if the declaration was implicitly generated by the
|
|
|
|
compiler. For example, this predicate will hold of an implicitly
|
|
|
|
declared member function, or of the @code{TYPE_DECL} implicitly
|
|
|
|
generated for a class type. Recall that in C++ code like:
|
c-tree.texi, [...]: Use @smallexample instead of @example.
* doc/c-tree.texi, doc/compat.texi, doc/cpp.texi,
doc/cppopts.texi, doc/extend.texi, doc/install.texi,
doc/interface.texi, doc/invoke.texi, doc/libgcc.texi, doc/md.texi,
doc/objc.texi, doc/rtl.texi, doc/tm.texi, doc/trouble.texi: Use
@smallexample instead of @example.
From-SVN: r76075
2004-01-18 02:20:48 +01:00
|
|
|
@smallexample
|
1999-09-19 17:50:40 +02:00
|
|
|
struct S @{@};
|
c-tree.texi, [...]: Use @smallexample instead of @example.
* doc/c-tree.texi, doc/compat.texi, doc/cpp.texi,
doc/cppopts.texi, doc/extend.texi, doc/install.texi,
doc/interface.texi, doc/invoke.texi, doc/libgcc.texi, doc/md.texi,
doc/objc.texi, doc/rtl.texi, doc/tm.texi, doc/trouble.texi: Use
@smallexample instead of @example.
From-SVN: r76075
2004-01-18 02:20:48 +01:00
|
|
|
@end smallexample
|
1999-09-19 17:50:40 +02:00
|
|
|
@noindent
|
|
|
|
is roughly equivalent to C code like:
|
c-tree.texi, [...]: Use @smallexample instead of @example.
* doc/c-tree.texi, doc/compat.texi, doc/cpp.texi,
doc/cppopts.texi, doc/extend.texi, doc/install.texi,
doc/interface.texi, doc/invoke.texi, doc/libgcc.texi, doc/md.texi,
doc/objc.texi, doc/rtl.texi, doc/tm.texi, doc/trouble.texi: Use
@smallexample instead of @example.
From-SVN: r76075
2004-01-18 02:20:48 +01:00
|
|
|
@smallexample
|
1999-09-19 17:50:40 +02:00
|
|
|
struct S @{@};
|
|
|
|
typedef struct S S;
|
c-tree.texi, [...]: Use @smallexample instead of @example.
* doc/c-tree.texi, doc/compat.texi, doc/cpp.texi,
doc/cppopts.texi, doc/extend.texi, doc/install.texi,
doc/interface.texi, doc/invoke.texi, doc/libgcc.texi, doc/md.texi,
doc/objc.texi, doc/rtl.texi, doc/tm.texi, doc/trouble.texi: Use
@smallexample instead of @example.
From-SVN: r76075
2004-01-18 02:20:48 +01:00
|
|
|
@end smallexample
|
1999-09-19 17:50:40 +02:00
|
|
|
The implicitly generated @code{typedef} declaration is represented by a
|
|
|
|
@code{TYPE_DECL} for which @code{DECL_ARTIFICIAL} holds.
|
2000-09-12 10:54:21 +02:00
|
|
|
|
|
|
|
@item DECL_NAMESPACE_SCOPE_P
|
|
|
|
This predicate holds if the entity was declared at a namespace scope.
|
|
|
|
|
|
|
|
@item DECL_CLASS_SCOPE_P
|
|
|
|
This predicate holds if the entity was declared at a class scope.
|
|
|
|
|
|
|
|
@item DECL_FUNCTION_SCOPE_P
|
|
|
|
This predicate holds if the entity was declared inside a function
|
c-tree.texi, [...]: Remove trailing whitespace.
* c-tree.texi, contrib.texi, cpp.texi, extend.texi, gcc.texi,
gcov.texi, install.texi, md.texi, objc.texi, rtl.texi, tm.texi:
Remove trailing whitespace.
From-SVN: r42678
2001-05-28 22:57:50 +02:00
|
|
|
body.
|
2000-09-12 10:54:21 +02:00
|
|
|
|
1999-09-19 17:50:40 +02:00
|
|
|
@end ftable
|
|
|
|
|
|
|
|
The various kinds of declarations include:
|
|
|
|
@table @code
|
|
|
|
@item LABEL_DECL
|
|
|
|
These nodes are used to represent labels in function bodies. For more
|
|
|
|
information, see @ref{Functions}. These nodes only appear in block
|
|
|
|
scopes.
|
|
|
|
|
|
|
|
@item CONST_DECL
|
|
|
|
These nodes are used to represent enumeration constants. The value of
|
|
|
|
the constant is given by @code{DECL_INITIAL} which will be an
|
|
|
|
@code{INTEGER_CST} with the same type as the @code{TREE_TYPE} of the
|
|
|
|
@code{CONST_DECL}, i.e., an @code{ENUMERAL_TYPE}.
|
|
|
|
|
1999-09-25 20:16:08 +02:00
|
|
|
@item RESULT_DECL
|
|
|
|
These nodes represent the value returned by a function. When a value is
|
|
|
|
assigned to a @code{RESULT_DECL}, that indicates that the value should
|
|
|
|
be returned, via bitwise copy, by the function. You can use
|
|
|
|
@code{DECL_SIZE} and @code{DECL_ALIGN} on a @code{RESULT_DECL}, just as
|
|
|
|
with a @code{VAR_DECL}.
|
|
|
|
|
1999-09-19 17:50:40 +02:00
|
|
|
@item TYPE_DECL
|
|
|
|
These nodes represent @code{typedef} declarations. The @code{TREE_TYPE}
|
|
|
|
is the type declared to have the name given by @code{DECL_NAME}. In
|
|
|
|
some cases, there is no associated name.
|
|
|
|
|
|
|
|
@item VAR_DECL
|
|
|
|
These nodes represent variables with namespace or block scope, as well
|
|
|
|
as static data members. The @code{DECL_SIZE} and @code{DECL_ALIGN} are
|
|
|
|
analogous to @code{TYPE_SIZE} and @code{TYPE_ALIGN}. For a declaration,
|
|
|
|
you should always use the @code{DECL_SIZE} and @code{DECL_ALIGN} rather
|
|
|
|
than the @code{TYPE_SIZE} and @code{TYPE_ALIGN} given by the
|
|
|
|
@code{TREE_TYPE}, since special attributes may have been applied to the
|
2001-06-27 00:47:11 +02:00
|
|
|
variable to give it a particular size and alignment. You may use the
|
2000-09-12 10:54:21 +02:00
|
|
|
predicates @code{DECL_THIS_STATIC} or @code{DECL_THIS_EXTERN} to test
|
|
|
|
whether the storage class specifiers @code{static} or @code{extern} were
|
c-tree.texi, [...]: Remove trailing whitespace.
* c-tree.texi, contrib.texi, cpp.texi, extend.texi, gcc.texi,
gcov.texi, install.texi, md.texi, objc.texi, rtl.texi, tm.texi:
Remove trailing whitespace.
From-SVN: r42678
2001-05-28 22:57:50 +02:00
|
|
|
used to declare a variable.
|
1999-09-19 17:50:40 +02:00
|
|
|
|
|
|
|
If this variable is initialized (but does not require a constructor),
|
1999-09-21 09:41:01 +02:00
|
|
|
the @code{DECL_INITIAL} will be an expression for the initializer. The
|
|
|
|
initializer should be evaluated, and a bitwise copy into the variable
|
|
|
|
performed. If the @code{DECL_INITIAL} is the @code{error_mark_node},
|
|
|
|
there is an initializer, but it is given by an explicit statement later
|
|
|
|
in the code; no bitwise copy is required.
|
1999-09-19 17:50:40 +02:00
|
|
|
|
2000-11-08 20:25:36 +01:00
|
|
|
GCC provides an extension that allows either automatic variables, or
|
|
|
|
global variables, to be placed in particular registers. This extension
|
|
|
|
is being used for a particular @code{VAR_DECL} if @code{DECL_REGISTER}
|
|
|
|
holds for the @code{VAR_DECL}, and if @code{DECL_ASSEMBLER_NAME} is not
|
|
|
|
equal to @code{DECL_NAME}. In that case, @code{DECL_ASSEMBLER_NAME} is
|
|
|
|
the name of the register into which the variable will be placed.
|
|
|
|
|
1999-09-19 17:50:40 +02:00
|
|
|
@item PARM_DECL
|
|
|
|
Used to represent a parameter to a function. Treat these nodes
|
|
|
|
similarly to @code{VAR_DECL} nodes. These nodes only appear in the
|
|
|
|
@code{DECL_ARGUMENTS} for a @code{FUNCTION_DECL}.
|
|
|
|
|
|
|
|
The @code{DECL_ARG_TYPE} for a @code{PARM_DECL} is the type that will
|
|
|
|
actually be used when a value is passed to this function. It may be a
|
|
|
|
wider type than the @code{TREE_TYPE} of the parameter; for example, the
|
|
|
|
ordinary type might be @code{short} while the @code{DECL_ARG_TYPE} is
|
|
|
|
@code{int}.
|
|
|
|
|
|
|
|
@item FIELD_DECL
|
|
|
|
These nodes represent non-static data members. The @code{DECL_SIZE} and
|
2006-10-02 01:38:08 +02:00
|
|
|
@code{DECL_ALIGN} behave as for @code{VAR_DECL} nodes.
|
|
|
|
The position of the field within the parent record is specified by a
|
|
|
|
combination of three attributes. @code{DECL_FIELD_OFFSET} is the position,
|
|
|
|
counting in bytes, of the @code{DECL_OFFSET_ALIGN}-bit sized word containing
|
|
|
|
the bit of the field closest to the beginning of the structure.
|
|
|
|
@code{DECL_FIELD_BIT_OFFSET} is the bit offset of the first bit of the field
|
|
|
|
within this word; this may be nonzero even for fields that are not bit-fields,
|
|
|
|
since @code{DECL_OFFSET_ALIGN} may be greater than the natural alignment
|
|
|
|
of the field's type.
|
|
|
|
|
|
|
|
If @code{DECL_C_BIT_FIELD} holds, this field is a bit-field. In a bit-field,
|
|
|
|
@code{DECL_BIT_FIELD_TYPE} also contains the type that was originally
|
|
|
|
specified for it, while DECL_TYPE may be a modified type with lesser precision,
|
|
|
|
according to the size of the bit field.
|
1999-09-19 17:50:40 +02:00
|
|
|
|
|
|
|
@item NAMESPACE_DECL
|
1999-09-23 15:55:27 +02:00
|
|
|
@xref{Namespaces}.
|
1999-09-19 17:50:40 +02:00
|
|
|
|
|
|
|
@item TEMPLATE_DECL
|
|
|
|
|
|
|
|
These nodes are used to represent class, function, and variable (static
|
|
|
|
data member) templates. The @code{DECL_TEMPLATE_SPECIALIZATIONS} are a
|
c-tree.texi, [...]: Fix spelling and typos.
* doc/c-tree.texi, doc/contrib.texi, doc/extend.texi,
doc/gcc.texi, doc/install.texi, doc/invoke.texi, doc/md.texi,
doc/objc.texi, doc/rtl.texi, doc/tm.texi: Fix spelling and typos.
Consistently use "built-in" and "bit-field". Minor logical markup
improvements.
* doc/gcc.1: Regenerate.
From-SVN: r43383
2001-06-15 00:51:18 +02:00
|
|
|
@code{TREE_LIST}. The @code{TREE_VALUE} of each node in the list is a
|
1999-09-19 17:50:40 +02:00
|
|
|
@code{TEMPLATE_DECL}s or @code{FUNCTION_DECL}s representing
|
2001-06-21 02:03:48 +02:00
|
|
|
specializations (including instantiations) of this template. Back ends
|
1999-09-19 17:50:40 +02:00
|
|
|
can safely ignore @code{TEMPLATE_DECL}s, but should examine
|
|
|
|
@code{FUNCTION_DECL} nodes on the specializations list just as they
|
|
|
|
would ordinary @code{FUNCTION_DECL} nodes.
|
|
|
|
|
2000-02-17 21:45:49 +01:00
|
|
|
For a class template, the @code{DECL_TEMPLATE_INSTANTIATIONS} list
|
|
|
|
contains the instantiations. The @code{TREE_VALUE} of each node is an
|
|
|
|
instantiation of the class. The @code{DECL_TEMPLATE_SPECIALIZATIONS}
|
|
|
|
contains partial specializations of the class.
|
|
|
|
|
1999-09-19 17:50:40 +02:00
|
|
|
@item USING_DECL
|
|
|
|
|
2001-06-21 02:03:48 +02:00
|
|
|
Back ends can safely ignore these nodes.
|
1999-09-19 17:50:40 +02:00
|
|
|
|
|
|
|
@end table
|
|
|
|
|
2005-07-09 01:37:11 +02:00
|
|
|
@node Internal structure
|
|
|
|
@subsection Internal structure
|
|
|
|
|
|
|
|
@code{DECL} nodes are represented internally as a hierarchy of
|
|
|
|
structures.
|
|
|
|
|
|
|
|
@menu
|
|
|
|
* Current structure hierarchy:: The current DECL node structure
|
|
|
|
hierarchy.
|
|
|
|
* Adding new DECL node types:: How to add a new DECL node to a
|
|
|
|
frontend.
|
|
|
|
@end menu
|
|
|
|
|
|
|
|
@node Current structure hierarchy
|
|
|
|
@subsubsection Current structure hierarchy
|
|
|
|
|
|
|
|
@table @code
|
|
|
|
|
|
|
|
@item struct tree_decl_minimal
|
|
|
|
This is the minimal structure to inherit from in order for common
|
|
|
|
@code{DECL} macros to work. The fields it contains are a unique ID,
|
|
|
|
source location, context, and name.
|
|
|
|
|
|
|
|
@item struct tree_decl_common
|
|
|
|
This structure inherits from @code{struct tree_decl_minimal}. It
|
|
|
|
contains fields that most @code{DECL} nodes need, such as a field to
|
|
|
|
store alignment, machine mode, size, and attributes.
|
|
|
|
|
|
|
|
@item struct tree_field_decl
|
|
|
|
This structure inherits from @code{struct tree_decl_common}. It is
|
|
|
|
used to represent @code{FIELD_DECL}.
|
|
|
|
|
|
|
|
@item struct tree_label_decl
|
|
|
|
This structure inherits from @code{struct tree_decl_common}. It is
|
|
|
|
used to represent @code{LABEL_DECL}.
|
|
|
|
|
|
|
|
@item struct tree_translation_unit_decl
|
|
|
|
This structure inherits from @code{struct tree_decl_common}. It is
|
|
|
|
used to represent @code{TRANSLATION_UNIT_DECL}.
|
|
|
|
|
|
|
|
@item struct tree_decl_with_rtl
|
|
|
|
This structure inherits from @code{struct tree_decl_common}. It
|
|
|
|
contains a field to store the low-level RTL associated with a
|
|
|
|
@code{DECL} node.
|
|
|
|
|
|
|
|
@item struct tree_result_decl
|
|
|
|
This structure inherits from @code{struct tree_decl_with_rtl}. It is
|
|
|
|
used to represent @code{RESULT_DECL}.
|
|
|
|
|
|
|
|
@item struct tree_const_decl
|
|
|
|
This structure inherits from @code{struct tree_decl_with_rtl}. It is
|
|
|
|
used to represent @code{CONST_DECL}.
|
|
|
|
|
|
|
|
@item struct tree_parm_decl
|
|
|
|
This structure inherits from @code{struct tree_decl_with_rtl}. It is
|
|
|
|
used to represent @code{PARM_DECL}.
|
|
|
|
|
|
|
|
@item struct tree_decl_with_vis
|
|
|
|
This structure inherits from @code{struct tree_decl_with_rtl}. It
|
|
|
|
contains fields necessary to store visibility information, as well as
|
|
|
|
a section name and assembler name.
|
|
|
|
|
|
|
|
@item struct tree_var_decl
|
|
|
|
This structure inherits from @code{struct tree_decl_with_vis}. It is
|
|
|
|
used to represent @code{VAR_DECL}.
|
|
|
|
|
|
|
|
@item struct tree_function_decl
|
|
|
|
This structure inherits from @code{struct tree_decl_with_vis}. It is
|
|
|
|
used to represent @code{FUNCTION_DECL}.
|
|
|
|
|
|
|
|
@end table
|
|
|
|
@node Adding new DECL node types
|
|
|
|
@subsubsection Adding new DECL node types
|
|
|
|
|
|
|
|
Adding a new @code{DECL} tree consists of the following steps
|
|
|
|
|
|
|
|
@table @asis
|
|
|
|
|
|
|
|
@item Add a new tree code for the @code{DECL} node
|
|
|
|
For language specific @code{DECL} nodes, there is a @file{.def} file
|
|
|
|
in each frontend directory where the tree code should be added.
|
|
|
|
For @code{DECL} nodes that are part of the middle-end, the code should
|
|
|
|
be added to @file{tree.def}.
|
|
|
|
|
|
|
|
@item Create a new structure type for the @code{DECL} node
|
|
|
|
These structures should inherit from one of the existing structures in
|
|
|
|
the language hierarchy by using that structure as the first member.
|
|
|
|
|
|
|
|
@smallexample
|
|
|
|
struct tree_foo_decl
|
|
|
|
@{
|
|
|
|
struct tree_decl_with_vis common;
|
|
|
|
@}
|
|
|
|
@end smallexample
|
|
|
|
|
|
|
|
Would create a structure name @code{tree_foo_decl} that inherits from
|
|
|
|
@code{struct tree_decl_with_vis}.
|
|
|
|
|
|
|
|
For language specific @code{DECL} nodes, this new structure type
|
|
|
|
should go in the appropriate @file{.h} file.
|
|
|
|
For @code{DECL} nodes that are part of the middle-end, the structure
|
|
|
|
type should go in @file{tree.h}.
|
|
|
|
|
|
|
|
@item Add a member to the tree structure enumerator for the node
|
|
|
|
For garbage collection and dynamic checking purposes, each @code{DECL}
|
|
|
|
node structure type is required to have a unique enumerator value
|
|
|
|
specified with it.
|
|
|
|
For language specific @code{DECL} nodes, this new enumerator value
|
calls.c, [...]: Fix comment typos.
* calls.c, fold-const.c, ipa-reference.c, ipa-type-escape.c,
tree-ssa-reassoc.c, tree-ssa-structalias.c, vec.h,
config/crx/crx.c, config/m32c/m32c.c, config/m32c/m32c.h: Fix
comment typos.
* doc/c-tree.texi, doc/tree-ssa.texi: Fix typos.
From-SVN: r102385
2005-07-26 15:53:54 +02:00
|
|
|
should go in the appropriate @file{.def} file.
|
2005-07-09 01:37:11 +02:00
|
|
|
For @code{DECL} nodes that are part of the middle-end, the enumerator
|
|
|
|
values are specified in @file{treestruct.def}.
|
|
|
|
|
|
|
|
@item Update @code{union tree_node}
|
|
|
|
In order to make your new structure type usable, it must be added to
|
|
|
|
@code{union tree_node}.
|
|
|
|
For language specific @code{DECL} nodes, a new entry should be added
|
calls.c, [...]: Fix comment typos.
* calls.c, fold-const.c, ipa-reference.c, ipa-type-escape.c,
tree-ssa-reassoc.c, tree-ssa-structalias.c, vec.h,
config/crx/crx.c, config/m32c/m32c.c, config/m32c/m32c.h: Fix
comment typos.
* doc/c-tree.texi, doc/tree-ssa.texi: Fix typos.
From-SVN: r102385
2005-07-26 15:53:54 +02:00
|
|
|
to the appropriate @file{.h} file of the form
|
2005-07-09 01:37:11 +02:00
|
|
|
@smallexample
|
|
|
|
struct tree_foo_decl GTY ((tag ("TS_VAR_DECL"))) foo_decl;
|
|
|
|
@end smallexample
|
|
|
|
For @code{DECL} nodes that are part of the middle-end, the additional
|
|
|
|
member goes directly into @code{union tree_node} in @file{tree.h}.
|
|
|
|
|
|
|
|
@item Update dynamic checking info
|
|
|
|
In order to be able to check whether accessing a named portion of
|
|
|
|
@code{union tree_node} is legal, and whether a certain @code{DECL} node
|
|
|
|
contains one of the enumerated @code{DECL} node structures in the
|
|
|
|
hierarchy, a simple lookup table is used.
|
|
|
|
This lookup table needs to be kept up to date with the tree structure
|
|
|
|
hierarchy, or else checking and containment macros will fail
|
calls.c, [...]: Fix comment typos.
* calls.c, fold-const.c, ipa-reference.c, ipa-type-escape.c,
tree-ssa-reassoc.c, tree-ssa-structalias.c, vec.h,
config/crx/crx.c, config/m32c/m32c.c, config/m32c/m32c.h: Fix
comment typos.
* doc/c-tree.texi, doc/tree-ssa.texi: Fix typos.
From-SVN: r102385
2005-07-26 15:53:54 +02:00
|
|
|
inappropriately.
|
2005-07-09 01:37:11 +02:00
|
|
|
|
|
|
|
For language specific @code{DECL} nodes, their is an @code{init_ts}
|
calls.c, [...]: Fix comment typos.
* calls.c, fold-const.c, ipa-reference.c, ipa-type-escape.c,
tree-ssa-reassoc.c, tree-ssa-structalias.c, vec.h,
config/crx/crx.c, config/m32c/m32c.c, config/m32c/m32c.h: Fix
comment typos.
* doc/c-tree.texi, doc/tree-ssa.texi: Fix typos.
From-SVN: r102385
2005-07-26 15:53:54 +02:00
|
|
|
function in an appropriate @file{.c} file, which initializes the lookup
|
2005-07-09 01:37:11 +02:00
|
|
|
table.
|
|
|
|
Code setting up the table for new @code{DECL} nodes should be added
|
|
|
|
there.
|
|
|
|
For each @code{DECL} tree code and enumerator value representing a
|
|
|
|
member of the inheritance hierarchy, the table should contain 1 if
|
|
|
|
that tree code inherits (directly or indirectly) from that member.
|
|
|
|
Thus, a @code{FOO_DECL} node derived from @code{struct decl_with_rtl},
|
|
|
|
and enumerator value @code{TS_FOO_DECL}, would be set up as follows
|
|
|
|
@smallexample
|
|
|
|
tree_contains_struct[FOO_DECL][TS_FOO_DECL] = 1;
|
|
|
|
tree_contains_struct[FOO_DECL][TS_DECL_WRTL] = 1;
|
|
|
|
tree_contains_struct[FOO_DECL][TS_DECL_COMMON] = 1;
|
|
|
|
tree_contains_struct[FOO_DECL][TS_DECL_MINIMAL] = 1;
|
|
|
|
@end smallexample
|
|
|
|
|
|
|
|
For @code{DECL} nodes that are part of the middle-end, the setup code
|
|
|
|
goes into @file{tree.c}.
|
|
|
|
|
|
|
|
@item Add macros to access any new fields and flags
|
|
|
|
|
|
|
|
Each added field or flag should have a macro that is used to access
|
calls.c, [...]: Fix comment typos.
* calls.c, fold-const.c, ipa-reference.c, ipa-type-escape.c,
tree-ssa-reassoc.c, tree-ssa-structalias.c, vec.h,
config/crx/crx.c, config/m32c/m32c.c, config/m32c/m32c.h: Fix
comment typos.
* doc/c-tree.texi, doc/tree-ssa.texi: Fix typos.
From-SVN: r102385
2005-07-26 15:53:54 +02:00
|
|
|
it, that performs appropriate checking to ensure only the right type of
|
2005-07-09 01:37:11 +02:00
|
|
|
@code{DECL} nodes access the field.
|
|
|
|
|
|
|
|
These macros generally take the following form
|
|
|
|
@smallexample
|
|
|
|
#define FOO_DECL_FIELDNAME(NODE) FOO_DECL_CHECK(NODE)->foo_decl.fieldname
|
|
|
|
@end smallexample
|
|
|
|
However, if the structure is simply a base class for further
|
|
|
|
structures, something like the following should be used
|
|
|
|
@smallexample
|
|
|
|
#define BASE_STRUCT_CHECK(T) CONTAINS_STRUCT_CHECK(T, TS_BASE_STRUCT)
|
|
|
|
#define BASE_STRUCT_FIELDNAME(NODE) \
|
|
|
|
(BASE_STRUCT_CHECK(NODE)->base_struct.fieldname
|
|
|
|
@end smallexample
|
|
|
|
|
|
|
|
@end table
|
|
|
|
|
|
|
|
|
1999-09-19 17:50:40 +02:00
|
|
|
@c ---------------------------------------------------------------------
|
|
|
|
@c Functions
|
|
|
|
@c ---------------------------------------------------------------------
|
|
|
|
|
|
|
|
@node Functions
|
2001-05-27 19:09:47 +02:00
|
|
|
@section Functions
|
1999-09-19 17:50:40 +02:00
|
|
|
@cindex function
|
|
|
|
@tindex FUNCTION_DECL
|
|
|
|
@tindex OVERLOAD
|
1999-09-29 21:00:46 +02:00
|
|
|
@findex OVL_CURRENT
|
|
|
|
@findex OVL_NEXT
|
1999-09-19 17:50:40 +02:00
|
|
|
|
|
|
|
A function is represented by a @code{FUNCTION_DECL} node. A set of
|
|
|
|
overloaded functions is sometimes represented by a @code{OVERLOAD} node.
|
|
|
|
|
|
|
|
An @code{OVERLOAD} node is not a declaration, so none of the
|
|
|
|
@samp{DECL_} macros should be used on an @code{OVERLOAD}. An
|
|
|
|
@code{OVERLOAD} node is similar to a @code{TREE_LIST}. Use
|
|
|
|
@code{OVL_CURRENT} to get the function associated with an
|
|
|
|
@code{OVERLOAD} node; use @code{OVL_NEXT} to get the next
|
|
|
|
@code{OVERLOAD} node in the list of overloaded functions. The macros
|
|
|
|
@code{OVL_CURRENT} and @code{OVL_NEXT} are actually polymorphic; you can
|
|
|
|
use them to work with @code{FUNCTION_DECL} nodes as well as with
|
2000-11-10 06:56:47 +01:00
|
|
|
overloads. In the case of a @code{FUNCTION_DECL}, @code{OVL_CURRENT}
|
1999-09-19 17:50:40 +02:00
|
|
|
will always return the function itself, and @code{OVL_NEXT} will always
|
|
|
|
be @code{NULL_TREE}.
|
|
|
|
|
|
|
|
To determine the scope of a function, you can use the
|
2003-04-11 20:36:25 +02:00
|
|
|
@code{DECL_CONTEXT} macro. This macro will return the class
|
1999-09-19 17:50:40 +02:00
|
|
|
(either a @code{RECORD_TYPE} or a @code{UNION_TYPE}) or namespace (a
|
|
|
|
@code{NAMESPACE_DECL}) of which the function is a member. For a virtual
|
|
|
|
function, this macro returns the class in which the function was
|
|
|
|
actually defined, not the base class in which the virtual declaration
|
c-tree.texi, [...]: Remove trailing whitespace.
* doc/c-tree.texi, doc/cpp.texi, doc/extend.texi,
doc/frontends.texi, doc/gcov.texi, doc/gty.texi, doc/install.texi,
doc/invoke.texi, doc/libgcc.texi, doc/md.texi, doc/rtl.texi,
doc/sourcebuild.texi, doc/standards.texi, doc/tm.texi,
doc/trouble.texi: Remove trailing whitespace.
From-SVN: r76098
2004-01-18 12:57:17 +01:00
|
|
|
occurred.
|
2003-04-11 20:36:25 +02:00
|
|
|
|
|
|
|
If a friend function is defined in a class scope, the
|
|
|
|
@code{DECL_FRIEND_CONTEXT} macro can be used to determine the class in
|
1999-09-19 17:50:40 +02:00
|
|
|
which it was defined. For example, in
|
c-tree.texi, [...]: Use @smallexample instead of @example.
* doc/c-tree.texi, doc/compat.texi, doc/cpp.texi,
doc/cppopts.texi, doc/extend.texi, doc/install.texi,
doc/interface.texi, doc/invoke.texi, doc/libgcc.texi, doc/md.texi,
doc/objc.texi, doc/rtl.texi, doc/tm.texi, doc/trouble.texi: Use
@smallexample instead of @example.
From-SVN: r76075
2004-01-18 02:20:48 +01:00
|
|
|
@smallexample
|
1999-09-19 17:50:40 +02:00
|
|
|
class C @{ friend void f() @{@} @};
|
c-tree.texi, [...]: Use @smallexample instead of @example.
* doc/c-tree.texi, doc/compat.texi, doc/cpp.texi,
doc/cppopts.texi, doc/extend.texi, doc/install.texi,
doc/interface.texi, doc/invoke.texi, doc/libgcc.texi, doc/md.texi,
doc/objc.texi, doc/rtl.texi, doc/tm.texi, doc/trouble.texi: Use
@smallexample instead of @example.
From-SVN: r76075
2004-01-18 02:20:48 +01:00
|
|
|
@end smallexample
|
2003-04-11 20:36:25 +02:00
|
|
|
@noindent
|
|
|
|
the @code{DECL_CONTEXT} for @code{f} will be the
|
|
|
|
@code{global_namespace}, but the @code{DECL_FRIEND_CONTEXT} will be the
|
1999-09-19 17:50:40 +02:00
|
|
|
@code{RECORD_TYPE} for @code{C}.
|
|
|
|
|
2003-04-11 20:36:25 +02:00
|
|
|
In C, the @code{DECL_CONTEXT} for a function maybe another function.
|
|
|
|
This representation indicates that the GNU nested function extension
|
|
|
|
is in use. For details on the semantics of nested functions, see the
|
|
|
|
GCC Manual. The nested function can refer to local variables in its
|
2000-09-24 23:47:45 +02:00
|
|
|
containing function. Such references are not explicitly marked in the
|
2001-06-21 02:03:48 +02:00
|
|
|
tree structure; back ends must look at the @code{DECL_CONTEXT} for the
|
2000-09-24 23:47:45 +02:00
|
|
|
referenced @code{VAR_DECL}. If the @code{DECL_CONTEXT} for the
|
|
|
|
referenced @code{VAR_DECL} is not the same as the function currently
|
2003-04-11 20:36:25 +02:00
|
|
|
being processed, and neither @code{DECL_EXTERNAL} nor
|
|
|
|
@code{DECL_STATIC} hold, then the reference is to a local variable in
|
|
|
|
a containing function, and the back end must take appropriate action.
|
2000-09-24 23:47:45 +02:00
|
|
|
|
1999-09-19 17:50:40 +02:00
|
|
|
@menu
|
|
|
|
* Function Basics:: Function names, linkage, and so forth.
|
|
|
|
* Function Bodies:: The statements that make up a function body.
|
|
|
|
@end menu
|
|
|
|
|
|
|
|
@c ---------------------------------------------------------------------
|
|
|
|
@c Function Basics
|
|
|
|
@c ---------------------------------------------------------------------
|
|
|
|
|
|
|
|
@node Function Basics
|
2001-05-27 19:09:47 +02:00
|
|
|
@subsection Function Basics
|
1999-09-19 17:50:40 +02:00
|
|
|
@cindex constructor
|
|
|
|
@cindex destructor
|
|
|
|
@cindex copy constructor
|
|
|
|
@cindex assignment operator
|
|
|
|
@cindex linkage
|
|
|
|
@findex DECL_NAME
|
|
|
|
@findex DECL_ASSEMBLER_NAME
|
|
|
|
@findex TREE_PUBLIC
|
|
|
|
@findex DECL_LINKONCE_P
|
|
|
|
@findex DECL_FUNCTION_MEMBER_P
|
|
|
|
@findex DECL_CONSTRUCTOR_P
|
|
|
|
@findex DECL_DESTRUCTOR_P
|
|
|
|
@findex DECL_OVERLOADED_OPERATOR_P
|
|
|
|
@findex DECL_CONV_FN_P
|
2000-11-10 06:56:47 +01:00
|
|
|
@findex DECL_ARTIFICIAL
|
1999-09-30 19:43:44 +02:00
|
|
|
@findex DECL_GLOBAL_CTOR_P
|
|
|
|
@findex DECL_GLOBAL_DTOR_P
|
|
|
|
@findex GLOBAL_INIT_PRIORITY
|
1999-09-19 17:50:40 +02:00
|
|
|
|
|
|
|
The following macros and functions can be used on a @code{FUNCTION_DECL}:
|
|
|
|
@ftable @code
|
2000-09-12 10:54:21 +02:00
|
|
|
@item DECL_MAIN_P
|
|
|
|
This predicate holds for a function that is the program entry point
|
c-tree.texi, [...]: Remove trailing whitespace.
* c-tree.texi, contrib.texi, cpp.texi, extend.texi, gcc.texi,
gcov.texi, install.texi, md.texi, objc.texi, rtl.texi, tm.texi:
Remove trailing whitespace.
From-SVN: r42678
2001-05-28 22:57:50 +02:00
|
|
|
@code{::code}.
|
2000-09-12 10:54:21 +02:00
|
|
|
|
1999-09-19 17:50:40 +02:00
|
|
|
@item DECL_NAME
|
|
|
|
This macro returns the unqualified name of the function, as an
|
|
|
|
@code{IDENTIFIER_NODE}. For an instantiation of a function template,
|
|
|
|
the @code{DECL_NAME} is the unqualified name of the template, not
|
|
|
|
something like @code{f<int>}. The value of @code{DECL_NAME} is
|
|
|
|
undefined when used on a constructor, destructor, overloaded operator,
|
|
|
|
or type-conversion operator, or any function that is implicitly
|
|
|
|
generated by the compiler. See below for macros that can be used to
|
|
|
|
distinguish these cases.
|
|
|
|
|
|
|
|
@item DECL_ASSEMBLER_NAME
|
|
|
|
This macro returns the mangled name of the function, also an
|
|
|
|
@code{IDENTIFIER_NODE}. This name does not contain leading underscores
|
|
|
|
on systems that prefix all identifiers with underscores. The mangled
|
|
|
|
name is computed in the same way on all platforms; if special processing
|
|
|
|
is required to deal with the object file format used on a particular
|
2001-06-21 02:03:48 +02:00
|
|
|
platform, it is the responsibility of the back end to perform those
|
|
|
|
modifications. (Of course, the back end should not modify
|
1999-09-19 17:50:40 +02:00
|
|
|
@code{DECL_ASSEMBLER_NAME} itself.)
|
|
|
|
|
2004-03-02 18:02:13 +01:00
|
|
|
Using @code{DECL_ASSEMBLER_NAME} will cause additional memory to be
|
|
|
|
allocated (for the mangled name of the entity) so it should be used
|
|
|
|
only when emitting assembly code. It should not be used within the
|
|
|
|
optimizers to determine whether or not two declarations are the same,
|
|
|
|
even though some of the existing optimizers do use it in that way.
|
|
|
|
These uses will be removed over time.
|
|
|
|
|
1999-09-29 22:07:56 +02:00
|
|
|
@item DECL_EXTERNAL
|
|
|
|
This predicate holds if the function is undefined.
|
|
|
|
|
1999-09-19 17:50:40 +02:00
|
|
|
@item TREE_PUBLIC
|
|
|
|
This predicate holds if the function has external linkage.
|
|
|
|
|
2000-09-12 10:54:21 +02:00
|
|
|
@item DECL_LOCAL_FUNCTION_P
|
|
|
|
This predicate holds if the function was declared at block scope, even
|
|
|
|
though it has a global scope.
|
|
|
|
|
|
|
|
@item DECL_ANTICIPATED
|
|
|
|
This predicate holds if the function is a built-in function but its
|
c-tree.texi, [...]: Remove trailing whitespace.
* c-tree.texi, contrib.texi, cpp.texi, extend.texi, gcc.texi,
gcov.texi, install.texi, md.texi, objc.texi, rtl.texi, tm.texi:
Remove trailing whitespace.
From-SVN: r42678
2001-05-28 22:57:50 +02:00
|
|
|
prototype is not yet explicitly declared.
|
2000-09-12 10:54:21 +02:00
|
|
|
|
|
|
|
@item DECL_EXTERN_C_FUNCTION_P
|
|
|
|
This predicate holds if the function is declared as an
|
|
|
|
`@code{extern "C"}' function.
|
|
|
|
|
1999-09-19 17:50:40 +02:00
|
|
|
@item DECL_LINKONCE_P
|
|
|
|
This macro holds if multiple copies of this function may be emitted in
|
|
|
|
various translation units. It is the responsibility of the linker to
|
|
|
|
merge the various copies. Template instantiations are the most common
|
|
|
|
example of functions for which @code{DECL_LINKONCE_P} holds; G++
|
|
|
|
instantiates needed templates in all translation units which require them,
|
|
|
|
and then relies on the linker to remove duplicate instantiations.
|
|
|
|
|
|
|
|
FIXME: This macro is not yet implemented.
|
|
|
|
|
|
|
|
@item DECL_FUNCTION_MEMBER_P
|
|
|
|
This macro holds if the function is a member of a class, rather than a
|
|
|
|
member of a namespace.
|
|
|
|
|
2000-09-12 10:54:21 +02:00
|
|
|
@item DECL_STATIC_FUNCTION_P
|
|
|
|
This predicate holds if the function a static member function.
|
|
|
|
|
1999-09-19 17:50:40 +02:00
|
|
|
@item DECL_NONSTATIC_MEMBER_FUNCTION_P
|
|
|
|
This macro holds for a non-static member function.
|
|
|
|
|
2000-09-12 10:54:21 +02:00
|
|
|
@item DECL_CONST_MEMFUNC_P
|
|
|
|
This predicate holds for a @code{const}-member function.
|
|
|
|
|
|
|
|
@item DECL_VOLATILE_MEMFUNC_P
|
|
|
|
This predicate holds for a @code{volatile}-member function.
|
|
|
|
|
1999-09-19 17:50:40 +02:00
|
|
|
@item DECL_CONSTRUCTOR_P
|
|
|
|
This macro holds if the function is a constructor.
|
|
|
|
|
2000-09-12 10:54:21 +02:00
|
|
|
@item DECL_NONCONVERTING_P
|
|
|
|
This predicate holds if the constructor is a non-converting constructor.
|
|
|
|
|
|
|
|
@item DECL_COMPLETE_CONSTRUCTOR_P
|
|
|
|
This predicate holds for a function which is a constructor for an object
|
|
|
|
of a complete type.
|
|
|
|
|
|
|
|
@item DECL_BASE_CONSTRUCTOR_P
|
|
|
|
This predicate holds for a function which is a constructor for a base
|
|
|
|
class sub-object.
|
|
|
|
|
|
|
|
@item DECL_COPY_CONSTRUCTOR_P
|
|
|
|
This predicate holds for a function which is a copy-constructor.
|
|
|
|
|
1999-09-19 17:50:40 +02:00
|
|
|
@item DECL_DESTRUCTOR_P
|
|
|
|
This macro holds if the function is a destructor.
|
|
|
|
|
2000-09-12 10:54:21 +02:00
|
|
|
@item DECL_COMPLETE_DESTRUCTOR_P
|
|
|
|
This predicate holds if the function is the destructor for an object a
|
2000-11-10 06:56:47 +01:00
|
|
|
complete type.
|
2000-09-12 10:54:21 +02:00
|
|
|
|
1999-09-19 17:50:40 +02:00
|
|
|
@item DECL_OVERLOADED_OPERATOR_P
|
|
|
|
This macro holds if the function is an overloaded operator.
|
|
|
|
|
|
|
|
@item DECL_CONV_FN_P
|
|
|
|
This macro holds if the function is a type-conversion operator.
|
|
|
|
|
1999-09-30 19:43:44 +02:00
|
|
|
@item DECL_GLOBAL_CTOR_P
|
|
|
|
This predicate holds if the function is a file-scope initialization
|
|
|
|
function.
|
|
|
|
|
|
|
|
@item DECL_GLOBAL_DTOR_P
|
|
|
|
This predicate holds if the function is a file-scope finalization
|
|
|
|
function.
|
|
|
|
|
2000-05-04 00:25:21 +02:00
|
|
|
@item DECL_THUNK_P
|
|
|
|
This predicate holds if the function is a thunk.
|
|
|
|
|
|
|
|
These functions represent stub code that adjusts the @code{this} pointer
|
|
|
|
and then jumps to another function. When the jumped-to function
|
|
|
|
returns, control is transferred directly to the caller, without
|
|
|
|
returning to the thunk. The first parameter to the thunk is always the
|
|
|
|
@code{this} pointer; the thunk should add @code{THUNK_DELTA} to this
|
|
|
|
value. (The @code{THUNK_DELTA} is an @code{int}, not an
|
c-tree.texi, [...]: Remove trailing whitespace.
* c-tree.texi, contrib.texi, cpp.texi, extend.texi, gcc.texi,
gcov.texi, install.texi, md.texi, objc.texi, rtl.texi, tm.texi:
Remove trailing whitespace.
From-SVN: r42678
2001-05-28 22:57:50 +02:00
|
|
|
@code{INTEGER_CST}.)
|
2000-05-31 08:53:04 +02:00
|
|
|
|
2001-10-10 01:11:55 +02:00
|
|
|
Then, if @code{THUNK_VCALL_OFFSET} (an @code{INTEGER_CST}) is nonzero
|
2000-06-23 03:14:40 +02:00
|
|
|
the adjusted @code{this} pointer must be adjusted again. The complete
|
2000-05-31 08:53:04 +02:00
|
|
|
calculation is given by the following pseudo-code:
|
|
|
|
|
2002-09-04 19:35:59 +02:00
|
|
|
@smallexample
|
2000-05-31 08:53:04 +02:00
|
|
|
this += THUNK_DELTA
|
|
|
|
if (THUNK_VCALL_OFFSET)
|
|
|
|
this += (*((ptrdiff_t **) this))[THUNK_VCALL_OFFSET]
|
2002-09-04 19:35:59 +02:00
|
|
|
@end smallexample
|
2000-05-31 08:53:04 +02:00
|
|
|
|
|
|
|
Finally, the thunk should jump to the location given
|
2000-05-04 00:25:21 +02:00
|
|
|
by @code{DECL_INITIAL}; this will always be an expression for the
|
|
|
|
address of a function.
|
|
|
|
|
2000-09-12 10:54:21 +02:00
|
|
|
@item DECL_NON_THUNK_FUNCTION_P
|
|
|
|
This predicate holds if the function is @emph{not} a thunk function.
|
|
|
|
|
1999-09-30 19:43:44 +02:00
|
|
|
@item GLOBAL_INIT_PRIORITY
|
|
|
|
If either @code{DECL_GLOBAL_CTOR_P} or @code{DECL_GLOBAL_DTOR_P} holds,
|
|
|
|
then this gives the initialization priority for the function. The
|
|
|
|
linker will arrange that all functions for which
|
|
|
|
@code{DECL_GLOBAL_CTOR_P} holds are run in increasing order of priority
|
|
|
|
before @code{main} is called. When the program exits, all functions for
|
|
|
|
which @code{DECL_GLOBAL_DTOR_P} holds are run in the reverse order.
|
|
|
|
|
1999-09-19 17:50:40 +02:00
|
|
|
@item DECL_ARTIFICIAL
|
|
|
|
This macro holds if the function was implicitly generated by the
|
|
|
|
compiler, rather than explicitly declared. In addition to implicitly
|
|
|
|
generated class member functions, this macro holds for the special
|
|
|
|
functions created to implement static initialization and destruction, to
|
|
|
|
compute run-time type information, and so forth.
|
|
|
|
|
|
|
|
@item DECL_ARGUMENTS
|
|
|
|
This macro returns the @code{PARM_DECL} for the first argument to the
|
|
|
|
function. Subsequent @code{PARM_DECL} nodes can be obtained by
|
|
|
|
following the @code{TREE_CHAIN} links.
|
|
|
|
|
1999-09-25 20:16:08 +02:00
|
|
|
@item DECL_RESULT
|
|
|
|
This macro returns the @code{RESULT_DECL} for the function.
|
|
|
|
|
1999-09-19 17:50:40 +02:00
|
|
|
@item TREE_TYPE
|
|
|
|
This macro returns the @code{FUNCTION_TYPE} or @code{METHOD_TYPE} for
|
|
|
|
the function.
|
|
|
|
|
2000-09-12 10:54:21 +02:00
|
|
|
@item TYPE_RAISES_EXCEPTIONS
|
|
|
|
This macro returns the list of exceptions that a (member-)function can
|
|
|
|
raise. The returned list, if non @code{NULL}, is comprised of nodes
|
|
|
|
whose @code{TREE_VALUE} represents a type.
|
|
|
|
|
|
|
|
@item TYPE_NOTHROW_P
|
|
|
|
This predicate holds when the exception-specification of its arguments
|
|
|
|
if of the form `@code{()}'.
|
|
|
|
|
|
|
|
@item DECL_ARRAY_DELETE_OPERATOR_P
|
|
|
|
This predicate holds if the function an overloaded
|
|
|
|
@code{operator delete[]}.
|
|
|
|
|
1999-09-19 17:50:40 +02:00
|
|
|
@end ftable
|
|
|
|
|
|
|
|
@c ---------------------------------------------------------------------
|
|
|
|
@c Function Bodies
|
|
|
|
@c ---------------------------------------------------------------------
|
|
|
|
|
|
|
|
@node Function Bodies
|
2001-05-27 19:09:47 +02:00
|
|
|
@subsection Function Bodies
|
1999-09-19 17:50:40 +02:00
|
|
|
@cindex function body
|
|
|
|
@cindex statements
|
|
|
|
@tindex BREAK_STMT
|
1999-09-23 04:10:55 +02:00
|
|
|
@tindex CLEANUP_STMT
|
|
|
|
@findex CLEANUP_DECL
|
|
|
|
@findex CLEANUP_EXPR
|
1999-09-19 17:50:40 +02:00
|
|
|
@tindex CONTINUE_STMT
|
|
|
|
@tindex DECL_STMT
|
|
|
|
@findex DECL_STMT_DECL
|
|
|
|
@tindex DO_STMT
|
|
|
|
@findex DO_BODY
|
|
|
|
@findex DO_COND
|
1999-10-21 09:10:36 +02:00
|
|
|
@tindex EMPTY_CLASS_EXPR
|
1999-09-19 17:50:40 +02:00
|
|
|
@tindex EXPR_STMT
|
|
|
|
@findex EXPR_STMT_EXPR
|
|
|
|
@tindex FOR_STMT
|
|
|
|
@findex FOR_INIT_STMT
|
|
|
|
@findex FOR_COND
|
|
|
|
@findex FOR_EXPR
|
|
|
|
@findex FOR_BODY
|
|
|
|
@tindex HANDLER
|
|
|
|
@tindex IF_STMT
|
|
|
|
@findex IF_COND
|
|
|
|
@findex THEN_CLAUSE
|
|
|
|
@findex ELSE_CLAUSE
|
|
|
|
@tindex RETURN_STMT
|
|
|
|
@findex RETURN_EXPR
|
|
|
|
@tindex SUBOBJECT
|
|
|
|
@findex SUBOBJECT_CLEANUP
|
|
|
|
@tindex SWITCH_STMT
|
|
|
|
@findex SWITCH_COND
|
|
|
|
@findex SWITCH_BODY
|
|
|
|
@tindex TRY_BLOCK
|
|
|
|
@findex TRY_STMTS
|
|
|
|
@findex TRY_HANDLERS
|
|
|
|
@findex HANDLER_PARMS
|
|
|
|
@findex HANDLER_BODY
|
2001-05-01 16:43:17 +02:00
|
|
|
@findex USING_STMT
|
1999-09-19 17:50:40 +02:00
|
|
|
@tindex WHILE_STMT
|
|
|
|
@findex WHILE_BODY
|
|
|
|
@findex WHILE_COND
|
|
|
|
|
|
|
|
A function that has a definition in the current translation unit will
|
2001-10-07 13:05:45 +02:00
|
|
|
have a non-@code{NULL} @code{DECL_INITIAL}. However, back ends should not make
|
1999-09-20 22:19:04 +02:00
|
|
|
use of the particular value given by @code{DECL_INITIAL}.
|
1999-09-19 17:50:40 +02:00
|
|
|
|
|
|
|
The @code{DECL_SAVED_TREE} macro will give the complete body of the
|
2004-06-17 03:24:06 +02:00
|
|
|
function.
|
1999-09-19 17:50:40 +02:00
|
|
|
|
2001-05-27 19:09:47 +02:00
|
|
|
@subsubsection Statements
|
1999-09-19 17:50:40 +02:00
|
|
|
|
2004-05-13 08:41:07 +02:00
|
|
|
There are tree nodes corresponding to all of the source-level
|
|
|
|
statement constructs, used within the C and C++ frontends. These are
|
|
|
|
enumerated here, together with a list of the various macros that can
|
|
|
|
be used to obtain information about them. There are a few macros that
|
|
|
|
can be used with all statements:
|
1999-09-19 17:50:40 +02:00
|
|
|
|
|
|
|
@ftable @code
|
1999-09-24 03:43:49 +02:00
|
|
|
@item STMT_IS_FULL_EXPR_P
|
|
|
|
In C++, statements normally constitute ``full expressions''; temporaries
|
|
|
|
created during a statement are destroyed when the statement is complete.
|
|
|
|
However, G++ sometimes represents expressions by statements; these
|
|
|
|
statements will not have @code{STMT_IS_FULL_EXPR_P} set. Temporaries
|
|
|
|
created during such statements should be destroyed when the innermost
|
|
|
|
enclosing statement with @code{STMT_IS_FULL_EXPR_P} set is exited.
|
|
|
|
|
1999-09-19 17:50:40 +02:00
|
|
|
@end ftable
|
|
|
|
|
|
|
|
Here is the list of the various statement nodes, and the macros used to
|
|
|
|
access them. This documentation describes the use of these nodes in
|
|
|
|
non-template functions (including instantiations of template functions).
|
|
|
|
In template functions, the same nodes are used, but sometimes in
|
c-tree.texi, [...]: Remove trailing whitespace.
* c-tree.texi, contrib.texi, cpp.texi, extend.texi, gcc.texi,
gcov.texi, install.texi, md.texi, objc.texi, rtl.texi, tm.texi:
Remove trailing whitespace.
From-SVN: r42678
2001-05-28 22:57:50 +02:00
|
|
|
slightly different ways.
|
1999-09-19 17:50:40 +02:00
|
|
|
|
|
|
|
Many of the statements have substatements. For example, a @code{while}
|
|
|
|
loop will have a body, which is itself a statement. If the substatement
|
|
|
|
is @code{NULL_TREE}, it is considered equivalent to a statement
|
|
|
|
consisting of a single @code{;}, i.e., an expression statement in which
|
1999-09-20 22:19:04 +02:00
|
|
|
the expression has been omitted. A substatement may in fact be a list
|
|
|
|
of statements, connected via their @code{TREE_CHAIN}s. So, you should
|
|
|
|
always process the statement tree by looping over substatements, like
|
|
|
|
this:
|
c-tree.texi, [...]: Use @smallexample instead of @example.
* doc/c-tree.texi, doc/compat.texi, doc/cpp.texi,
doc/cppopts.texi, doc/extend.texi, doc/install.texi,
doc/interface.texi, doc/invoke.texi, doc/libgcc.texi, doc/md.texi,
doc/objc.texi, doc/rtl.texi, doc/tm.texi, doc/trouble.texi: Use
@smallexample instead of @example.
From-SVN: r76075
2004-01-18 02:20:48 +01:00
|
|
|
@smallexample
|
1999-09-20 22:19:04 +02:00
|
|
|
void process_stmt (stmt)
|
|
|
|
tree stmt;
|
1999-09-23 15:55:27 +02:00
|
|
|
@{
|
1999-09-20 22:19:04 +02:00
|
|
|
while (stmt)
|
1999-09-23 15:55:27 +02:00
|
|
|
@{
|
1999-09-20 22:19:04 +02:00
|
|
|
switch (TREE_CODE (stmt))
|
1999-09-23 15:55:27 +02:00
|
|
|
@{
|
1999-09-20 22:19:04 +02:00
|
|
|
case IF_STMT:
|
|
|
|
process_stmt (THEN_CLAUSE (stmt));
|
2005-03-05 20:56:31 +01:00
|
|
|
/* @r{More processing here.} */
|
1999-09-20 22:19:04 +02:00
|
|
|
break;
|
c-tree.texi, [...]: Remove trailing whitespace.
* c-tree.texi, contrib.texi, cpp.texi, extend.texi, gcc.texi,
gcov.texi, install.texi, md.texi, objc.texi, rtl.texi, tm.texi:
Remove trailing whitespace.
From-SVN: r42678
2001-05-28 22:57:50 +02:00
|
|
|
|
c-tree.texi, [...]: Use more logical markup.
* doc/c-tree.texi, doc/contrib.texi, doc/extend.texi,
doc/gcc.texi, doc/gcov.texi, doc/install-old.texi,
doc/invoke.texi, doc/md.texi, doc/rtl.texi, doc/tm.texi: Use more
logical markup. Use TeX quotes and dashes. Use @dots{} and
@minus{}. Avoid spaces inside @var. Update last modification
date in gcc.texi.
* doc/gcc.1, doc/gcov.1: Regenerate.
From-SVN: r43369
2001-06-14 13:08:04 +02:00
|
|
|
@dots{}
|
1999-09-23 15:55:27 +02:00
|
|
|
@}
|
1999-09-20 22:19:04 +02:00
|
|
|
|
|
|
|
stmt = TREE_CHAIN (stmt);
|
1999-09-23 15:55:27 +02:00
|
|
|
@}
|
|
|
|
@}
|
c-tree.texi, [...]: Use @smallexample instead of @example.
* doc/c-tree.texi, doc/compat.texi, doc/cpp.texi,
doc/cppopts.texi, doc/extend.texi, doc/install.texi,
doc/interface.texi, doc/invoke.texi, doc/libgcc.texi, doc/md.texi,
doc/objc.texi, doc/rtl.texi, doc/tm.texi, doc/trouble.texi: Use
@smallexample instead of @example.
From-SVN: r76075
2004-01-18 02:20:48 +01:00
|
|
|
@end smallexample
|
1999-09-20 22:19:04 +02:00
|
|
|
In other words, while the @code{then} clause of an @code{if} statement
|
|
|
|
in C++ can be only one statement (although that one statement may be a
|
|
|
|
compound statement), the intermediate representation will sometimes use
|
|
|
|
several statements chained together.
|
1999-09-19 17:50:40 +02:00
|
|
|
|
|
|
|
@table @code
|
2004-06-17 03:24:06 +02:00
|
|
|
@item ASM_EXPR
|
1999-09-19 17:50:40 +02:00
|
|
|
|
|
|
|
Used to represent an inline assembly statement. For an inline assembly
|
|
|
|
statement like:
|
c-tree.texi, [...]: Use @smallexample instead of @example.
* doc/c-tree.texi, doc/compat.texi, doc/cpp.texi,
doc/cppopts.texi, doc/extend.texi, doc/install.texi,
doc/interface.texi, doc/invoke.texi, doc/libgcc.texi, doc/md.texi,
doc/objc.texi, doc/rtl.texi, doc/tm.texi, doc/trouble.texi: Use
@smallexample instead of @example.
From-SVN: r76075
2004-01-18 02:20:48 +01:00
|
|
|
@smallexample
|
1999-09-19 17:50:40 +02:00
|
|
|
asm ("mov x, y");
|
c-tree.texi, [...]: Use @smallexample instead of @example.
* doc/c-tree.texi, doc/compat.texi, doc/cpp.texi,
doc/cppopts.texi, doc/extend.texi, doc/install.texi,
doc/interface.texi, doc/invoke.texi, doc/libgcc.texi, doc/md.texi,
doc/objc.texi, doc/rtl.texi, doc/tm.texi, doc/trouble.texi: Use
@smallexample instead of @example.
From-SVN: r76075
2004-01-18 02:20:48 +01:00
|
|
|
@end smallexample
|
1999-09-19 17:50:40 +02:00
|
|
|
The @code{ASM_STRING} macro will return a @code{STRING_CST} node for
|
c-tree.texi, [...]: Remove trailing whitespace.
* c-tree.texi, contrib.texi, cpp.texi, extend.texi, gcc.texi,
gcov.texi, install.texi, md.texi, objc.texi, rtl.texi, tm.texi:
Remove trailing whitespace.
From-SVN: r42678
2001-05-28 22:57:50 +02:00
|
|
|
@code{"mov x, y"}. If the original statement made use of the
|
1999-09-19 17:50:40 +02:00
|
|
|
extended-assembly syntax, then @code{ASM_OUTPUTS},
|
|
|
|
@code{ASM_INPUTS}, and @code{ASM_CLOBBERS} will be the outputs, inputs,
|
|
|
|
and clobbers for the statement, represented as @code{STRING_CST} nodes.
|
|
|
|
The extended-assembly syntax looks like:
|
c-tree.texi, [...]: Use @smallexample instead of @example.
* doc/c-tree.texi, doc/compat.texi, doc/cpp.texi,
doc/cppopts.texi, doc/extend.texi, doc/install.texi,
doc/interface.texi, doc/invoke.texi, doc/libgcc.texi, doc/md.texi,
doc/objc.texi, doc/rtl.texi, doc/tm.texi, doc/trouble.texi: Use
@smallexample instead of @example.
From-SVN: r76075
2004-01-18 02:20:48 +01:00
|
|
|
@smallexample
|
1999-09-19 17:50:40 +02:00
|
|
|
asm ("fsinx %1,%0" : "=f" (result) : "f" (angle));
|
c-tree.texi, [...]: Use @smallexample instead of @example.
* doc/c-tree.texi, doc/compat.texi, doc/cpp.texi,
doc/cppopts.texi, doc/extend.texi, doc/install.texi,
doc/interface.texi, doc/invoke.texi, doc/libgcc.texi, doc/md.texi,
doc/objc.texi, doc/rtl.texi, doc/tm.texi, doc/trouble.texi: Use
@smallexample instead of @example.
From-SVN: r76075
2004-01-18 02:20:48 +01:00
|
|
|
@end smallexample
|
1999-09-19 17:50:40 +02:00
|
|
|
The first string is the @code{ASM_STRING}, containing the instruction
|
|
|
|
template. The next two strings are the output and inputs, respectively;
|
|
|
|
this statement has no clobbers. As this example indicates, ``plain''
|
|
|
|
assembly statements are merely a special case of extended assembly
|
|
|
|
statements; they have no cv-qualifiers, outputs, inputs, or clobbers.
|
|
|
|
All of the strings will be @code{NUL}-terminated, and will contain no
|
|
|
|
embedded @code{NUL}-characters.
|
|
|
|
|
|
|
|
If the assembly statement is declared @code{volatile}, or if the
|
|
|
|
statement was not an extended assembly statement, and is therefore
|
|
|
|
implicitly volatile, then the predicate @code{ASM_VOLATILE_P} will hold
|
2004-06-17 03:24:06 +02:00
|
|
|
of the @code{ASM_EXPR}.
|
1999-09-19 17:50:40 +02:00
|
|
|
|
|
|
|
@item BREAK_STMT
|
|
|
|
|
|
|
|
Used to represent a @code{break} statement. There are no additional
|
|
|
|
fields.
|
|
|
|
|
2004-06-17 03:24:06 +02:00
|
|
|
@item CASE_LABEL_EXPR
|
1999-09-19 17:50:40 +02:00
|
|
|
|
|
|
|
Use to represent a @code{case} label, range of @code{case} labels, or a
|
2001-10-09 08:03:16 +02:00
|
|
|
@code{default} label. If @code{CASE_LOW} is @code{NULL_TREE}, then this is a
|
2001-10-07 13:05:45 +02:00
|
|
|
@code{default} label. Otherwise, if @code{CASE_HIGH} is @code{NULL_TREE}, then
|
1999-09-19 17:50:40 +02:00
|
|
|
this is an ordinary @code{case} label. In this case, @code{CASE_LOW} is
|
|
|
|
an expression giving the value of the label. Both @code{CASE_LOW} and
|
|
|
|
@code{CASE_HIGH} are @code{INTEGER_CST} nodes. These values will have
|
|
|
|
the same type as the condition expression in the switch statement.
|
|
|
|
|
|
|
|
Otherwise, if both @code{CASE_LOW} and @code{CASE_HIGH} are defined, the
|
|
|
|
statement is a range of case labels. Such statements originate with the
|
2000-09-24 23:47:45 +02:00
|
|
|
extension that allows users to write things of the form:
|
c-tree.texi, [...]: Use @smallexample instead of @example.
* doc/c-tree.texi, doc/compat.texi, doc/cpp.texi,
doc/cppopts.texi, doc/extend.texi, doc/install.texi,
doc/interface.texi, doc/invoke.texi, doc/libgcc.texi, doc/md.texi,
doc/objc.texi, doc/rtl.texi, doc/tm.texi, doc/trouble.texi: Use
@smallexample instead of @example.
From-SVN: r76075
2004-01-18 02:20:48 +01:00
|
|
|
@smallexample
|
1999-09-19 17:50:40 +02:00
|
|
|
case 2 ... 5:
|
c-tree.texi, [...]: Use @smallexample instead of @example.
* doc/c-tree.texi, doc/compat.texi, doc/cpp.texi,
doc/cppopts.texi, doc/extend.texi, doc/install.texi,
doc/interface.texi, doc/invoke.texi, doc/libgcc.texi, doc/md.texi,
doc/objc.texi, doc/rtl.texi, doc/tm.texi, doc/trouble.texi: Use
@smallexample instead of @example.
From-SVN: r76075
2004-01-18 02:20:48 +01:00
|
|
|
@end smallexample
|
1999-09-19 17:50:40 +02:00
|
|
|
The first value will be @code{CASE_LOW}, while the second will be
|
|
|
|
@code{CASE_HIGH}.
|
|
|
|
|
1999-09-23 04:10:55 +02:00
|
|
|
@item CLEANUP_STMT
|
|
|
|
|
|
|
|
Used to represent an action that should take place upon exit from the
|
|
|
|
enclosing scope. Typically, these actions are calls to destructors for
|
2001-06-21 02:03:48 +02:00
|
|
|
local objects, but back ends cannot rely on this fact. If these nodes
|
1999-09-23 04:10:55 +02:00
|
|
|
are in fact representing such destructors, @code{CLEANUP_DECL} will be
|
|
|
|
the @code{VAR_DECL} destroyed. Otherwise, @code{CLEANUP_DECL} will be
|
|
|
|
@code{NULL_TREE}. In any case, the @code{CLEANUP_EXPR} is the
|
|
|
|
expression to execute. The cleanups executed on exit from a scope
|
|
|
|
should be run in the reverse order of the order in which the associated
|
|
|
|
@code{CLEANUP_STMT}s were encountered.
|
|
|
|
|
1999-09-19 17:50:40 +02:00
|
|
|
@item CONTINUE_STMT
|
|
|
|
|
|
|
|
Used to represent a @code{continue} statement. There are no additional
|
|
|
|
fields.
|
|
|
|
|
Make-lang.in (CXX_SRCS): Add optimize.c.
1999-11-25 Mark Mitchell <mark@codesourcery.com>
* Make-lang.in (CXX_SRCS): Add optimize.c.
* Makefile.in (CXX_OBJS): Add optimize.o.
(CXX_TREE_H): Add splay-tree.h, system.h, and $(CONFIG_H).
(spew.o, lex.o, decl.o, decl2.o, typeck2.o, typeck.o): Adjust.
(class.o, call.o, friend.o, init.o, method.o, cvt.o): Likewise.
(search.o, tree.o, ptree.o, rtti.o, except.o, expr.o): Likewise.
(xref.o, pt.o, error.o, errfn.o, repo.o, semantics.o): Likewise.
(dump.o): Likewise.
(optimize.o): New target.
* class.c: Don't include splay-tree.h.
* cp-tree.def (CTOR_COMPLETE): Rename to CTOR_STMT.
* cp-tree.h: Include splay-tree.h.
(DECL_UNINLINABLE): New macro.
(CTOR_BEGIN_P, CTOR_END_P): New macros.
(flag_inline_trees): New variable.
(local_variable_p): New function.
(nonstatic_local_decl_p): Likewise.
(optimize_function): Likewise.
(cplus_unsave_expr_now): Remove.
(copy_tree_r): Declare.
(remap_save_expr): Likewise.
* decl.c (local_variable_p): Don't
make it static.
(local_variable_p_walkfn): New function.
(make_rtl_for_local_static): Remove code to try to avoid writing
out static constants.
(emit_local_var): Fix indentation.
(nonstatic_local_decl_p): New function.
(check_default_argument): Use local_variable_p_walkfn, not
local_variable_p, when walking the tree.
(start_function): Set the DECL_CONTEXT for automatically generated
labels.
(finish_constructor_body): Use CTOR_STMT to mark the end of a
constructor.
* decl2.c: Don't include splay-tree.h.
(flag_inline_trees): Define.
* dump.c: Don't include
splay-tree.h.
* except.c (expand_end_catch_block): Fix comment formatting.
(expand_end_eh_spec): Set DECL_CONTEXT on temporary variables.
(expand_throw): Tidy comment.
* init.c (build_vec_delete_1): Use create_temporary_var.
* lex.c (cplus_tree_code_type): Make it static.
(cplus_tree_code_length): Likewise.
(cplus_tree_code_name): Likewise.
* optimize.c: New file.
* semantics.c (finish_goto_stmt): Set DECL_UNLINABLE for functions
with computed gotos.
(setup_vtbl_ptr): Mark the beginnings of constructors with
CTOR_STMT.
(expand_stmt): Handle CTOR_STMT, not CTOR_COMPLETE.
(expand_body): Call optimize_function. Save bodies if we're doing
inlining on trees.
* tree.c: Don't include splay-tree.h. Include insn-config.h and
integrate.h.
(copy_tree_r): Make it public.
(statement_code_p): New function.
(mark_local_for_remap_r): Likewise.
(cp_usave_r): Likewise.
(cp_unsave): Likewise.
(build_cplus_new): Set DECL_CONTEXT for temporary variables.
(walk_tree): Walk into `s' class nodes. Walk statement chains.
(copy_tree_r): Handle 's' class nodes. Restore chains for
statements. Nullify scopes. Don't copy types.
(init_tree): Set lang_unsave to cp_unsave.
(remap_save_expr): Define.
* ir.texi: Document CTOR_STMT.
From-SVN: r30669
1999-11-25 21:32:04 +01:00
|
|
|
@item CTOR_STMT
|
1999-11-23 08:31:07 +01:00
|
|
|
|
Make-lang.in (CXX_SRCS): Add optimize.c.
1999-11-25 Mark Mitchell <mark@codesourcery.com>
* Make-lang.in (CXX_SRCS): Add optimize.c.
* Makefile.in (CXX_OBJS): Add optimize.o.
(CXX_TREE_H): Add splay-tree.h, system.h, and $(CONFIG_H).
(spew.o, lex.o, decl.o, decl2.o, typeck2.o, typeck.o): Adjust.
(class.o, call.o, friend.o, init.o, method.o, cvt.o): Likewise.
(search.o, tree.o, ptree.o, rtti.o, except.o, expr.o): Likewise.
(xref.o, pt.o, error.o, errfn.o, repo.o, semantics.o): Likewise.
(dump.o): Likewise.
(optimize.o): New target.
* class.c: Don't include splay-tree.h.
* cp-tree.def (CTOR_COMPLETE): Rename to CTOR_STMT.
* cp-tree.h: Include splay-tree.h.
(DECL_UNINLINABLE): New macro.
(CTOR_BEGIN_P, CTOR_END_P): New macros.
(flag_inline_trees): New variable.
(local_variable_p): New function.
(nonstatic_local_decl_p): Likewise.
(optimize_function): Likewise.
(cplus_unsave_expr_now): Remove.
(copy_tree_r): Declare.
(remap_save_expr): Likewise.
* decl.c (local_variable_p): Don't
make it static.
(local_variable_p_walkfn): New function.
(make_rtl_for_local_static): Remove code to try to avoid writing
out static constants.
(emit_local_var): Fix indentation.
(nonstatic_local_decl_p): New function.
(check_default_argument): Use local_variable_p_walkfn, not
local_variable_p, when walking the tree.
(start_function): Set the DECL_CONTEXT for automatically generated
labels.
(finish_constructor_body): Use CTOR_STMT to mark the end of a
constructor.
* decl2.c: Don't include splay-tree.h.
(flag_inline_trees): Define.
* dump.c: Don't include
splay-tree.h.
* except.c (expand_end_catch_block): Fix comment formatting.
(expand_end_eh_spec): Set DECL_CONTEXT on temporary variables.
(expand_throw): Tidy comment.
* init.c (build_vec_delete_1): Use create_temporary_var.
* lex.c (cplus_tree_code_type): Make it static.
(cplus_tree_code_length): Likewise.
(cplus_tree_code_name): Likewise.
* optimize.c: New file.
* semantics.c (finish_goto_stmt): Set DECL_UNLINABLE for functions
with computed gotos.
(setup_vtbl_ptr): Mark the beginnings of constructors with
CTOR_STMT.
(expand_stmt): Handle CTOR_STMT, not CTOR_COMPLETE.
(expand_body): Call optimize_function. Save bodies if we're doing
inlining on trees.
* tree.c: Don't include splay-tree.h. Include insn-config.h and
integrate.h.
(copy_tree_r): Make it public.
(statement_code_p): New function.
(mark_local_for_remap_r): Likewise.
(cp_usave_r): Likewise.
(cp_unsave): Likewise.
(build_cplus_new): Set DECL_CONTEXT for temporary variables.
(walk_tree): Walk into `s' class nodes. Walk statement chains.
(copy_tree_r): Handle 's' class nodes. Restore chains for
statements. Nullify scopes. Don't copy types.
(init_tree): Set lang_unsave to cp_unsave.
(remap_save_expr): Define.
* ir.texi: Document CTOR_STMT.
From-SVN: r30669
1999-11-25 21:32:04 +01:00
|
|
|
Used to mark the beginning (if @code{CTOR_BEGIN_P} holds) or end (if
|
|
|
|
@code{CTOR_END_P} holds of the main body of a constructor. See also
|
|
|
|
@code{SUBOBJECT} for more information on how to use these nodes.
|
1999-11-23 08:31:07 +01:00
|
|
|
|
1999-09-19 17:50:40 +02:00
|
|
|
@item DECL_STMT
|
|
|
|
|
|
|
|
Used to represent a local declaration. The @code{DECL_STMT_DECL} macro
|
|
|
|
can be used to obtain the entity declared. This declaration may be a
|
|
|
|
@code{LABEL_DECL}, indicating that the label declared is a local label.
|
2000-09-24 23:47:45 +02:00
|
|
|
(As an extension, GCC allows the declaration of labels with scope.) In
|
|
|
|
C, this declaration may be a @code{FUNCTION_DECL}, indicating the
|
|
|
|
use of the GCC nested function extension. For more information,
|
|
|
|
@pxref{Functions}.
|
1999-09-19 17:50:40 +02:00
|
|
|
|
|
|
|
@item DO_STMT
|
|
|
|
|
|
|
|
Used to represent a @code{do} loop. The body of the loop is given by
|
|
|
|
@code{DO_BODY} while the termination condition for the loop is given by
|
|
|
|
@code{DO_COND}. The condition for a @code{do}-statement is always an
|
|
|
|
expression.
|
|
|
|
|
1999-10-21 09:10:36 +02:00
|
|
|
@item EMPTY_CLASS_EXPR
|
|
|
|
|
|
|
|
Used to represent a temporary object of a class with no data whose
|
|
|
|
address is never taken. (All such objects are interchangeable.) The
|
|
|
|
@code{TREE_TYPE} represents the type of the object.
|
|
|
|
|
1999-09-19 17:50:40 +02:00
|
|
|
@item EXPR_STMT
|
|
|
|
|
|
|
|
Used to represent an expression statement. Use @code{EXPR_STMT_EXPR} to
|
|
|
|
obtain the expression.
|
|
|
|
|
|
|
|
@item FOR_STMT
|
|
|
|
|
|
|
|
Used to represent a @code{for} statement. The @code{FOR_INIT_STMT} is
|
|
|
|
the initialization statement for the loop. The @code{FOR_COND} is the
|
|
|
|
termination condition. The @code{FOR_EXPR} is the expression executed
|
|
|
|
right before the @code{FOR_COND} on each loop iteration; often, this
|
|
|
|
expression increments a counter. The body of the loop is given by
|
|
|
|
@code{FOR_BODY}. Note that @code{FOR_INIT_STMT} and @code{FOR_BODY}
|
|
|
|
return statements, while @code{FOR_COND} and @code{FOR_EXPR} return
|
|
|
|
expressions.
|
|
|
|
|
2004-06-17 03:24:06 +02:00
|
|
|
@item GOTO_EXPR
|
1999-09-19 17:50:40 +02:00
|
|
|
|
2001-11-28 10:47:25 +01:00
|
|
|
Used to represent a @code{goto} statement. The @code{GOTO_DESTINATION} will
|
|
|
|
usually be a @code{LABEL_DECL}. However, if the ``computed goto'' extension
|
|
|
|
has been used, the @code{GOTO_DESTINATION} will be an arbitrary expression
|
|
|
|
indicating the destination. This expression will always have pointer type.
|
1999-09-19 17:50:40 +02:00
|
|
|
|
2001-05-22 02:52:58 +02:00
|
|
|
@item HANDLER
|
|
|
|
|
|
|
|
Used to represent a C++ @code{catch} block. The @code{HANDLER_TYPE}
|
|
|
|
is the type of exception that will be caught by this handler; it is
|
2003-12-01 04:22:35 +01:00
|
|
|
equal (by pointer equality) to @code{NULL} if this handler is for all
|
|
|
|
types. @code{HANDLER_PARMS} is the @code{DECL_STMT} for the catch
|
2004-06-17 03:24:06 +02:00
|
|
|
parameter, and @code{HANDLER_BODY} is the code for the block itself.
|
2001-05-22 02:52:58 +02:00
|
|
|
|
1999-09-19 17:50:40 +02:00
|
|
|
@item IF_STMT
|
|
|
|
|
|
|
|
Used to represent an @code{if} statement. The @code{IF_COND} is the
|
c-tree.texi, [...]: Remove trailing whitespace.
* c-tree.texi, contrib.texi, cpp.texi, extend.texi, gcc.texi,
gcov.texi, install.texi, md.texi, objc.texi, rtl.texi, tm.texi:
Remove trailing whitespace.
From-SVN: r42678
2001-05-28 22:57:50 +02:00
|
|
|
expression.
|
2000-10-23 16:43:33 +02:00
|
|
|
|
|
|
|
If the condition is a @code{TREE_LIST}, then the @code{TREE_PURPOSE} is
|
c-tree.texi, [...]: Fix spelling and typos.
* doc/c-tree.texi, doc/contrib.texi, doc/extend.texi,
doc/gcc.texi, doc/install.texi, doc/invoke.texi, doc/md.texi,
doc/objc.texi, doc/rtl.texi, doc/tm.texi: Fix spelling and typos.
Consistently use "built-in" and "bit-field". Minor logical markup
improvements.
* doc/gcc.1: Regenerate.
From-SVN: r43383
2001-06-15 00:51:18 +02:00
|
|
|
a statement (usually a @code{DECL_STMT}). Each time the condition is
|
2000-10-23 16:43:33 +02:00
|
|
|
evaluated, the statement should be executed. Then, the
|
|
|
|
@code{TREE_VALUE} should be used as the conditional expression itself.
|
|
|
|
This representation is used to handle C++ code like this:
|
|
|
|
|
c-tree.texi, [...]: Use @smallexample instead of @example.
* doc/c-tree.texi, doc/compat.texi, doc/cpp.texi,
doc/cppopts.texi, doc/extend.texi, doc/install.texi,
doc/interface.texi, doc/invoke.texi, doc/libgcc.texi, doc/md.texi,
doc/objc.texi, doc/rtl.texi, doc/tm.texi, doc/trouble.texi: Use
@smallexample instead of @example.
From-SVN: r76075
2004-01-18 02:20:48 +01:00
|
|
|
@smallexample
|
c-tree.texi, [...]: Use more logical markup.
* doc/c-tree.texi, doc/contrib.texi, doc/extend.texi,
doc/gcc.texi, doc/gcov.texi, doc/install-old.texi,
doc/invoke.texi, doc/md.texi, doc/rtl.texi, doc/tm.texi: Use more
logical markup. Use TeX quotes and dashes. Use @dots{} and
@minus{}. Avoid spaces inside @var. Update last modification
date in gcc.texi.
* doc/gcc.1, doc/gcov.1: Regenerate.
From-SVN: r43369
2001-06-14 13:08:04 +02:00
|
|
|
if (int i = 7) @dots{}
|
c-tree.texi, [...]: Use @smallexample instead of @example.
* doc/c-tree.texi, doc/compat.texi, doc/cpp.texi,
doc/cppopts.texi, doc/extend.texi, doc/install.texi,
doc/interface.texi, doc/invoke.texi, doc/libgcc.texi, doc/md.texi,
doc/objc.texi, doc/rtl.texi, doc/tm.texi, doc/trouble.texi: Use
@smallexample instead of @example.
From-SVN: r76075
2004-01-18 02:20:48 +01:00
|
|
|
@end smallexample
|
2000-10-23 16:43:33 +02:00
|
|
|
|
|
|
|
where there is a new local variable (or variables) declared within the
|
|
|
|
condition.
|
1999-09-19 17:50:40 +02:00
|
|
|
|
|
|
|
The @code{THEN_CLAUSE} represents the statement given by the @code{then}
|
|
|
|
condition, while the @code{ELSE_CLAUSE} represents the statement given
|
|
|
|
by the @code{else} condition.
|
|
|
|
|
2004-06-17 03:24:06 +02:00
|
|
|
@item LABEL_EXPR
|
1999-09-19 17:50:40 +02:00
|
|
|
|
|
|
|
Used to represent a label. The @code{LABEL_DECL} declared by this
|
2004-06-17 03:24:06 +02:00
|
|
|
statement can be obtained with the @code{LABEL_EXPR_LABEL} macro. The
|
1999-09-19 17:50:40 +02:00
|
|
|
@code{IDENTIFIER_NODE} giving the name of the label can be obtained from
|
|
|
|
the @code{LABEL_DECL} with @code{DECL_NAME}.
|
|
|
|
|
|
|
|
@item RETURN_STMT
|
|
|
|
|
|
|
|
Used to represent a @code{return} statement. The @code{RETURN_EXPR} is
|
|
|
|
the expression returned; it will be @code{NULL_TREE} if the statement
|
|
|
|
was just
|
c-tree.texi, [...]: Use @smallexample instead of @example.
* doc/c-tree.texi, doc/compat.texi, doc/cpp.texi,
doc/cppopts.texi, doc/extend.texi, doc/install.texi,
doc/interface.texi, doc/invoke.texi, doc/libgcc.texi, doc/md.texi,
doc/objc.texi, doc/rtl.texi, doc/tm.texi, doc/trouble.texi: Use
@smallexample instead of @example.
From-SVN: r76075
2004-01-18 02:20:48 +01:00
|
|
|
@smallexample
|
1999-09-19 17:50:40 +02:00
|
|
|
return;
|
c-tree.texi, [...]: Use @smallexample instead of @example.
* doc/c-tree.texi, doc/compat.texi, doc/cpp.texi,
doc/cppopts.texi, doc/extend.texi, doc/install.texi,
doc/interface.texi, doc/invoke.texi, doc/libgcc.texi, doc/md.texi,
doc/objc.texi, doc/rtl.texi, doc/tm.texi, doc/trouble.texi: Use
@smallexample instead of @example.
From-SVN: r76075
2004-01-18 02:20:48 +01:00
|
|
|
@end smallexample
|
1999-09-19 17:50:40 +02:00
|
|
|
|
|
|
|
@item SUBOBJECT
|
|
|
|
|
|
|
|
In a constructor, these nodes are used to mark the point at which a
|
|
|
|
subobject of @code{this} is fully constructed. If, after this point, an
|
Make-lang.in (CXX_SRCS): Add optimize.c.
1999-11-25 Mark Mitchell <mark@codesourcery.com>
* Make-lang.in (CXX_SRCS): Add optimize.c.
* Makefile.in (CXX_OBJS): Add optimize.o.
(CXX_TREE_H): Add splay-tree.h, system.h, and $(CONFIG_H).
(spew.o, lex.o, decl.o, decl2.o, typeck2.o, typeck.o): Adjust.
(class.o, call.o, friend.o, init.o, method.o, cvt.o): Likewise.
(search.o, tree.o, ptree.o, rtti.o, except.o, expr.o): Likewise.
(xref.o, pt.o, error.o, errfn.o, repo.o, semantics.o): Likewise.
(dump.o): Likewise.
(optimize.o): New target.
* class.c: Don't include splay-tree.h.
* cp-tree.def (CTOR_COMPLETE): Rename to CTOR_STMT.
* cp-tree.h: Include splay-tree.h.
(DECL_UNINLINABLE): New macro.
(CTOR_BEGIN_P, CTOR_END_P): New macros.
(flag_inline_trees): New variable.
(local_variable_p): New function.
(nonstatic_local_decl_p): Likewise.
(optimize_function): Likewise.
(cplus_unsave_expr_now): Remove.
(copy_tree_r): Declare.
(remap_save_expr): Likewise.
* decl.c (local_variable_p): Don't
make it static.
(local_variable_p_walkfn): New function.
(make_rtl_for_local_static): Remove code to try to avoid writing
out static constants.
(emit_local_var): Fix indentation.
(nonstatic_local_decl_p): New function.
(check_default_argument): Use local_variable_p_walkfn, not
local_variable_p, when walking the tree.
(start_function): Set the DECL_CONTEXT for automatically generated
labels.
(finish_constructor_body): Use CTOR_STMT to mark the end of a
constructor.
* decl2.c: Don't include splay-tree.h.
(flag_inline_trees): Define.
* dump.c: Don't include
splay-tree.h.
* except.c (expand_end_catch_block): Fix comment formatting.
(expand_end_eh_spec): Set DECL_CONTEXT on temporary variables.
(expand_throw): Tidy comment.
* init.c (build_vec_delete_1): Use create_temporary_var.
* lex.c (cplus_tree_code_type): Make it static.
(cplus_tree_code_length): Likewise.
(cplus_tree_code_name): Likewise.
* optimize.c: New file.
* semantics.c (finish_goto_stmt): Set DECL_UNLINABLE for functions
with computed gotos.
(setup_vtbl_ptr): Mark the beginnings of constructors with
CTOR_STMT.
(expand_stmt): Handle CTOR_STMT, not CTOR_COMPLETE.
(expand_body): Call optimize_function. Save bodies if we're doing
inlining on trees.
* tree.c: Don't include splay-tree.h. Include insn-config.h and
integrate.h.
(copy_tree_r): Make it public.
(statement_code_p): New function.
(mark_local_for_remap_r): Likewise.
(cp_usave_r): Likewise.
(cp_unsave): Likewise.
(build_cplus_new): Set DECL_CONTEXT for temporary variables.
(walk_tree): Walk into `s' class nodes. Walk statement chains.
(copy_tree_r): Handle 's' class nodes. Restore chains for
statements. Nullify scopes. Don't copy types.
(init_tree): Set lang_unsave to cp_unsave.
(remap_save_expr): Define.
* ir.texi: Document CTOR_STMT.
From-SVN: r30669
1999-11-25 21:32:04 +01:00
|
|
|
exception is thrown before a @code{CTOR_STMT} with @code{CTOR_END_P} set
|
|
|
|
is encountered, the @code{SUBOBJECT_CLEANUP} must be executed. The
|
|
|
|
cleanups must be executed in the reverse order in which they appear.
|
1999-09-19 17:50:40 +02:00
|
|
|
|
|
|
|
@item SWITCH_STMT
|
|
|
|
|
tree.h (SWITCH_COND, [...]): Add tree checks.
* tree.h (SWITCH_COND, SWITCH_BODY, SWITCH_LABELS, CASE_LOW,
CASE_HIGH, CASE_LABEL, ASM_STRING, ASM_OUTPUTS, ASM_INPUTS,
ASM_CLOBBERS): Add tree checks.
* c-common.h (SWITCH_TYPE): Rename to SWITCH_STMT_TYPE.
(SWITCH_STMT_COND, SWITCH_STMT_BODY): New.
* c-common.def (SWITCH_STMT): Update to match.
* c-common.c (c_do_switch_warnings): Use SWITCH_STMT accessor
macros instead of SWITCH_EXPR ones.
* c-dump.c (c_dump_tree): Likewise.
* c-gimplify.c (gimplify_switch_stmt): Likewise.
* c-typeck.c (c_start_case, do_case, c_finish_case): Likewise.
cp/
* decl.c (finish_case_label): Use SWITCH_STMT accessor macros
instead of SWITCH_EXPR ones.
* pt.c (tsubst_expr): Likewise.
* semantics.c (begin_switch_stmt, finish_switch_cond,
finish_switch_stmt): Likewise.
doc/
* c-tree.texi (SWITCH_STMT): Update accessor macro names.
From-SVN: r94315
2005-01-27 08:32:26 +01:00
|
|
|
Used to represent a @code{switch} statement. The @code{SWITCH_STMT_COND}
|
|
|
|
is the expression on which the switch is occurring. See the documentation
|
2000-10-23 16:43:33 +02:00
|
|
|
for an @code{IF_STMT} for more information on the representation used
|
tree.h (SWITCH_COND, [...]): Add tree checks.
* tree.h (SWITCH_COND, SWITCH_BODY, SWITCH_LABELS, CASE_LOW,
CASE_HIGH, CASE_LABEL, ASM_STRING, ASM_OUTPUTS, ASM_INPUTS,
ASM_CLOBBERS): Add tree checks.
* c-common.h (SWITCH_TYPE): Rename to SWITCH_STMT_TYPE.
(SWITCH_STMT_COND, SWITCH_STMT_BODY): New.
* c-common.def (SWITCH_STMT): Update to match.
* c-common.c (c_do_switch_warnings): Use SWITCH_STMT accessor
macros instead of SWITCH_EXPR ones.
* c-dump.c (c_dump_tree): Likewise.
* c-gimplify.c (gimplify_switch_stmt): Likewise.
* c-typeck.c (c_start_case, do_case, c_finish_case): Likewise.
cp/
* decl.c (finish_case_label): Use SWITCH_STMT accessor macros
instead of SWITCH_EXPR ones.
* pt.c (tsubst_expr): Likewise.
* semantics.c (begin_switch_stmt, finish_switch_cond,
finish_switch_stmt): Likewise.
doc/
* c-tree.texi (SWITCH_STMT): Update accessor macro names.
From-SVN: r94315
2005-01-27 08:32:26 +01:00
|
|
|
for the condition. The @code{SWITCH_STMT_BODY} is the body of the switch
|
|
|
|
statement. The @code{SWITCH_STMT_TYPE} is the original type of switch
|
2002-02-04 23:05:15 +01:00
|
|
|
expression as given in the source, before any compiler conversions.
|
1999-09-19 17:50:40 +02:00
|
|
|
|
|
|
|
@item TRY_BLOCK
|
|
|
|
Used to represent a @code{try} block. The body of the try block is
|
|
|
|
given by @code{TRY_STMTS}. Each of the catch blocks is a @code{HANDLER}
|
|
|
|
node. The first handler is given by @code{TRY_HANDLERS}. Subsequent
|
|
|
|
handlers are obtained by following the @code{TREE_CHAIN} link from one
|
1999-09-23 04:10:55 +02:00
|
|
|
handler to the next. The body of the handler is given by
|
1999-09-19 17:50:40 +02:00
|
|
|
@code{HANDLER_BODY}.
|
|
|
|
|
|
|
|
If @code{CLEANUP_P} holds of the @code{TRY_BLOCK}, then the
|
|
|
|
@code{TRY_HANDLERS} will not be a @code{HANDLER} node. Instead, it will
|
|
|
|
be an expression that should be executed if an exception is thrown in
|
|
|
|
the try block. It must rethrow the exception after executing that code.
|
|
|
|
And, if an exception is thrown while the expression is executing,
|
|
|
|
@code{terminate} must be called.
|
|
|
|
|
2001-05-01 16:43:17 +02:00
|
|
|
@item USING_STMT
|
2001-06-27 00:47:11 +02:00
|
|
|
Used to represent a @code{using} directive. The namespace is given by
|
c-tree.texi, [...]: Replace . at end of sentences preceded by a capital letter with @..
* doc/c-tree.texi, doc/contrib.texi, doc/cpp.texi,
doc/cppinternals.texi, doc/extend.texi, doc/gcc.texi,
doc/gcov.texi, doc/install-old.texi, doc/install.texi,
doc/invoke.texi, doc/md.texi, doc/rtl.texi, doc/tm.texi: Replace
. at end of sentences preceded by a capital letter with @..
From-SVN: r43611
2001-06-27 17:04:16 +02:00
|
|
|
@code{USING_STMT_NAMESPACE}, which will be a NAMESPACE_DECL@. This node
|
2001-05-01 16:43:17 +02:00
|
|
|
is needed inside template functions, to implement using directives
|
|
|
|
during instantiation.
|
|
|
|
|
1999-09-19 17:50:40 +02:00
|
|
|
@item WHILE_STMT
|
|
|
|
|
|
|
|
Used to represent a @code{while} loop. The @code{WHILE_COND} is the
|
2000-10-23 16:43:33 +02:00
|
|
|
termination condition for the loop. See the documentation for an
|
|
|
|
@code{IF_STMT} for more information on the representation used for the
|
|
|
|
condition.
|
1999-09-19 17:50:40 +02:00
|
|
|
|
|
|
|
The @code{WHILE_BODY} is the body of the loop.
|
|
|
|
|
|
|
|
@end table
|
|
|
|
|
2001-07-09 01:12:31 +02:00
|
|
|
@c ---------------------------------------------------------------------
|
|
|
|
@c Attributes
|
|
|
|
@c ---------------------------------------------------------------------
|
|
|
|
@node Attributes
|
|
|
|
@section Attributes in trees
|
|
|
|
@cindex attributes
|
|
|
|
|
|
|
|
Attributes, as specified using the @code{__attribute__} keyword, are
|
|
|
|
represented internally as a @code{TREE_LIST}. The @code{TREE_PURPOSE}
|
|
|
|
is the name of the attribute, as an @code{IDENTIFIER_NODE}. The
|
|
|
|
@code{TREE_VALUE} is a @code{TREE_LIST} of the arguments of the
|
|
|
|
attribute, if any, or @code{NULL_TREE} if there are no arguments; the
|
|
|
|
arguments are stored as the @code{TREE_VALUE} of successive entries in
|
|
|
|
the list, and may be identifiers or expressions. The @code{TREE_CHAIN}
|
|
|
|
of the attribute is the next attribute in a list of attributes applying
|
|
|
|
to the same declaration or type, or @code{NULL_TREE} if there are no
|
|
|
|
further attributes in the list.
|
|
|
|
|
|
|
|
Attributes may be attached to declarations and to types; these
|
Table-driven attributes.
* c-decl.c, config/alpha/alpha.c, config/arc/arc.c,
config/arm/arm.c, config/arm/pe.c, config/avr/avr.c,
config/avr/avr.h, config/d30v/d30v.h, config/fr30/fr30.h,
config/h8300/h8300.c, config/i386/cygwin.h, config/i386/winnt.c,
config/m32r/m32r.c, config/mcore/mcore.c, config/sh/sh.c,
config/stormy16/stormy16.h, config/v850/v850.c, doc/c-tree.texi,
doc/tm.texi, ggc-common.c, integrate.c, print-tree.c, tree.c,
tree.h: Rename DECL_MACHINE_ATTRIBUTES to DECL_ATTRIBUTES.
* tree.h (struct tree_decl): Change machine_attributes to
attributes.
* doc/c-tree.texi: Document that all attributes are now attached
to decls and types.
* c-common.c (add_attribute, attrtab, attrtab_idx,
default_valid_lang_attribute, valid_lang_attribute): Remove.
(attribute_tables, attributes_initialized,
c_common_attribute_table, default_lang_attribute_table): New
variables.
(handle_packed_attribute, handle_nocommon_attribute,
handle_common_attribute, handle_noreturn_attribute,
handle_unused_attribute, handle_const_attribute,
handle_transparent_union_attribute, handle_constructor_attribute,
handle_destructor_attribute, handle_mode_attribute,
handle_section_attribute, handle_aligned_attribute,
handle_weak_attribute, handle_alias_attribute,
handle_no_instrument_function_attribute,
handle_no_check_memory_usage_attribute, handle_malloc_attribute,
handle_no_limit_stack_attribute, handle_pure_attribute): New
functions.
(init_attributes, decl_attributes): Rewrite to implement
table-driven attributes.
* c-common.h (enum attribute_flags): Move to tree.h.
* c-format.c (decl_handle_format_attribute,
decl_handle_format_arg_attribute): Rename to
handle_format_attribute and handle_format_arg_attribute. Update
for table-driven attributes.
* c-common.h (decl_handle_format_attribute,
decl_handle_format_arg_attribute): Remove prototypes.
(handle_format_attribute, handle_format_arg_attribute): Add
prototypes.
* c-decl.c (grokdeclarator): Handle attributes nested inside
declarators.
* c-parse.in (setattrs, maybe_setattrs): Remove.
(maybe_type_quals_setattrs): Rename to maybe_type_quals_attrs.
Update to handle nested attributes properly.
(maybe_resetattrs, after_type_declarator,
parm_declarator_nostarttypename, notype_declarator, absdcl1_noea,
absdcl1_ea, direct_absdcl1): Update to handle nested attributes
properly.
(make_pointer_declarator): Update to handle nested attributes
properly.
* doc/extend.texi: Update documentation of limits of attributes
syntax. Warn about problems with attribute semantics in C++.
* target.h (struct target): Remove valid_decl_attribute and
valid_type_attribute. Add attribute_table and
function_attribute_inlinable_p.
* target-def.h (TARGET_VALID_DECL_ATTRIBUTE,
TARGET_VALID_TYPE_ATTRIBUTE): Remove.
(TARGET_ATTRIBUTE_TABLE, TARGET_FUNCTION_ATTRIBUTE_INLINABLE_P):
Add.
(TARGET_INITIALIZER): Update.
* integrate.c (FUNCTION_ATTRIBUTE_INLINABLE_P): Remove default
definition.
(function_attribute_inlinable_p): New function. Check for the
presence of any machine attributes before using
targetm.function_attribute_inlinable_p.
(function_cannot_inline_p): Update.
* Makefile.in (integrate.o): Update dependencies.
* doc/tm.texi: Update documentation of target attributes and
example definition of TARGET_VALID_TYPE_ATTRIBUTE.
* tree.c (default_valid_attribute_p, valid_machine_attribute):
Remove.
(default_target_attribute_table,
default_function_attribute_inlinable_p): New.
(lookup_attribute): Update comment to clarify handling of multiple
attributes with the same name.
(merge_attributes, attribute_list_contained): Allow multiple
attributes with the same name but different arguments to appear in
the same attribute list.
* tree.h (default_valid_attribute_p): Remove prototype.
(struct attribute_spec): New.
(default_target_attribute_table): Declare.
(enum attribute_flags): Move from c-common.h. Add
ATTR_FLAG_TYPE_IN_PLACE.
(default_function_attribute_inlinable_p): Declare.
* config/alpha/alpha.c (vms_valid_decl_attribute_p): Remove.
(TARGET_VALID_DECL_ATTRIBUTE): Don't define.
(TARGET_ATTRIBUTE_TABLE): Define.
(vms_attribute_table): New.
* config/arc/arc.c (arc_valid_decl_attribute): Remove.
(TARGET_VALID_DECL_ATTRIBUTE): Don't define.
(TARGET_ATTRIBUTE_TABLE): Define.
(arc_attribute_table, arc_handle_interrupt_attribute): New.
* config/arm/arm.c (arm_valid_type_attribute_p,
arm_valid_decl_attribute_p, arm_pe_valid_decl_attribute_p):
Remove.
(TARGET_VALID_TYPE_ATTRIBUTE, TARGET_VALID_DECL_ATTRIBUTE): Don't
define.
(TARGET_ATTRIBUTE_TABLE): Define.
(arm_attribute_table, arm_handle_fndecl_attribute,
arm_handle_isr_attribute): New.
* config/avr/avr.c (avr_valid_type_attribute,
avr_valid_decl_attribute): Remove.
(TARGET_VALID_DECL_ATTRIBUTE, TARGET_VALID_TYPE_ATTRIBUTE): Don't
define.
(TARGET_ATTRIBUTE_TABLE): Define.
(avr_attribute_table, avr_handle_progmem_attribute,
avr_handle_fndecl_attribute): New.
* config/c4x/c4x.c (c4x_valid_type_attribute_p): Remove.
(TARGET_VALID_TYPE_ATTRIBUTE): Don't define.
(TARGET_ATTRIBUTE_TABLE): Define.
(c4x_attribute_table, c4x_handle_fntype_attribute): New.
* config/h8300/h8300.c (h8300_valid_decl_attribute): Remove.
(TARGET_VALID_DECL_ATTRIBUTE): Don't define.
(TARGET_ATTRIBUTE_TABLE): Define.
(h8300_attribute_table, h8300_handle_fndecl_attribute,
h8300_handle_eightbit_data_attribute,
h8300_handle_tiny_data_attribute): New.
* config/i386/i386-protos.h (ix86_valid_type_attribute_p,
i386_pe_valid_decl_attribute_p, i386_pe_valid_type_attribute_p):
Remove prototypes.
(ix86_handle_dll_attribute, ix86_handle_shared_attribute): New
declarations.
* config/i386/i386.c (ix86_valid_type_attribute_p: Remove.
(TARGET_VALID_TYPE_ATTRIBUTE, TARGET_VALID_DECL_ATTRIBUTE): Don't
define.
(TARGET_ATTRIBUTE_TABLE): Define.
(ix86_attribute_table, ix86_handle_cdecl_attribute,
ix86_handle_regparm_attribute): New.
* config/i386/winnt.c (i386_pe_valid_decl_attribute_p,
i386_pe_valid_type_attribute_p): Remove.
(ix86_handle_dll_attribute, ix86_handle_shared_attribute): New.
* config/ia64/ia64.c (ia64_valid_type_attribute): Remove.
(TARGET_VALID_TYPE_ATTRIBUTE): Don't define.
(TARGET_ATTRIBUTE_TABLE): Define.
(ia64_attribute_table): New.
* config/m32r/m32r.c (m32r_valid_decl_attribute, interrupt_ident1,
interrupt_ident2, model_ident1, model_ident2): Remove.
(TARGET_VALID_DECL_ATTRIBUTE): Don't define.
(TARGET_ATTRIBUTE_TABLE): Define.
(init_idents): Update.
(m32r_attribute_table, m32r_handle_model_attribute): New.
* config/m68hc11/m68hc11.c (m68hc11_valid_type_attribute_p):
Remove.
(TARGET_VALID_TYPE_ATTRIBUTE): Don't define.
(TARGET_ATTRIBUTE_TABLE): Define.
(m68hc11_attribute_table, m68hc11_handle_fntype_attribute): New.
* config/mcore/mcore.c (mcore_valid_decl_attribute): Remove.
(TARGET_VALID_DECL_ATTRIBUTE): Don't define.
(TARGET_ATTRIBUTE_TABLE): Define.
(mcore_attribute_table, mcore_handle_naked_attribute): New.
* config/ns32k/ns32k.c (ns32k_valid_type_attribute_p): Remove.
(TARGET_VALID_TYPE_ATTRIBUTE): Don't define.
(TARGET_ATTRIBUTE_TABLE): Define.
(ns32k_attribute_table, ns32k_handle_fntype_attribute): New.
* config/rs6000/rs6000.c (rs6000_valid_type_attribute_p): Remove.
(TARGET_VALID_TYPE_ATTRIBUTE): Don't define.
(TARGET_ATTRIBUTE_TABLE): Define.
(rs6000_attribute_table, rs6000_handle_longcall_attribute): New.
* config/sh/sh.c (sh_valid_decl_attribute): Remove.
(TARGET_VALID_DECL_ATTRIBUTE): Don't define.
(TARGET_ATTRIBUTE_TABLE): Define.
(sh_attribute_table, sh_handle_interrupt_handler_attribute,
sh_handle_sp_switch_attribute, sh_handle_trap_exit_attribute):
New.
* config/stormy16/stormy16.c (stormy16_valid_type_attribute):
Remove.
(TARGET_VALID_TYPE_ATTRIBUTE): Don't define
(TARGET_ATTRIBUTE_TABLE): Define.
(stormy16_attribute_table, stormy16_handle_interrupt_attribute):
New.
* config/v850/v850.c (v850_valid_decl_attribute): Remove.
(TARGET_VALID_DECL_ATTRIBUTE): Don't define.
(TARGET_ATTRIBUTE_TABLE): Define.
(v850_attribute_table, v850_handle_interrupt_attribute,
v850_handle_data_area_attribute): New.
* config/v850/v850-c.c (mark_current_function_as_interrupt):
Return void. Call decl_attributes instead of
valid_machine_attribute.
cp:
Table-driven attributes.
* decl.c: Rename DECL_MACHINE_ATTRIBUTES to DECL_ATTRIBUTES.
* decl2.c (cplus_decl_attributes): Only take one attributes
parameter.
* cp-tree.c (cplus_decl_attributes): Update prototype.
* class.c (finish_struct), decl.c (start_decl, start_function),
decl2.c (grokfield), friend.c (do_friend), parse.y
(parse_bitfield): Update calls to cplus_decl_attributes.
* decl.c (grokdeclarator): Take a pointer to a single ordinary
attribute list.
* decl.h (grokdeclarator): Update prototype.
* decl2.c (grokfield): Take a single ordinary attribute list.
* friend.c (do_friend): Likewise.
* decl.c (shadow_tag, groktypename, start_decl,
start_handler_parms, grokdeclarator, grokparms, start_function,
start_method), decl2.c (grokfield, grokbitfield, grokoptypename),
parse.y (parse_field, parse_bitfield, component_decl_1), pt.c
(process_template_parm, do_decl_instantiation): Pass single
ordinary attribute lists around.
* decl.c (grokdeclarator): Correct handling of nested attributes.
Revert the patch
1998-10-18 Jason Merrill <jason@yorick.cygnus.com>
* decl.c (grokdeclarator): Embedded attrs bind to the right,
not the left.
.
* cp-tree.h (cp_valid_lang_attribute): Remove declaration
(cp_attribute_table): Declare.
* decl.c (valid_lang_attribute): Don't define.
(lang_attribute_table): Define.
(init_decl_processing): Initialize lang_attribute_table instead of
valid_lang_attribute.
* tree.c (cp_valid_lang_attribute): Remove.
(handle_java_interface_attribute, handle_com_interface_attribute,
handle_init_priority_attribute): New functions.
(cp_attribute_table): New array.
* decl2.c (import_export_class): Don't use
targetm.valid_type_attribute.
testsuite:
Table-driven attributes.
* g++.dg/ext/attrib1.C: New test.
From-SVN: r45718
2001-09-21 03:27:06 +02:00
|
|
|
attributes may be accessed with the following macros. All attributes
|
|
|
|
are stored in this way, and many also cause other changes to the
|
|
|
|
declaration or type or to other internal compiler data structures.
|
|
|
|
|
|
|
|
@deftypefn {Tree Macro} tree DECL_ATTRIBUTES (tree @var{decl})
|
2001-07-09 01:12:31 +02:00
|
|
|
This macro returns the attributes on the declaration @var{decl}.
|
|
|
|
@end deftypefn
|
|
|
|
|
|
|
|
@deftypefn {Tree Macro} tree TYPE_ATTRIBUTES (tree @var{type})
|
|
|
|
This macro returns the attributes on the type @var{type}.
|
|
|
|
@end deftypefn
|
|
|
|
|
1999-09-19 17:50:40 +02:00
|
|
|
@c ---------------------------------------------------------------------
|
|
|
|
@c Expressions
|
|
|
|
@c ---------------------------------------------------------------------
|
|
|
|
|
2001-05-27 19:09:47 +02:00
|
|
|
@node Expression trees
|
|
|
|
@section Expressions
|
1999-09-19 17:50:40 +02:00
|
|
|
@cindex expression
|
2004-05-31 00:20:07 +02:00
|
|
|
@findex TREE_TYPE
|
1999-09-19 17:50:40 +02:00
|
|
|
@findex TREE_OPERAND
|
|
|
|
@tindex INTEGER_CST
|
|
|
|
@findex TREE_INT_CST_HIGH
|
|
|
|
@findex TREE_INT_CST_LOW
|
|
|
|
@findex tree_int_cst_lt
|
|
|
|
@findex tree_int_cst_equal
|
|
|
|
@tindex REAL_CST
|
2000-04-22 14:01:30 +02:00
|
|
|
@tindex COMPLEX_CST
|
2002-02-19 03:53:41 +01:00
|
|
|
@tindex VECTOR_CST
|
1999-09-19 17:50:40 +02:00
|
|
|
@tindex STRING_CST
|
|
|
|
@findex TREE_STRING_LENGTH
|
|
|
|
@findex TREE_STRING_POINTER
|
|
|
|
@tindex PTRMEM_CST
|
|
|
|
@findex PTRMEM_CST_CLASS
|
|
|
|
@findex PTRMEM_CST_MEMBER
|
|
|
|
@tindex VAR_DECL
|
|
|
|
@tindex NEGATE_EXPR
|
2003-08-12 03:45:23 +02:00
|
|
|
@tindex ABS_EXPR
|
1999-09-19 17:50:40 +02:00
|
|
|
@tindex BIT_NOT_EXPR
|
|
|
|
@tindex TRUTH_NOT_EXPR
|
2004-05-31 00:20:07 +02:00
|
|
|
@tindex PREDECREMENT_EXPR
|
|
|
|
@tindex PREINCREMENT_EXPR
|
|
|
|
@tindex POSTDECREMENT_EXPR
|
|
|
|
@tindex POSTINCREMENT_EXPR
|
1999-09-19 17:50:40 +02:00
|
|
|
@tindex ADDR_EXPR
|
|
|
|
@tindex INDIRECT_REF
|
|
|
|
@tindex FIX_TRUNC_EXPR
|
|
|
|
@tindex FLOAT_EXPR
|
2000-04-22 14:01:30 +02:00
|
|
|
@tindex COMPLEX_EXPR
|
|
|
|
@tindex CONJ_EXPR
|
|
|
|
@tindex REALPART_EXPR
|
|
|
|
@tindex IMAGPART_EXPR
|
2004-05-31 00:20:07 +02:00
|
|
|
@tindex NON_LVALUE_EXPR
|
1999-09-19 17:50:40 +02:00
|
|
|
@tindex NOP_EXPR
|
|
|
|
@tindex CONVERT_EXPR
|
|
|
|
@tindex THROW_EXPR
|
|
|
|
@tindex LSHIFT_EXPR
|
|
|
|
@tindex RSHIFT_EXPR
|
|
|
|
@tindex BIT_IOR_EXPR
|
|
|
|
@tindex BIT_XOR_EXPR
|
|
|
|
@tindex BIT_AND_EXPR
|
|
|
|
@tindex TRUTH_ANDIF_EXPR
|
|
|
|
@tindex TRUTH_ORIF_EXPR
|
|
|
|
@tindex TRUTH_AND_EXPR
|
|
|
|
@tindex TRUTH_OR_EXPR
|
|
|
|
@tindex TRUTH_XOR_EXPR
|
[multiple changes]
2007-06-15 Andrew Pinski <andrew_pinski@playstation.sony.com>
Zdenek Dvorak <dvorakz@suse.cz>
Richard Guenther <rguenther@suse.de>
Kaz Kojima <kkojima@gcc.gnu.org>
* tree-vrp.c (compare_values_warnv): Convert val2 to
the type of val1.
(extract_range_from_assert): Create
POINTER_PLUS_EXPR for pointer types.
(extract_range_from_binary_expr): Handle
only POINTER_PLUS_EXPR, MIN_EXPR, and MAX_EXPR
for pointer types.
* doc/c-tree.texi (POINTER_PLUS_EXPR): Document.
* tree-ssa-loop-niter.c (split_to_var_and_offset): Handle
POINTER_PLUS_EXPR as PLUS_EXPR.
(number_of_iterations_lt_to_ne):
For pointer types, use sizetype when
creating MINUS_EXPR/PLUS_EXPRs.
(assert_loop_rolls_lt): For pointer types, use sizetype when
creating MINUS_EXPR/PLUS_EXPRs.
(number_of_iterations_le): Likewise.
(expand_simple_operations): POINTER_PLUS_EXPR are simple also.
(derive_constant_upper_bound): Handle POINTER_PLUS_EXPR just
like PLUS_EXPR and MINUS_EXPR.
* tree-pretty-print.c (dump_generic_node): Handle
POINTER_PLUS_EXPR.
(op_prio): Likewise.
(op_symbol_1): Likewise.
* optabs.c (optab_for_tree_code): Likewise.
* tree-ssa-loop-manip.c (create_iv): Handle pointer base
specially.
* tree-tailcall.c (process_assignment): Mention
POINTER_PLUS_EXPR in a TODO comment.
* tree.c (build2_stat): Assert when trying to use PLUS_EXPR or
MINUS_EXPR with a pointer. Also assert for POINTER_PLUS_EXPR
not used with a pointer and an integer type.
* tree-scalar-evolution.c (add_to_evolution_1): Convert the
increment using chrec_convert_rhs instead of chrec_convert.
(follow_ssa_edge_in_rhs): Handle POINTER_PLUS_EXPR like
PLUS_EXPR except for the right hand side's type will be
sizetype.
(interpret_rhs_modify_stmt): Handle POINTER_PLUS_EXPR.
(fold_used_pointer_cast): Kill.
(pointer_offset_p): Kill.
(fold_used_pointer): Kill.
(pointer_used_p): Kill.
(analyze_scalar_evolution_1 <case GIMPLE_MODIFY_STMT>): Don't
call fold_used_pointer.
(instantiate_parameters_1): Convert the increment
using chrec_convert_rhs instead of chrec_convert.
Handle POINTER_PLUS_EXPR as PLUS_EXPR.
* builtins.c (get_pointer_alignment): Handle POINTER_PLUS_EXPR
instead of PLUS_EXPR.
(expand_builtin_strcat): Create a POINTER_PLUS_EXPR instead of
PLUS_EXPR for pointers.
(std_gimplify_va_arg_expr): Likewise.
(fold_builtin_memory_op): Likewise.
(fold_builtin_strstr): Likewise.
(fold_builtin_strchr): Likewise.
(fold_builtin_strrchr): Likewise.
(fold_builtin_strpbrk): Likewise.
(expand_builtin_memory_chk): Likewise.
(fold_builtin_memory_chk): Likewise.
(std_expand_builtin_va_start): Use
sizetype for the call to make_tree and then convert
to the pointer type.
(fold_builtin_memchr): Use POINTER_PLUS_EXPR
instead of PLUS_EXPR for adding to a pointer.
(std_gimplify_va_arg_expr): Use fold_build2 for
the creating of POINTER_PLUS_EXPR. For the BIT_AND_EXPR, cast
the operands to sizetype first and then cast the BIT_AND_EXPR
back to the pointer type.
* fold-const.c (build_range_check): Handle pointer types
specially.
(extract_array_ref): Look for POINTER_PLUS_EXPR instead
of PLUS_EXPR's. Make sure the offset is converted to
sizetype.
(try_move_mult_to_index): Strip the NOPs from the offset.
Remove code argument and replace all uses with PLUS_EXPR.
(fold_to_nonsharp_ineq_using_bound): Handle pointer types
specially. Don't use a pointer type for MINUS_EXPR.
(fold_unary): Handle for (T1)(X op Y),
only p+ as that is the only as that can be handled for
binary operators now.
(fold_binary <case POINTER_PLUS_EXPR>): Add folding of
POINTER_PLUS_EXPR.
<case PLUS_EXPR>: Add folding of PTR+INT into
PTR p+ INT.
Don't call try_move_mult_to_index.
<case MINUS_EXPR>: Fold (PTR0 p+ A) - (PTR1 p+ B)
into (PTR0 - PTR1) + (A - B). Fold (PTR0 p+ A) - PTR1 into
(PTR0 - PTR1) + A iff (PTR0 - PTR1) simplifies.
Don't call try_move_mult_to_index.
(tree_expr_nonnegative_warnv_p): Handle POINTER_PLUS_EXPR.
(tree_expr_nonzero_p): Likewise.
(fold_indirect_ref_1): Look at POINTER_PLUS_EXPR instead
of PLUS_EXPR for the complex expression folding.
* tree-chrec.c (chrec_fold_plus_poly_poly): If the
first chrec is a pointer type, then the second should
be sizetype and not the first's type.
For POINTER_PLUS_EXPR, use a different right hand side type.
Handle POINTER_PLUS_EXPR like PLUS_EXPR.
(chrec_fold_plus_1): For POINTER_PLUS_EXPR, use a
different right hand side type.
Handle POINTER_PLUS_EXPR like PLUS_EXPR.
(chrec_fold_plus): For pointer types, use POINTER_PLUS_EXPR
instead of PLUS_EXPR.
When either operand is zero, convert the other operand.
(chrec_apply): Use chrec_convert_rhs
on the argument x instead of chrec_convert.
(reset_evolution_in_loop): For pointer types, the new_evol
should be sizetype.
(convert_affine_scev): For POINTER_PLUS_EXPR, use a
different right hand side type.
Handle POINTER_PLUS_EXPR like PLUS_EXPR.
(chrec_convert_rhs): New function.
(chrec_convert_aggressive): For POINTER_PLUS_EXPR, use a
different right hand side type.
Handle POINTER_PLUS_EXPR like PLUS_EXPR.
* tree-chrec.h (chrec_convert_rhs): New prototype.
(build_polynomial_chrec): For pointer types, the right hand
* tree-ssa-ccp.c (maybe_fold_stmt_indirect): Look for
POINTER_PLUS_EXPR instead of PLUS_EXPR's.
Remove subtraction case as it is always addition now.
Make sure the offset is converted to sizetype.
(fold_stmt_r): Don't handle PLUS_EXPR/MINUS_EXPR specially.
Handle POINTER_PLUS_EXPR like PLUS_EXPR was handled before.
* tree-ssa-loop-ivopts.c (determine_base_object): Abort for
PLUS_EXPR in pointer type.
Handle POINTER_PLUS_EXPR.
(tree_to_aff_combination): Likewise.
(force_expr_to_var_cost): Likewise.
(force_expr_to_var_cost): Likewise. Create a POINTER_PLUS_EXPR
instead of PLUS_EXPR for pointers.
* c-format.c (check_format_arg): Handle POINTER_PLUS_EXPR
instead of PLUS_EXPR of pointer types.
* tree-stdarg.c (va_list_counter_bump): Handle POINTER_PLUS_EXPR
as PLUS_EXPR.
(check_va_list_escapes): Likewise.
(check_all_va_list_escapes): Likewise.
* dwarf2out.c (loc_descriptor_from_tree_1):
Handle POINT_PLUS_EXPR as a PLUS_EXPR.
* expr.c (expand_expr_real_1): Handle POINTER_PLUS_EXPR.
(string_constant): Likewise.
* tree-ssa-address.c (tree_mem_ref_addr): When adding
the offset to the base, use POINTER_PLUS_EXPR.
(add_to_parts): Convert the index to sizetype.
(create_mem_ref): Create A POINTER_PLUS_EXPR for the one case.
* matrix-reorg.c (collect_data_for_malloc_call): Stmt
will now only be either INDIRECT_REF and POINTER_PLUS_EXPR.
Offset only holds something for PLUS_EXPR.
(ssa_accessed_in_tree): Handle POINTER_PLUS_EXPR just as
a PLUS_EXPR.
(analyze_transpose): POINTER_PLUS_EXPR will only show up now
and not PLUS_EXPR.
(analyze_accesses_for_modify_stmt): Likewise.
Remove comment about the type being integral type as it is
wrong now.
(can_calculate_expr_before_stmt): Handle POINTER_PLUS_EXPR as
PLUS_EXPR.
(transform_access_sites): POINTER_PLUS_EXPR will only show up now
and not PLUS_EXPR.
Correct the type which the artimentic is done in (is now
sizetype).
Reindent one loop.
* tree-data-ref.c (split_constant_offset): Handle
POINTER_PLUS_EXPR
* tree-affine.c (tree_to_aff_combination): Likewise.
* c-typeck.c (build_unary_op): For pointers create the increment
as a sizetype. Create a POINTER_PLUS_EXPR instead of PLUS_EXPR
for pointers.
* gimplify.c (gimplify_self_mod_expr): Create a
POINTER_PLUS_EXPR instead of PLUS_EXPR for pointers.
(gimplify_omp_atomic_fetch_op): Handle POINTER_PLUS_EXPR.
* tree.def (POINTER_PLUS_EXPR): New tree code.
* tree-predcom.c (ref_at_iteration): If we have a pointer
type do the multiplication in sizetype.
* tree-mudflap.c (mf_xform_derefs_1): Create a
POINTER_PLUS_EXPR instead of PLUS_EXPR for pointers.
* tree-ssa-forwprop.c
(forward_propagate_addr_into_variable_array_index):
Don't expect there to be a cast for the index as that
does not exist anymore.
(forward_propagate_addr_expr_1): Check for POINTER_PLUS_EXPR
instead of PLUS_EXPR.
Don't check for the first operand of the POINTER_PLUS_EXPR
was the index as it cannot be.
Call forward_propagate_addr_into_variable_array_index with
the SSA_NAME instead of the statement.
* varasm.c (const_hash_1): Handle POINTER_PLUS_EXPR.
(compare_constant): Likewise.
(copy_constant): Likewise.
(compute_reloc_for_constant): Likewise.
(output_addressed_constants): Likewise.
(initializer_constant_valid_p): Likewise.
* tree-ssa.c (tree_ssa_useless_type_conversion_1):
Convert the MIN/MAX of the inner type to the outer
type before comparing them.
* tree-ssa-loop-prefetch.c (idx_analyze_ref): Handle
POINTER_PLUS_EXPR instead of PLUS_EXPR.
(issue_prefetch_ref): Create a POINTER_PLUS_EXPR instead
of PLUS_EXPR for pointers.
* tree-inline.c (estimate_num_insns_1): Handle
POINTER_PLUS_EXPR.
* tree-vect-transform.c (vect_create_addr_base_for_vector_ref):
Create a POINTER_PLUS_EXPR instead of PLUS_EXPR for pointers.
(bump_vector_ptr): Create a POINTER_PLUS_EXPR
instead of PLUS_EXPR for the pointer increment statement.
(vect_update_ivs_after_vectorizer): For pointer types, create
POINTER_PLUS_EXPR instead of PLUS_EXPR and also create
MULT_EXPR in sizetype.
(vect_gen_niters_for_prolog_loop): Add a cast when creating
byte_misalign.
* tree-object-size.c (plus_expr_object_size): Handle
POINTER_PLUS_EXPR instead of PLUS_EXPR. Removing all the extra
code which is trying to figure out which side is a pointer and
is the index.
(check_for_plus_in_loops_1): Likewise.
(check_for_plus_in_loops): Likewise.
* c-common.c (pointer_int_sum): Create a
POINTER_PLUS_EXPR instead of PLUS_EXPR for pointers.
* tree-ssa-structalias.c (handle_ptr_arith): Handle
only POINTER_PLUS_EXPR. Removing all the extra
code which is trying to figure out which side is a pointer and
is the index.
* tree-cfg.c (verify_expr): Add extra checking for pointers and
PLUS_EXPR and MINUS_EXPR.
Also add checking to make sure the operands of POINTER_PLUS_EXPR
are correct.
* config/frv/frv.c (frv_expand_builtin_va_start): Use sizetype
with make_tree, instead of a pointer type.
* config/s390/s390.c (s390_va_start): Use POINTER_PLUS_EXPR
for pointers instead of PLUS_EXPR.
(s390_gimplify_va_arg): Likewise.
* config/spu/spu.c (spu_va_start): Create POINTER_PLUS_EXPR
instead of PLUS_EXPR when doing addition on pointer
types. Use sizetype for the second operand.
(spu_gimplify_va_arg_expr): Likewise.
* config/sparc/sparc.c (sparc_gimplify_va_arg): Use
POINTER_PLUS_EXPR instead of PLUS_EXPR when the operand was
a pointer. Don't create a BIT_AND_EXPR for pointer types.
* config/i386/i386.c (ix86_va_start): Use POINTER_PLUS_EXPR
for the pointer addition and also use size_int/sizetype
for the offset.
(ix86_gimplify_va_arg): Likewise.
Perform BIT_AND_EXPR on sizetype arguments.
* config/sh/sh.c (sh_va_start): Call make_tree with sizetype
and convert its result to a pointer type. Use POINTER_PLUS_EXPR
for the pointer additions and also use size_int for the offsets.
(sh_gimplify_va_arg_expr): Use POINTER_PLUS_EXPR for the pointer
additions and also use size_int for the offsets. Perform
BIT_AND_EXPR on sizetype arguments.
* config/ia64/ia64.c (ia64_gimplify_va_arg): Use
POINTER_PLUS_EXPR for pointers and create the
BIT_AND_EXPR in sizetype.
* config/rs6000/rs6000.c (rs6000_va_start): Use POINTER_PLUS_EXPR
instead of PLUS_EXPR for pointer addition.
(rs6000_va_start): Likewise.
Also use sizetype for the offset.
* config/pa/pa.c (reloc_needed): Handle POINTER_PLUS_EXPR
as PLUS_EXPR/MINUS_EXPR.
(hppa_gimplify_va_arg_expr): Don't create MINUS_EXPR or
PLUS_EXPR for pointers, instead use POINTER_PLUS_EXPR.
Don't use BIT_AND_EXPR on a pointer type, convert the
expression to sizetype first.
* config/mips/mips.c (mips_va_start): Use POINTER_PLUS_EXPR
for pointers.
(mips_gimplify_va_arg_expr): Likewise.
Don't create BIT_AND_EXPR in a pointer type.
2007-06-15 Andrew Pinski <andrew_pinski@playstation.sony.com>
* trans-intrinsic.c (gfc_conv_intrinsic_repeat): Use
POINTER_PLUS_EXPR instead of PLUS_EXPR for pointer addition.
* trans-expr.c (gfc_trans_string_copy): Create
POINTER_PLUS_EXPR instead of a PLUS_EXPR
for pointer types.
2007-06-15 Andrew Pinski <andrew_pinski@playstation.sony.com>
* typeck.c (build_binary_op): For templates build the
expression in pieces to avoid the assert in build2_stat.
(get_member_function_from_ptrfunc):
Change over to using POINTER_PLUS_EXPR and convert
the second operand to sizetype.
* typeck2.c (build_m_component_ref): Likewise.
* init.c (expand_virtual_init): Create a POINTER_PLUS_EXPR
instead of PLUS_EXPR for pointers.
(build_new_1): Likewise.
(build_vec_delete_1): Likewise.
(build_vec_delete): Likewise.
* class.c (build_base_path): Likewise.
(build_base_path): Likewise.
(convert_to_base_statically): Likewise.
(fixed_type_or_null): Handle POINTER_PLUS_EXPR.
(get_vtbl_decl_for_binfo): Handle POINTER_PLUS_EXPR
instead of PLUS_EXPR.
(dfs_accumulate_vtbl_inits): Create a POINTER_PLUS_EXPR
instead of PLUS_EXPR for pointers.
* call.c (build_special_member_call): Likewise.
* rtti.c (build_headof): Likewise.
Use sizetype instead of ptrdiff_type_node.
(tinfo_base_init): Create a POINTER_PLUS_EXPR
instead of PLUS_EXPR for pointers.
* except.c (expand_start_catch_block): Do a
NEGATIVE and then a POINTER_PLUS_EXPR instead
of a MINUS_EXPR.
* cp-gimplify.c (cxx_omp_clause_apply_fn): Convert
PLUS_EXPR on pointer types over to use
POINTER_PLUS_EXPR and remove the conversion
to the pointer types.
* method.c (thunk_adjust): Use POINTER_PLUS_EXPR for
adding to a pointer type. Use size_int instead of
ssize_int. Convert the index to sizetype before
adding it to the pointer.
2007-06-15 Andrew Pinski <andrew_pinski@playstation.sony.com>
* trans.c (Attribute_to_gnu): When subtracting an
offset from a pointer, use POINTER_PLUS_EXPR with
NEGATE_EXPR instead of MINUS_EXPR.
(gnat_to_gnu): Likewise.
* utils.c (convert): When converting between
thin pointers, use POINTER_PLUS_EXPR and sizetype
for the offset.
* utils2.c (known_alignment): POINTER_PLUS_EXPR
have the same semantics as PLUS_EXPR for alignment.
(build_binary_op): Add support for the semantics of
POINTER_PLUS_EXPR's operands.
When adding an offset to a pointer, use POINTER_PLUS_EXPR.
2007-06-15 Andrew Pinski <andrew_pinski@playstation.sony.com>
* class.c (make_class_data): Build the index in sizetype.
Use POINTER_PLUS_EXPR instead of PLUS_EXPR when
adding to a pointer type.
(build_symbol_entry): Likewise.
* expr.c (build_java_arrayaccess): Likewise.
(build_field_ref): Likewise.
(build_known_method_ref): Likewise.
(build_invokevirtual): Likewise.
* except.c (build_exception_object_ref): Do a
NEGATIVE and then a POINTER_PLUS_EXPR instead
of a MINUS_EXPR.
2007-06-15 Andrew Pinski <andrew_pinski@playstation.sony.com>
PR tree-opt/32225
* gcc.c-torture/compile/20070605-1.c: New test.
* gcc.c-torture/compile/20070603-1.c: New testcase.
* gcc.c-torture/compile/20070603-2.c: New testcase.
* gcc.c-torture/compile/20070531-1.c: New test.
PR tree-opt/32167
* gcc.c-torture/compile/20070531-2.c: New test.
PR tree-opt/32144
* gcc.c-torture/compile/20070529-1.c: New test.
PR tree-opt/32145
* gcc.c-torture/compile/20070529-2.c: New test.
PR tree-opt/32015
* gcc.c-torture/compile/20070520-1.c: New test.
* g++.dg/ext/java-1.C: New test.
* gcc.dg/vect/vect-106.c: We are now able to vectorize two
loops instead of one. Remove the "can't determine dependence"
check.
* gcc.dg/tree-ssa/20030815-1.c: Remove testcase which is no longer
needed as the cast is gone in the first place.
* gcc.dg/max-1.c: Change local variable a to be a global one.
* gcc.dg/tree-ssa/ssa-pre-8.c: Update testcase since we don't
have a cast which is PREd.
From-SVN: r125755
2007-06-16 07:42:36 +02:00
|
|
|
@tindex POINTER_PLUS_EXPR
|
1999-09-19 17:50:40 +02:00
|
|
|
@tindex PLUS_EXPR
|
|
|
|
@tindex MINUS_EXPR
|
|
|
|
@tindex MULT_EXPR
|
2004-05-31 00:20:07 +02:00
|
|
|
@tindex RDIV_EXPR
|
1999-09-19 17:50:40 +02:00
|
|
|
@tindex TRUNC_DIV_EXPR
|
2004-05-31 00:20:07 +02:00
|
|
|
@tindex FLOOR_DIV_EXPR
|
|
|
|
@tindex CEIL_DIV_EXPR
|
|
|
|
@tindex ROUND_DIV_EXPR
|
1999-09-19 17:50:40 +02:00
|
|
|
@tindex TRUNC_MOD_EXPR
|
2004-05-31 00:20:07 +02:00
|
|
|
@tindex FLOOR_MOD_EXPR
|
|
|
|
@tindex CEIL_MOD_EXPR
|
|
|
|
@tindex ROUND_MOD_EXPR
|
|
|
|
@tindex EXACT_DIV_EXPR
|
|
|
|
@tindex ARRAY_REF
|
|
|
|
@tindex ARRAY_RANGE_REF
|
tree-ssa-address.c: New file.
* tree-ssa-address.c: New file.
* Makefile.in (tree-ssa-address.o): Add.
* expr.c (expand_expr_real_1): Do not handle REF_ORIGINAL on
INDIRECT_REFs. Handle TARGET_MEM_REFs.
* tree-eh.c (tree_could_trap_p): Handle TARGET_MEM_REFs.
* tree-flow.h (struct mem_address): New.
(struct affine_tree_combination): Moved from tree-ssa-loop-ivopts.c.
(create_mem_ref, addr_for_mem_ref, get_address_description,
maybe_fold_tmr, multiplier_allowed_in_address_p,
multiply_by_cost): Declare.
* tree-mudflap.c (mf_xform_derefs_1): Handle TARGET_MEM_REFs.
* tree-pretty-print.c (dump_generic_node): Ditto.
* tree-ssa-loop-im.c (for_each_index): Ditto.
* tree-ssa-loop-ivopts.c (may_be_unaligned_p,
find_interesting_uses_address): Ditto.
(rewrite_address_base, build_addr_strip_iref): Removed.
(struct affine_tree_combination): Moved to tree-flow.h.
(get_ref_tag, copy_ref_info): New functions.
(rewrite_use_address): Produce TARGET_MEM_REFs.
(tree_ssa_iv_optimize): Do not call update_ssa
and rewrite_into_loop_closed_ssa.
(tree_to_aff_combination): Use build_fold_addr_expr instead of
build_addr_strip_iref.
(unshare_aff_combination): New function.
(fold_affine_sum): Removed.
(get_computation_at): Use get_computation_aff. Unshare the result.
(get_computation_aff, multiplier_allowed_in_address_p): New function.
(multiply_by_cost): Exported.
(get_address_cost): Use multiplier_allowed_in_address_p.
* tree-ssa-operands.c (get_tmr_operands): New function.
(get_expr_operands): Handle TARGET_MEM_REFs.
* tree.c (copy_node_stat): Copy annotations for TARGET_MEM_REFs.
(build): Handle 7 arguments.
(build7_stat): New function.
* tree.def (TARGET_MEM_DEF): New.
* tree.h (REF_ORIGINAL): Removed.
(TMR_SYMBOL, TMR_BASE, TMR_INDEX, TMR_STEP, TMR_OFFSET, TMR_ORIGINAL,
TMR_TAG, build7): New macros.
(build7_stat, tree_mem_ref_addr, copy_mem_ref_info): Declare.
* tree-ssa-ccp.c (fold_stmt_r): Call maybe_fold_tmr.
* doc/c-tree.texi: Document TARGET_MEM_REF.
* doc/tree-ssa.texi: Add TARGET_MEM_REF to gimple grammar.
* gcc.dg/tree-ssa/loop-2.c: Update outcome.
* gcc.dg/tree-ssa/loop-3.c: Update outcome.
* gcc.dg/tree-ssa/loop-4.c: Update outcome.
* gcc.dg/tree-ssa/loop-9.c: New test.
From-SVN: r100708
2005-06-07 14:01:47 +02:00
|
|
|
@tindex TARGET_MEM_REF
|
1999-09-19 17:50:40 +02:00
|
|
|
@tindex LT_EXPR
|
|
|
|
@tindex LE_EXPR
|
|
|
|
@tindex GT_EXPR
|
|
|
|
@tindex GE_EXPR
|
|
|
|
@tindex EQ_EXPR
|
|
|
|
@tindex NE_EXPR
|
2004-05-31 00:20:07 +02:00
|
|
|
@tindex ORDERED_EXPR
|
|
|
|
@tindex UNORDERED_EXPR
|
re PR rtl-optimization/15649 (ICE with __builtin_isgreater and -ffast-math)
gcc/ChangeLog:
2004-05-27 Paolo Bonzini <bonzini@gnu.org>
Roger Sayle <roger@eyesopen.com>
PR rtl-optimization/15649
Add LTGT_EXPR and improve pretty-printing of unordered
comparisons.
* c-common.c (c_common_truthvalue_conversion):
Handle LTGT_EXPR.
* c-typeck.c (build_binary_op): Likewise.
* dojump.c (do_jump): Likewise.
* expr.c (expand_expr_real_1, do_store_flag): Likewise.
* predict.c (tree_predict_by_opcode): Likewise.
* real.c (real_compare): Likewise.
* tree-cfg.c (verify_expr): Likewise.
* tree-inline.c (estimate_num_insns_1): Likewise.
* tree-pretty-print.c (dump_generic_node): Likewise.
Handle ORDERED_EXPR, UNORDERED_EXPR.
(op_symbol): Print unordered comparisons differently
than ordered ones.
* tree.def (LTGT_EXPR): New '<' tree code.
* doc/c-tree.texi (Expressions): Document floating-point
comparison nodes.
Fold comparisons between floating point values.
* fold-const.c (enum comparison_code): New, from
#define'd constants. Define compcodes for unordered
comparisons and for invalid transformations.
(invert_tree_comparison): Add "honor_nans" parameter.
(fold_truthop): Revamp to work on floating-point types too.
(comparison_to_compcode): Support unordered comparisons.
Use new enum comparison_code.
(compcode_to_comparison): Likewise.
(combine_compcodes): New function.
(invert_truthvalue): Let invert_tree_comparison decide
whether it is valid to fold the comparison. Fold ORDERED
and UNORDERED even if flag_unsafe_math_optimizations is off,
and the remaining even if flag_unsafe_math_optimizations
is off but we are under -fno-trapping-math.
(fold_relational_const): Integer modes do not honor NaNs.
gcc/testsuite/ChangeLog:
2004-05-27 Paolo Bonzini <bonzini@gnu.org>
* gcc.c-torture/compare-fp-1.c, gcc.c-torture/compare-fp-2.c,
gcc.c-torture/compare-fp-3.c, gcc.c-torture/compare-fp-4.c,
gcc.c-torture/compare-fp-3.x, gcc.c-torture/compare-fp-4.x,
gcc.c-torture/pr15649-1.c: New.
Co-Authored-By: Roger Sayle <roger@eyesopen.com>
From-SVN: r82365
2004-05-28 18:37:08 +02:00
|
|
|
@tindex UNLT_EXPR
|
|
|
|
@tindex UNLE_EXPR
|
|
|
|
@tindex UNGT_EXPR
|
|
|
|
@tindex UNGE_EXPR
|
|
|
|
@tindex UNEQ_EXPR
|
|
|
|
@tindex LTGT_EXPR
|
1999-09-19 17:50:40 +02:00
|
|
|
@tindex MODIFY_EXPR
|
2004-05-31 00:20:07 +02:00
|
|
|
@tindex INIT_EXPR
|
1999-09-19 17:50:40 +02:00
|
|
|
@tindex COMPONENT_REF
|
|
|
|
@tindex COMPOUND_EXPR
|
|
|
|
@tindex COND_EXPR
|
|
|
|
@tindex CALL_EXPR
|
|
|
|
@tindex STMT_EXPR
|
1999-10-06 01:59:27 +02:00
|
|
|
@tindex BIND_EXPR
|
1999-10-06 01:40:00 +02:00
|
|
|
@tindex LOOP_EXPR
|
|
|
|
@tindex EXIT_EXPR
|
1999-10-08 07:42:36 +02:00
|
|
|
@tindex CLEANUP_POINT_EXPR
|
2004-05-31 00:20:07 +02:00
|
|
|
@tindex CONSTRUCTOR
|
|
|
|
@tindex COMPOUND_LITERAL_EXPR
|
|
|
|
@tindex SAVE_EXPR
|
|
|
|
@tindex TARGET_EXPR
|
|
|
|
@tindex AGGR_INIT_EXPR
|
2002-08-05 17:50:10 +02:00
|
|
|
@tindex VA_ARG_EXPR
|
2007-06-12 19:47:37 +02:00
|
|
|
@tindex CHANGE_DYNAMIC_TYPE_EXPR
|
2006-05-29 17:52:51 +02:00
|
|
|
@tindex OMP_PARALLEL
|
|
|
|
@tindex OMP_FOR
|
|
|
|
@tindex OMP_SECTIONS
|
|
|
|
@tindex OMP_SINGLE
|
|
|
|
@tindex OMP_SECTION
|
|
|
|
@tindex OMP_MASTER
|
|
|
|
@tindex OMP_ORDERED
|
|
|
|
@tindex OMP_CRITICAL
|
|
|
|
@tindex OMP_RETURN
|
|
|
|
@tindex OMP_CONTINUE
|
|
|
|
@tindex OMP_ATOMIC
|
|
|
|
@tindex OMP_CLAUSE
|
[multiple changes]
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-analyze.c (vect_mark_relevant, vect_stmt_relevant_p): Take
enum argument instead of bool.
(vect_analyze_operations): Call vectorizable_type_promotion.
* tree-vectorizer.h (type_promotion_vec_info_type): New enum
stmt_vec_info_type value.
(supportable_widening_operation, vectorizable_type_promotion): New
function declarations.
* tree-vect-transform.c (vect_gen_widened_results_half): New function.
(vectorizable_type_promotion): New function.
(vect_transform_stmt): Call vectorizable_type_promotion.
* tree-vect-analyze.c (supportable_widening_operation): New function.
* tree-vect-patterns.c (vect_recog_dot_prod_pattern):
Add implementation.
* tree-vect-generic.c (expand_vector_operations_1): Consider correct
mode.
* tree.def (VEC_WIDEN_MULT_HI_EXPR, VEC_WIDEN_MULT_LO_EXPR):
(VEC_UNPACK_HI_EXPR, VEC_UNPACK_LO_EXPR): New tree-codes.
* tree-inline.c (estimate_num_insns_1): Add cases for above new
tree-codes.
* tree-pretty-print.c (dump_generic_node, op_prio): Likewise.
* expr.c (expand_expr_real_1): Likewise.
* optabs.c (optab_for_tree_code): Likewise.
(init_optabs): Initialize new optabs.
* genopinit.c (vec_widen_umult_hi_optab, vec_widen_smult_hi_optab,
vec_widen_smult_hi_optab, vec_widen_smult_lo_optab,
vec_unpacks_hi_optab, vec_unpacks_lo_optab, vec_unpacku_hi_optab,
vec_unpacku_lo_optab): Initialize new optabs.
* optabs.h (OTI_vec_widen_umult_hi, OTI_vec_widen_umult_lo):
(OTI_vec_widen_smult_h, OTI_vec_widen_smult_lo, OTI_vec_unpacks_hi,
OTI_vec_unpacks_lo, OTI_vec_unpacku_hi, OTI_vec_unpacku_lo): New
optab indices.
(vec_widen_umult_hi_optab, vec_widen_umult_lo_optab):
(vec_widen_smult_hi_optab, vec_widen_smult_lo_optab):
(vec_unpacks_hi_optab, vec_unpacku_hi_optab, vec_unpacks_lo_optab):
(vec_unpacku_lo_optab): New optabs.
* doc/md.texi (vec_unpacks_hi, vec_unpacks_lo, vec_unpacku_hi):
(vec_unpacku_lo, vec_widen_umult_hi, vec_widen_umult_lo):
(vec_widen_smult_hi, vec_widen_smult_lo): New.
* doc/c-tree.texi (VEC_LSHIFT_EXPR, VEC_RSHIFT_EXPR):
(VEC_WIDEN_MULT_HI_EXPR, VEC_WIDEN_MULT_LO_EXPR, VEC_UNPACK_HI_EXPR):
(VEC_UNPACK_LO_EXPR, VEC_PACK_MOD_EXPR, VEC_PACK_SAT_EXPR): New.
* config/rs6000/altivec.md (UNSPEC_VMULWHUB, UNSPEC_VMULWLUB):
(UNSPEC_VMULWHSB, UNSPEC_VMULWLSB, UNSPEC_VMULWHUH, UNSPEC_VMULWLUH):
(UNSPEC_VMULWHSH, UNSPEC_VMULWLSH): New.
(UNSPEC_VPERMSI, UNSPEC_VPERMHI): New.
(vec_vperm_v8hiv4si, vec_vperm_v16qiv8hi): New patterns used to
implement the unsigned unpacking patterns.
(vec_unpacks_hi_v16qi, vec_unpacks_hi_v8hi, vec_unpacks_lo_v16qi):
(vec_unpacks_lo_v8hi): New signed unpacking patterns.
(vec_unpacku_hi_v16qi, vec_unpacku_hi_v8hi, vec_unpacku_lo_v16qi):
(vec_unpacku_lo_v8hi): New unsigned unpacking patterns.
(vec_widen_umult_hi_v16qi, vec_widen_umult_lo_v16qi):
(vec_widen_smult_hi_v16qi, vec_widen_smult_lo_v16qi):
(vec_widen_umult_hi_v8hi, vec_widen_umult_lo_v8hi):
(vec_widen_smult_hi_v8hi, vec_widen_smult_lo_v8hi): New widening
multiplication patterns.
* target.h (builtin_mul_widen_even, builtin_mul_widen_odd): New.
* target-def.h (TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_EVEN):
(TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_ODD): New.
* config/rs6000/rs6000.c (rs6000_builtin_mul_widen_even): New.
(rs6000_builtin_mul_widen_odd): New.
(TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_EVEN): Defined.
(TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_ODD): Defined.
* tree-vectorizer.h (enum vect_relevant): New enum type.
(_stmt_vec_info): Field relevant chaned from bool to enum
vect_relevant.
(STMT_VINFO_RELEVANT_P): Updated.
(STMT_VINFO_RELEVANT): New.
* tree-vectorizer.c (new_stmt_vec_info): Use STMT_VINFO_RELEVANT
instead of STMT_VINFO_RELEVANT_P.
* tree-vect-analyze.c (vect_mark_relevant, vect_stmt_relevant_p):
Replace calls to STMT_VINFO_RELEVANT_P with STMT_VINFO_RELEVANT,
and boolean variable with enum vect_relevant.
(vect_mark_stmts_to_be_vectorized): Likewise + update documentation.
* doc/tm.texi (TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_EVEN): New.
(TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_ODD): New.
2006-11-08 Richard Henderson <rth@redhat.com>
* config/i386/sse.md (vec_widen_umult_hi_v8hi,
vec_widen_umult_lo_v8hi): New.
(vec_widen_smult_hi_v4si, vec_widen_smult_lo_v4si,
vec_widen_umult_hi_v4si, vec_widen_umult_lo_v4si): New.
* config/i386/i386.c (ix86_expand_sse_unpack): New.
* config/i386/i386-protos.h (ix86_expand_sse_unpack): New.
* config/i386/sse.md (vec_unpacku_hi_v16qi, vec_unpacks_hi_v16qi,
vec_unpacku_lo_v16qi, vec_unpacks_lo_v16qi, vec_unpacku_hi_v8hi,
vec_unpacks_hi_v8hi, vec_unpacku_lo_v8hi, vec_unpacks_lo_v8hi,
vec_unpacku_hi_v4si, vec_unpacks_hi_v4si, vec_unpacku_lo_v4si,
vec_unpacks_lo_v4si): New.
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-transform.c (vectorizable_type_demotion): New function.
(vect_transform_stmt): Add case for type_demotion_vec_info_type.
(vect_analyze_operations): Call vectorizable_type_demotion.
* tree-vectorizer.h (type_demotion_vec_info_type): New enum
stmt_vec_info_type value.
(vectorizable_type_demotion): New function declaration.
* tree-vect-generic.c (expand_vector_operations_1): Consider correct
mode.
* tree.def (VEC_PACK_MOD_EXPR, VEC_PACK_SAT_EXPR): New tree-codes.
* expr.c (expand_expr_real_1): Add case for VEC_PACK_MOD_EXPR and
VEC_PACK_SAT_EXPR.
* tree-iniline.c (estimate_num_insns_1): Likewise.
* tree-pretty-print.c (dump_generic_node, op_prio): Likewise.
* optabs.c (optab_for_tree_code): Likewise.
* optabs.c (expand_binop): In case of vec_pack_*_optabs the mode
compared against the predicate of the result is not 'mode' (the input
to the function) but a mode with half the size of 'mode'.
(init_optab): Initialize new optabs.
* optabs.h (OTI_vec_pack_mod, OTI_vec_pack_ssat, OTI_vec_pack_usat):
New optab indices.
(vec_pack_mod_optab, vec_pack_ssat_optab, vec_pack_usat_optab): New
optabs.
* genopinit.c (vec_pack_mod_optab, vec_pack_ssat_optab):
(vec_pack_usat_optab): Initialize new optabs.
* doc/md.texi (vec_pack_mod, vec_pack_ssat, vec_pack_usat): New.
* config/rs6000/altivec.md (vec_pack_mod_v8hi, vec_pack_mod_v4si): New.
2006-11-08 Richard Henderson <rth@redehat.com>
* config/i386/sse.md (vec_pack_mod_v8hi, vec_pack_mod_v4si):
(vec_pack_mod_v2di, vec_interleave_highv16qi, vec_interleave_lowv16qi):
(vec_interleave_highv8hi, vec_interleave_lowv8hi):
(vec_interleave_highv4si, vec_interleave_lowv4si):
(vec_interleave_highv2di, vec_interleave_lowv2di): New.
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-transform.c (vectorizable_reduction): Support multiple
datatypes.
(vect_transform_stmt): Removed redundant code.
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-transform.c (vectorizable_operation): Support multiple
datatypes.
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-transform.c (vect_align_data_ref): Removed.
(vect_create_data_ref_ptr): Added additional argument - ptr_incr.
Updated function documentation. Return the increment stmt in ptr_incr.
(bump_vector_ptr): New function.
(vect_get_vec_def_for_stmt_copy): New function.
(vect_finish_stmt_generation): Create a stmt_info to newly created
vector stmts.
(vect_setup_realignment): Call vect_create_data_ref_ptr with additional
argument.
(vectorizable_reduction, vectorizable_assignment): Not supported yet if
VF is greater than the number of elements that can fit in one vector
word.
(vectorizable_operation, vectorizable_condition): Likewise.
(vectorizable_store, vectorizable_load): Support the case that the VF
is greater than the number of elements that can fit in one vector word.
(vect_transform_loop): Don't fail in case of multiple data-types.
* tree-vect-analyze.c (vect_determine_vectorization_factor): Don't fail
in case of multiple data-types; the smallest type determines the VF.
(vect_analyze_data_ref_dependence): Don't record datarefs as same_align
if they are of different sizes.
(vect_update_misalignment_for_peel): Compare misalignments in terms of
number of elements rather than number of bytes.
(vect_enhance_data_refs_alignment): Fix/Add dump printouts.
(vect_can_advance_ivs_p): Fix a dump printout
From-SVN: r118577
2006-11-08 08:32:44 +01:00
|
|
|
@tindex VEC_LSHIFT_EXPR
|
|
|
|
@tindex VEC_RSHIFT_EXPR
|
|
|
|
@tindex VEC_WIDEN_MULT_HI_EXPR
|
|
|
|
@tindex VEC_WIDEN_MULT_LO_EXPR
|
|
|
|
@tindex VEC_UNPACK_HI_EXPR
|
|
|
|
@tindex VEC_UNPACK_LO_EXPR
|
re PR tree-optimization/24659 (Conversions are not vectorized)
PR tree-optimization/24659
* optabs.h (enum optab_index): Add OTI_vec_unpacks_float_hi,
OTI_vec_unpacks_float_lo, OTI_vec_unpacku_float_hi,
OTI_vec_unpacku_float_lo, OTI_vec_pack_sfix_trunc and
OTI_vec_pack_ufix_trunc.
(vec_unpacks_float_hi_optab): Define new macro.
(vec_unpacks_float_lo_optab): Ditto.
(vec_unpacku_float_hi_optab): Ditto.
(vec_unpacku_float_lo_optab): Ditto.
(vec_pack_sfix_trunc_optab): Ditto.
(vec_pack_ufix_trunc_optab): Ditto.
* genopinit.c (optabs): Implement vec_unpack[s|u]_[hi|lo]_optab
and vec_pack_[s|u]fix_trunc_optab using
vec_unpack[s|u]_[hi\lo]_* and vec_pack_[u|s]fix_trunc_* patterns
* tree-vectorizer.c (supportable_widening_operation): Handle
FLOAT_EXPR and CONVERT_EXPR. Update comment.
(supportable_narrowing_operation): New function.
* tree-vectorizer.h (supportable_narrowing_operation): Prototype.
* tree-vect-transform.c (vectorizable_conversion): Handle
(nunits_in == nunits_out / 2) and (nunits_out == nunits_in / 2) cases.
(vect_gen_widened_results_half): Move before vectorizable_conversion.
(vectorizable_type_demotion): Call supportable_narrowing_operation()
to check for target support.
* optabs.c (optab_for_tree_code) Return vec_unpack[s|u]_float_hi_optab
for VEC_UNPACK_FLOAT_HI_EXPR, vec_unpack[s|u]_float_lo_optab
for VEC_UNPACK_FLOAT_LO_EXPR and vec_pack_[u|s]fix_trunc_optab
for VEC_PACK_FIX_TRUNC_EXPR.
(expand_binop): Special case mode of the result for
vec_pack_[u|s]fix_trunc_optab.
(init_optabs): Initialize vec_unpack[s|u]_[hi|lo]_optab and
vec_pack_[u|s]fix_trunc_optab.
* tree.def (VEC_UNPACK_FLOAT_HI_EXPR, VEC_UNPACK_FLOAT_LO_EXPR,
VEC_PACK_FIX_TRUNC_EXPR): New tree codes.
* tree-pretty-print.c (dump_generic_node): Handle
VEC_UNPACK_FLOAT_HI_EXPR, VEC_UNPACK_FLOAT_LO_EXPR and
VEC_PACK_FIX_TRUNC_EXPR.
(op_prio): Ditto.
* expr.c (expand_expr_real_1): Ditto.
* tree-inline.c (estimate_num_insns_1): Ditto.
* tree-vect-generic.c (expand_vector_operations_1): Ditto.
* config/i386/sse.md (vec_unpacks_float_hi_v8hi): New expander.
(vec_unpacks_float_lo_v8hi): Ditto.
(vec_unpacku_float_hi_v8hi): Ditto.
(vec_unpacku_float_lo_v8hi): Ditto.
(vec_unpacks_float_hi_v4si): Ditto.
(vec_unpacks_float_lo_v4si): Ditto.
(vec_pack_sfix_trunc_v2df): Ditto.
* doc/c-tree.texi (Expression trees) [VEC_UNPACK_FLOAT_HI_EXPR]:
Document.
[VEC_UNPACK_FLOAT_LO_EXPR]: Ditto.
[VEC_PACK_FIX_TRUNC_EXPR]: Ditto.
* doc/md.texi (Standard Names) [vec_pack_sfix_trunc]: Document.
[vec_pack_ufix_trunc]: Ditto.
[vec_unpacks_float_hi]: Ditto.
[vec_unpacks_float_lo]: Ditto.
[vec_unpacku_float_hi]: Ditto.
[vec_unpacku_float_lo]: Ditto.
testsuite/ChangeLog:
PR tree-optimization/24659
* gcc.dg/vect/vect-floatint-conversion-2.c: New test.
* gcc.dg/vect/vect-intfloat-conversion-1.c: Require vect_float,
not vect_int target.
* gcc.dg/vect/vect-intfloat-conversion-2.c: Require vect_float,
not vect_int target. Loop is vectorized for vect_intfloat_cvt
targets.
* gcc.dg/vect/vect-intfloat-conversion-3.c: New test.
* gcc.dg/vect/vect-intfloat-conversion-4a.c: New test.
* gcc.dg/vect/vect-intfloat-conversion-4b.c: New test.
From-SVN: r124784
2007-05-17 08:31:05 +02:00
|
|
|
@tindex VEC_UNPACK_FLOAT_HI_EXPR
|
|
|
|
@tindex VEC_UNPACK_FLOAT_LO_EXPR
|
2007-04-22 20:45:06 +02:00
|
|
|
@tindex VEC_PACK_TRUNC_EXPR
|
[multiple changes]
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-analyze.c (vect_mark_relevant, vect_stmt_relevant_p): Take
enum argument instead of bool.
(vect_analyze_operations): Call vectorizable_type_promotion.
* tree-vectorizer.h (type_promotion_vec_info_type): New enum
stmt_vec_info_type value.
(supportable_widening_operation, vectorizable_type_promotion): New
function declarations.
* tree-vect-transform.c (vect_gen_widened_results_half): New function.
(vectorizable_type_promotion): New function.
(vect_transform_stmt): Call vectorizable_type_promotion.
* tree-vect-analyze.c (supportable_widening_operation): New function.
* tree-vect-patterns.c (vect_recog_dot_prod_pattern):
Add implementation.
* tree-vect-generic.c (expand_vector_operations_1): Consider correct
mode.
* tree.def (VEC_WIDEN_MULT_HI_EXPR, VEC_WIDEN_MULT_LO_EXPR):
(VEC_UNPACK_HI_EXPR, VEC_UNPACK_LO_EXPR): New tree-codes.
* tree-inline.c (estimate_num_insns_1): Add cases for above new
tree-codes.
* tree-pretty-print.c (dump_generic_node, op_prio): Likewise.
* expr.c (expand_expr_real_1): Likewise.
* optabs.c (optab_for_tree_code): Likewise.
(init_optabs): Initialize new optabs.
* genopinit.c (vec_widen_umult_hi_optab, vec_widen_smult_hi_optab,
vec_widen_smult_hi_optab, vec_widen_smult_lo_optab,
vec_unpacks_hi_optab, vec_unpacks_lo_optab, vec_unpacku_hi_optab,
vec_unpacku_lo_optab): Initialize new optabs.
* optabs.h (OTI_vec_widen_umult_hi, OTI_vec_widen_umult_lo):
(OTI_vec_widen_smult_h, OTI_vec_widen_smult_lo, OTI_vec_unpacks_hi,
OTI_vec_unpacks_lo, OTI_vec_unpacku_hi, OTI_vec_unpacku_lo): New
optab indices.
(vec_widen_umult_hi_optab, vec_widen_umult_lo_optab):
(vec_widen_smult_hi_optab, vec_widen_smult_lo_optab):
(vec_unpacks_hi_optab, vec_unpacku_hi_optab, vec_unpacks_lo_optab):
(vec_unpacku_lo_optab): New optabs.
* doc/md.texi (vec_unpacks_hi, vec_unpacks_lo, vec_unpacku_hi):
(vec_unpacku_lo, vec_widen_umult_hi, vec_widen_umult_lo):
(vec_widen_smult_hi, vec_widen_smult_lo): New.
* doc/c-tree.texi (VEC_LSHIFT_EXPR, VEC_RSHIFT_EXPR):
(VEC_WIDEN_MULT_HI_EXPR, VEC_WIDEN_MULT_LO_EXPR, VEC_UNPACK_HI_EXPR):
(VEC_UNPACK_LO_EXPR, VEC_PACK_MOD_EXPR, VEC_PACK_SAT_EXPR): New.
* config/rs6000/altivec.md (UNSPEC_VMULWHUB, UNSPEC_VMULWLUB):
(UNSPEC_VMULWHSB, UNSPEC_VMULWLSB, UNSPEC_VMULWHUH, UNSPEC_VMULWLUH):
(UNSPEC_VMULWHSH, UNSPEC_VMULWLSH): New.
(UNSPEC_VPERMSI, UNSPEC_VPERMHI): New.
(vec_vperm_v8hiv4si, vec_vperm_v16qiv8hi): New patterns used to
implement the unsigned unpacking patterns.
(vec_unpacks_hi_v16qi, vec_unpacks_hi_v8hi, vec_unpacks_lo_v16qi):
(vec_unpacks_lo_v8hi): New signed unpacking patterns.
(vec_unpacku_hi_v16qi, vec_unpacku_hi_v8hi, vec_unpacku_lo_v16qi):
(vec_unpacku_lo_v8hi): New unsigned unpacking patterns.
(vec_widen_umult_hi_v16qi, vec_widen_umult_lo_v16qi):
(vec_widen_smult_hi_v16qi, vec_widen_smult_lo_v16qi):
(vec_widen_umult_hi_v8hi, vec_widen_umult_lo_v8hi):
(vec_widen_smult_hi_v8hi, vec_widen_smult_lo_v8hi): New widening
multiplication patterns.
* target.h (builtin_mul_widen_even, builtin_mul_widen_odd): New.
* target-def.h (TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_EVEN):
(TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_ODD): New.
* config/rs6000/rs6000.c (rs6000_builtin_mul_widen_even): New.
(rs6000_builtin_mul_widen_odd): New.
(TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_EVEN): Defined.
(TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_ODD): Defined.
* tree-vectorizer.h (enum vect_relevant): New enum type.
(_stmt_vec_info): Field relevant chaned from bool to enum
vect_relevant.
(STMT_VINFO_RELEVANT_P): Updated.
(STMT_VINFO_RELEVANT): New.
* tree-vectorizer.c (new_stmt_vec_info): Use STMT_VINFO_RELEVANT
instead of STMT_VINFO_RELEVANT_P.
* tree-vect-analyze.c (vect_mark_relevant, vect_stmt_relevant_p):
Replace calls to STMT_VINFO_RELEVANT_P with STMT_VINFO_RELEVANT,
and boolean variable with enum vect_relevant.
(vect_mark_stmts_to_be_vectorized): Likewise + update documentation.
* doc/tm.texi (TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_EVEN): New.
(TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_ODD): New.
2006-11-08 Richard Henderson <rth@redhat.com>
* config/i386/sse.md (vec_widen_umult_hi_v8hi,
vec_widen_umult_lo_v8hi): New.
(vec_widen_smult_hi_v4si, vec_widen_smult_lo_v4si,
vec_widen_umult_hi_v4si, vec_widen_umult_lo_v4si): New.
* config/i386/i386.c (ix86_expand_sse_unpack): New.
* config/i386/i386-protos.h (ix86_expand_sse_unpack): New.
* config/i386/sse.md (vec_unpacku_hi_v16qi, vec_unpacks_hi_v16qi,
vec_unpacku_lo_v16qi, vec_unpacks_lo_v16qi, vec_unpacku_hi_v8hi,
vec_unpacks_hi_v8hi, vec_unpacku_lo_v8hi, vec_unpacks_lo_v8hi,
vec_unpacku_hi_v4si, vec_unpacks_hi_v4si, vec_unpacku_lo_v4si,
vec_unpacks_lo_v4si): New.
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-transform.c (vectorizable_type_demotion): New function.
(vect_transform_stmt): Add case for type_demotion_vec_info_type.
(vect_analyze_operations): Call vectorizable_type_demotion.
* tree-vectorizer.h (type_demotion_vec_info_type): New enum
stmt_vec_info_type value.
(vectorizable_type_demotion): New function declaration.
* tree-vect-generic.c (expand_vector_operations_1): Consider correct
mode.
* tree.def (VEC_PACK_MOD_EXPR, VEC_PACK_SAT_EXPR): New tree-codes.
* expr.c (expand_expr_real_1): Add case for VEC_PACK_MOD_EXPR and
VEC_PACK_SAT_EXPR.
* tree-iniline.c (estimate_num_insns_1): Likewise.
* tree-pretty-print.c (dump_generic_node, op_prio): Likewise.
* optabs.c (optab_for_tree_code): Likewise.
* optabs.c (expand_binop): In case of vec_pack_*_optabs the mode
compared against the predicate of the result is not 'mode' (the input
to the function) but a mode with half the size of 'mode'.
(init_optab): Initialize new optabs.
* optabs.h (OTI_vec_pack_mod, OTI_vec_pack_ssat, OTI_vec_pack_usat):
New optab indices.
(vec_pack_mod_optab, vec_pack_ssat_optab, vec_pack_usat_optab): New
optabs.
* genopinit.c (vec_pack_mod_optab, vec_pack_ssat_optab):
(vec_pack_usat_optab): Initialize new optabs.
* doc/md.texi (vec_pack_mod, vec_pack_ssat, vec_pack_usat): New.
* config/rs6000/altivec.md (vec_pack_mod_v8hi, vec_pack_mod_v4si): New.
2006-11-08 Richard Henderson <rth@redehat.com>
* config/i386/sse.md (vec_pack_mod_v8hi, vec_pack_mod_v4si):
(vec_pack_mod_v2di, vec_interleave_highv16qi, vec_interleave_lowv16qi):
(vec_interleave_highv8hi, vec_interleave_lowv8hi):
(vec_interleave_highv4si, vec_interleave_lowv4si):
(vec_interleave_highv2di, vec_interleave_lowv2di): New.
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-transform.c (vectorizable_reduction): Support multiple
datatypes.
(vect_transform_stmt): Removed redundant code.
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-transform.c (vectorizable_operation): Support multiple
datatypes.
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-transform.c (vect_align_data_ref): Removed.
(vect_create_data_ref_ptr): Added additional argument - ptr_incr.
Updated function documentation. Return the increment stmt in ptr_incr.
(bump_vector_ptr): New function.
(vect_get_vec_def_for_stmt_copy): New function.
(vect_finish_stmt_generation): Create a stmt_info to newly created
vector stmts.
(vect_setup_realignment): Call vect_create_data_ref_ptr with additional
argument.
(vectorizable_reduction, vectorizable_assignment): Not supported yet if
VF is greater than the number of elements that can fit in one vector
word.
(vectorizable_operation, vectorizable_condition): Likewise.
(vectorizable_store, vectorizable_load): Support the case that the VF
is greater than the number of elements that can fit in one vector word.
(vect_transform_loop): Don't fail in case of multiple data-types.
* tree-vect-analyze.c (vect_determine_vectorization_factor): Don't fail
in case of multiple data-types; the smallest type determines the VF.
(vect_analyze_data_ref_dependence): Don't record datarefs as same_align
if they are of different sizes.
(vect_update_misalignment_for_peel): Compare misalignments in terms of
number of elements rather than number of bytes.
(vect_enhance_data_refs_alignment): Fix/Add dump printouts.
(vect_can_advance_ivs_p): Fix a dump printout
From-SVN: r118577
2006-11-08 08:32:44 +01:00
|
|
|
@tindex VEC_PACK_SAT_EXPR
|
re PR tree-optimization/24659 (Conversions are not vectorized)
PR tree-optimization/24659
* optabs.h (enum optab_index): Add OTI_vec_unpacks_float_hi,
OTI_vec_unpacks_float_lo, OTI_vec_unpacku_float_hi,
OTI_vec_unpacku_float_lo, OTI_vec_pack_sfix_trunc and
OTI_vec_pack_ufix_trunc.
(vec_unpacks_float_hi_optab): Define new macro.
(vec_unpacks_float_lo_optab): Ditto.
(vec_unpacku_float_hi_optab): Ditto.
(vec_unpacku_float_lo_optab): Ditto.
(vec_pack_sfix_trunc_optab): Ditto.
(vec_pack_ufix_trunc_optab): Ditto.
* genopinit.c (optabs): Implement vec_unpack[s|u]_[hi|lo]_optab
and vec_pack_[s|u]fix_trunc_optab using
vec_unpack[s|u]_[hi\lo]_* and vec_pack_[u|s]fix_trunc_* patterns
* tree-vectorizer.c (supportable_widening_operation): Handle
FLOAT_EXPR and CONVERT_EXPR. Update comment.
(supportable_narrowing_operation): New function.
* tree-vectorizer.h (supportable_narrowing_operation): Prototype.
* tree-vect-transform.c (vectorizable_conversion): Handle
(nunits_in == nunits_out / 2) and (nunits_out == nunits_in / 2) cases.
(vect_gen_widened_results_half): Move before vectorizable_conversion.
(vectorizable_type_demotion): Call supportable_narrowing_operation()
to check for target support.
* optabs.c (optab_for_tree_code) Return vec_unpack[s|u]_float_hi_optab
for VEC_UNPACK_FLOAT_HI_EXPR, vec_unpack[s|u]_float_lo_optab
for VEC_UNPACK_FLOAT_LO_EXPR and vec_pack_[u|s]fix_trunc_optab
for VEC_PACK_FIX_TRUNC_EXPR.
(expand_binop): Special case mode of the result for
vec_pack_[u|s]fix_trunc_optab.
(init_optabs): Initialize vec_unpack[s|u]_[hi|lo]_optab and
vec_pack_[u|s]fix_trunc_optab.
* tree.def (VEC_UNPACK_FLOAT_HI_EXPR, VEC_UNPACK_FLOAT_LO_EXPR,
VEC_PACK_FIX_TRUNC_EXPR): New tree codes.
* tree-pretty-print.c (dump_generic_node): Handle
VEC_UNPACK_FLOAT_HI_EXPR, VEC_UNPACK_FLOAT_LO_EXPR and
VEC_PACK_FIX_TRUNC_EXPR.
(op_prio): Ditto.
* expr.c (expand_expr_real_1): Ditto.
* tree-inline.c (estimate_num_insns_1): Ditto.
* tree-vect-generic.c (expand_vector_operations_1): Ditto.
* config/i386/sse.md (vec_unpacks_float_hi_v8hi): New expander.
(vec_unpacks_float_lo_v8hi): Ditto.
(vec_unpacku_float_hi_v8hi): Ditto.
(vec_unpacku_float_lo_v8hi): Ditto.
(vec_unpacks_float_hi_v4si): Ditto.
(vec_unpacks_float_lo_v4si): Ditto.
(vec_pack_sfix_trunc_v2df): Ditto.
* doc/c-tree.texi (Expression trees) [VEC_UNPACK_FLOAT_HI_EXPR]:
Document.
[VEC_UNPACK_FLOAT_LO_EXPR]: Ditto.
[VEC_PACK_FIX_TRUNC_EXPR]: Ditto.
* doc/md.texi (Standard Names) [vec_pack_sfix_trunc]: Document.
[vec_pack_ufix_trunc]: Ditto.
[vec_unpacks_float_hi]: Ditto.
[vec_unpacks_float_lo]: Ditto.
[vec_unpacku_float_hi]: Ditto.
[vec_unpacku_float_lo]: Ditto.
testsuite/ChangeLog:
PR tree-optimization/24659
* gcc.dg/vect/vect-floatint-conversion-2.c: New test.
* gcc.dg/vect/vect-intfloat-conversion-1.c: Require vect_float,
not vect_int target.
* gcc.dg/vect/vect-intfloat-conversion-2.c: Require vect_float,
not vect_int target. Loop is vectorized for vect_intfloat_cvt
targets.
* gcc.dg/vect/vect-intfloat-conversion-3.c: New test.
* gcc.dg/vect/vect-intfloat-conversion-4a.c: New test.
* gcc.dg/vect/vect-intfloat-conversion-4b.c: New test.
From-SVN: r124784
2007-05-17 08:31:05 +02:00
|
|
|
@tindex VEC_PACK_FIX_TRUNC_EXPR
|
c-tree.texi: Document new tree codes.
* doc/c-tree.texi: Document new tree codes.
* doc/md.texi: Document new optabs.
* tree-pretty-print.c (dump_generic_node): Handle print of new tree
codes.
* optabs.c (optab_for_tree_code, init_optabs): Handle new optabs.
* optabs.h (optab_index): Add new.
(vec_extract_even_optab, vec_extract_odd_optab,
vec_interleave_high_optab, vec_interleave_low_optab): New optabs.
* genopinit.c (vec_extract_even_optab, vec_extract_odd_optab,
vec_interleave_high_optab, vec_interleave_low_optab): Initialize
new optabs.
* expr.c (expand_expr_real_1): Add implementation for new tree codes.
* tree-vectorizer.c (new_stmt_vec_info): Initialize new fields.
* tree-vectorizer.h (stmt_vec_info): Add new fields for interleaving
along with macros for their access.
* tree-data-ref.h (first_location_in_loop, data_reference): Update
comment.
* tree-vect-analyze.c (toplev.h): Include.
(vect_determine_vectorization_factor): Fix indentation.
(vect_insert_into_interleaving_chain,
vect_update_interleaving_chain, vect_equal_offsets): New functions.
(vect_analyze_data_ref_dependence): Add argument for interleaving
check. Check for interleaving if it's true.
(vect_check_dependences): New function.
(vect_analyze_data_ref_dependences): Call vect_check_dependences for
every ddr. Call vect_analyze_data_ref_dependence with new argument.
(vect_update_misalignment_for_peel): Update for interleaving.
(vect_verify_datarefs_alignment): Check only first data-ref for
interleaving.
(vect_enhance_data_refs_alignment): Update for interleaving. Check
only first data-ref for interleaving.
(vect_analyze_data_ref_access): Check interleaving, update
interleaving data.
(vect_analyze_data_refs): Call compute_data_dependences_for_loop
with different parameters.
* tree.def (VEC_EXTRACT_EVEN_EXPR, VEC_EXTRACT_ODD_EXPR,
VEC_INTERLEAVE_HIGH_EXPR, VEC_INTERLEAVE_LOW_EXPR): New tree codes.
* tree-inline.c (estimate_num_insns_1): Add cases for new codes.
* tree-vect-transform.c (vect_create_addr_base_for_vector_ref):
Update step in case of interleaving.
(vect_strided_store_supported, vect_permute_store_chain): New
functions.
(vectorizable_store): Handle strided stores.
(vect_strided_load_supported, vect_permute_load_chain,
vect_transform_strided_load): New functions.
(vectorizable_load): Handle strided loads.
(vect_transform_stmt): Add argument. Handle strided stores. Check
that vectorized stmt exists for patterns.
(vect_gen_niters_for_prolog_loop): Update calculation for
interleaving.
(vect_transform_loop): Remove stmt_vec_info for strided stores after
whole chain vectorization.
* config/rs6000/altivec.md (UNSPEC_EXTEVEN, UNSPEC_EXTODD,
UNSPEC_INTERHI, UNSPEC_INTERLO): New constants.
(vpkuhum_nomode, vpkuwum_nomode, vec_extract_even<mode>,
vec_extract_odd<mode>, altivec_vmrghsf, altivec_vmrglsf,
vec_interleave_high<mode>, vec_interleave_low<mode>): Implement.
From-SVN: r119088
2006-11-22 09:46:03 +01:00
|
|
|
@tindex VEC_EXTRACT_EVEN_EXPR
|
|
|
|
@tindex VEC_EXTRACT_ODD_EXPR
|
|
|
|
@tindex VEC_INTERLEAVE_HIGH_EXPR
|
|
|
|
@tindex VEC_INTERLEAVE_LOW_EXPR
|
1999-09-19 17:50:40 +02:00
|
|
|
|
|
|
|
The internal representation for expressions is for the most part quite
|
|
|
|
straightforward. However, there are a few facts that one must bear in
|
|
|
|
mind. In particular, the expression ``tree'' is actually a directed
|
|
|
|
acyclic graph. (For example there may be many references to the integer
|
|
|
|
constant zero throughout the source program; many of these will be
|
|
|
|
represented by the same expression node.) You should not rely on
|
|
|
|
certain kinds of node being shared, nor should rely on certain kinds of
|
|
|
|
nodes being unshared.
|
|
|
|
|
|
|
|
The following macros can be used with all expression nodes:
|
2000-09-24 23:47:45 +02:00
|
|
|
|
1999-09-19 17:50:40 +02:00
|
|
|
@ftable @code
|
|
|
|
@item TREE_TYPE
|
|
|
|
Returns the type of the expression. This value may not be precisely the
|
2000-09-24 23:47:45 +02:00
|
|
|
same type that would be given the expression in the original program.
|
1999-09-19 17:50:40 +02:00
|
|
|
@end ftable
|
|
|
|
|
|
|
|
In what follows, some nodes that one might expect to always have type
|
|
|
|
@code{bool} are documented to have either integral or boolean type. At
|
2001-06-21 02:03:48 +02:00
|
|
|
some point in the future, the C front end may also make use of this same
|
1999-09-19 17:50:40 +02:00
|
|
|
intermediate representation, and at this point these nodes will
|
|
|
|
certainly have integral type. The previous sentence is not meant to
|
2001-06-21 02:03:48 +02:00
|
|
|
imply that the C++ front end does not or will not give these nodes
|
1999-09-19 17:50:40 +02:00
|
|
|
integral type.
|
|
|
|
|
|
|
|
Below, we list the various kinds of expression nodes. Except where
|
|
|
|
noted otherwise, the operands to an expression are accessed using the
|
|
|
|
@code{TREE_OPERAND} macro. For example, to access the first operand to
|
|
|
|
a binary plus expression @code{expr}, use:
|
2000-09-24 23:47:45 +02:00
|
|
|
|
c-tree.texi, [...]: Use @smallexample instead of @example.
* doc/c-tree.texi, doc/compat.texi, doc/cpp.texi,
doc/cppopts.texi, doc/extend.texi, doc/install.texi,
doc/interface.texi, doc/invoke.texi, doc/libgcc.texi, doc/md.texi,
doc/objc.texi, doc/rtl.texi, doc/tm.texi, doc/trouble.texi: Use
@smallexample instead of @example.
From-SVN: r76075
2004-01-18 02:20:48 +01:00
|
|
|
@smallexample
|
1999-09-19 17:50:40 +02:00
|
|
|
TREE_OPERAND (expr, 0)
|
c-tree.texi, [...]: Use @smallexample instead of @example.
* doc/c-tree.texi, doc/compat.texi, doc/cpp.texi,
doc/cppopts.texi, doc/extend.texi, doc/install.texi,
doc/interface.texi, doc/invoke.texi, doc/libgcc.texi, doc/md.texi,
doc/objc.texi, doc/rtl.texi, doc/tm.texi, doc/trouble.texi: Use
@smallexample instead of @example.
From-SVN: r76075
2004-01-18 02:20:48 +01:00
|
|
|
@end smallexample
|
1999-09-19 17:50:40 +02:00
|
|
|
@noindent
|
|
|
|
As this example indicates, the operands are zero-indexed.
|
|
|
|
|
2006-05-29 17:52:51 +02:00
|
|
|
All the expressions starting with @code{OMP_} represent directives and
|
|
|
|
clauses used by the OpenMP API @w{@uref{http://www.openmp.org/}}.
|
|
|
|
|
1999-09-19 17:50:40 +02:00
|
|
|
The table below begins with constants, moves on to unary expressions,
|
|
|
|
then proceeds to binary expressions, and concludes with various other
|
|
|
|
kinds of expressions:
|
2000-09-24 23:47:45 +02:00
|
|
|
|
1999-09-19 17:50:40 +02:00
|
|
|
@table @code
|
|
|
|
@item INTEGER_CST
|
|
|
|
These nodes represent integer constants. Note that the type of these
|
|
|
|
constants is obtained with @code{TREE_TYPE}; they are not always of type
|
|
|
|
@code{int}. In particular, @code{char} constants are represented with
|
|
|
|
@code{INTEGER_CST} nodes. The value of the integer constant @code{e} is
|
c-tree.texi, [...]: Use @smallexample instead of @example.
* doc/c-tree.texi, doc/compat.texi, doc/cpp.texi,
doc/cppopts.texi, doc/extend.texi, doc/install.texi,
doc/interface.texi, doc/invoke.texi, doc/libgcc.texi, doc/md.texi,
doc/objc.texi, doc/rtl.texi, doc/tm.texi, doc/trouble.texi: Use
@smallexample instead of @example.
From-SVN: r76075
2004-01-18 02:20:48 +01:00
|
|
|
given by
|
|
|
|
@smallexample
|
c-tree.texi, [...]: Remove trailing whitespace.
* c-tree.texi, contrib.texi, cpp.texi, extend.texi, gcc.texi,
gcov.texi, install.texi, md.texi, objc.texi, rtl.texi, tm.texi:
Remove trailing whitespace.
From-SVN: r42678
2001-05-28 22:57:50 +02:00
|
|
|
((TREE_INT_CST_HIGH (e) << HOST_BITS_PER_WIDE_INT)
|
1999-09-19 17:50:40 +02:00
|
|
|
+ TREE_INST_CST_LOW (e))
|
c-tree.texi, [...]: Use @smallexample instead of @example.
* doc/c-tree.texi, doc/compat.texi, doc/cpp.texi,
doc/cppopts.texi, doc/extend.texi, doc/install.texi,
doc/interface.texi, doc/invoke.texi, doc/libgcc.texi, doc/md.texi,
doc/objc.texi, doc/rtl.texi, doc/tm.texi, doc/trouble.texi: Use
@smallexample instead of @example.
From-SVN: r76075
2004-01-18 02:20:48 +01:00
|
|
|
@end smallexample
|
1999-09-19 17:50:40 +02:00
|
|
|
@noindent
|
|
|
|
HOST_BITS_PER_WIDE_INT is at least thirty-two on all platforms. Both
|
|
|
|
@code{TREE_INT_CST_HIGH} and @code{TREE_INT_CST_LOW} return a
|
|
|
|
@code{HOST_WIDE_INT}. The value of an @code{INTEGER_CST} is interpreted
|
|
|
|
as a signed or unsigned quantity depending on the type of the constant.
|
|
|
|
In general, the expression given above will overflow, so it should not
|
|
|
|
be used to calculate the value of the constant.
|
|
|
|
|
2001-10-09 08:03:16 +02:00
|
|
|
The variable @code{integer_zero_node} is an integer constant with value
|
1999-09-19 17:50:40 +02:00
|
|
|
zero. Similarly, @code{integer_one_node} is an integer constant with
|
|
|
|
value one. The @code{size_zero_node} and @code{size_one_node} variables
|
|
|
|
are analogous, but have type @code{size_t} rather than @code{int}.
|
|
|
|
|
|
|
|
The function @code{tree_int_cst_lt} is a predicate which holds if its
|
|
|
|
first argument is less than its second. Both constants are assumed to
|
|
|
|
have the same signedness (i.e., either both should be signed or both
|
|
|
|
should be unsigned.) The full width of the constant is used when doing
|
|
|
|
the comparison; the usual rules about promotions and conversions are
|
|
|
|
ignored. Similarly, @code{tree_int_cst_equal} holds if the two
|
|
|
|
constants are equal. The @code{tree_int_cst_sgn} function returns the
|
|
|
|
sign of a constant. The value is @code{1}, @code{0}, or @code{-1}
|
|
|
|
according on whether the constant is greater than, equal to, or less
|
|
|
|
than zero. Again, the signedness of the constant's type is taken into
|
|
|
|
account; an unsigned constant is never less than zero, no matter what
|
|
|
|
its bit-pattern.
|
|
|
|
|
|
|
|
@item REAL_CST
|
|
|
|
|
|
|
|
FIXME: Talk about how to obtain representations of this constant, do
|
|
|
|
comparisons, and so forth.
|
|
|
|
|
2000-04-22 14:01:30 +02:00
|
|
|
@item COMPLEX_CST
|
|
|
|
These nodes are used to represent complex number constants, that is a
|
c-tree.texi, [...]: Remove trailing whitespace.
* c-tree.texi, contrib.texi, cpp.texi, extend.texi, gcc.texi,
gcov.texi, install.texi, md.texi, objc.texi, rtl.texi, tm.texi:
Remove trailing whitespace.
From-SVN: r42678
2001-05-28 22:57:50 +02:00
|
|
|
@code{__complex__} whose parts are constant nodes. The
|
2000-04-25 18:56:38 +02:00
|
|
|
@code{TREE_REALPART} and @code{TREE_IMAGPART} return the real and the
|
2000-04-22 14:01:30 +02:00
|
|
|
imaginary parts respectively.
|
|
|
|
|
2002-02-19 03:53:41 +01:00
|
|
|
@item VECTOR_CST
|
|
|
|
These nodes are used to represent vector constants, whose parts are
|
|
|
|
constant nodes. Each individual constant node is either an integer or a
|
|
|
|
double constant node. The first operand is a @code{TREE_LIST} of the
|
|
|
|
constant nodes and is accessed through @code{TREE_VECTOR_CST_ELTS}.
|
|
|
|
|
1999-09-19 17:50:40 +02:00
|
|
|
@item STRING_CST
|
|
|
|
These nodes represent string-constants. The @code{TREE_STRING_LENGTH}
|
|
|
|
returns the length of the string, as an @code{int}. The
|
|
|
|
@code{TREE_STRING_POINTER} is a @code{char*} containing the string
|
|
|
|
itself. The string may not be @code{NUL}-terminated, and it may contain
|
|
|
|
embedded @code{NUL} characters. Therefore, the
|
|
|
|
@code{TREE_STRING_LENGTH} includes the trailing @code{NUL} if it is
|
|
|
|
present.
|
|
|
|
|
2001-04-02 09:39:39 +02:00
|
|
|
For wide string constants, the @code{TREE_STRING_LENGTH} is the number
|
2001-06-04 21:50:50 +02:00
|
|
|
of bytes in the string, and the @code{TREE_STRING_POINTER}
|
2001-04-02 09:39:39 +02:00
|
|
|
points to an array of the bytes of the string, as represented on the
|
|
|
|
target system (that is, as integers in the target endianness). Wide and
|
|
|
|
non-wide string constants are distinguished only by the @code{TREE_TYPE}
|
|
|
|
of the @code{STRING_CST}.
|
|
|
|
|
|
|
|
FIXME: The formats of string constants are not well-defined when the
|
|
|
|
target system bytes are not the same width as host system bytes.
|
1999-09-19 17:50:40 +02:00
|
|
|
|
|
|
|
@item PTRMEM_CST
|
|
|
|
These nodes are used to represent pointer-to-member constants. The
|
|
|
|
@code{PTRMEM_CST_CLASS} is the class type (either a @code{RECORD_TYPE}
|
|
|
|
or @code{UNION_TYPE} within which the pointer points), and the
|
|
|
|
@code{PTRMEM_CST_MEMBER} is the declaration for the pointed to object.
|
|
|
|
Note that the @code{DECL_CONTEXT} for the @code{PTRMEM_CST_MEMBER} is in
|
2001-10-17 10:44:09 +02:00
|
|
|
general different from the @code{PTRMEM_CST_CLASS}. For example,
|
1999-09-19 17:50:40 +02:00
|
|
|
given:
|
c-tree.texi, [...]: Use @smallexample instead of @example.
* doc/c-tree.texi, doc/compat.texi, doc/cpp.texi,
doc/cppopts.texi, doc/extend.texi, doc/install.texi,
doc/interface.texi, doc/invoke.texi, doc/libgcc.texi, doc/md.texi,
doc/objc.texi, doc/rtl.texi, doc/tm.texi, doc/trouble.texi: Use
@smallexample instead of @example.
From-SVN: r76075
2004-01-18 02:20:48 +01:00
|
|
|
@smallexample
|
1999-09-19 17:50:40 +02:00
|
|
|
struct B @{ int i; @};
|
|
|
|
struct D : public B @{@};
|
|
|
|
int D::*dp = &D::i;
|
c-tree.texi, [...]: Use @smallexample instead of @example.
* doc/c-tree.texi, doc/compat.texi, doc/cpp.texi,
doc/cppopts.texi, doc/extend.texi, doc/install.texi,
doc/interface.texi, doc/invoke.texi, doc/libgcc.texi, doc/md.texi,
doc/objc.texi, doc/rtl.texi, doc/tm.texi, doc/trouble.texi: Use
@smallexample instead of @example.
From-SVN: r76075
2004-01-18 02:20:48 +01:00
|
|
|
@end smallexample
|
1999-09-19 17:50:40 +02:00
|
|
|
@noindent
|
2000-08-26 20:26:52 +02:00
|
|
|
The @code{PTRMEM_CST_CLASS} for @code{&D::i} is @code{D}, even though
|
1999-09-19 17:50:40 +02:00
|
|
|
the @code{DECL_CONTEXT} for the @code{PTRMEM_CST_MEMBER} is @code{B},
|
2000-08-26 20:26:52 +02:00
|
|
|
since @code{B::i} is a member of @code{B}, not @code{D}.
|
1999-09-19 17:50:40 +02:00
|
|
|
|
|
|
|
@item VAR_DECL
|
|
|
|
|
|
|
|
These nodes represent variables, including static data members. For
|
|
|
|
more information, @pxref{Declarations}.
|
|
|
|
|
|
|
|
@item NEGATE_EXPR
|
|
|
|
These nodes represent unary negation of the single operand, for both
|
|
|
|
integer and floating-point types. The type of negation can be
|
|
|
|
determined by looking at the type of the expression.
|
|
|
|
|
2003-05-31 15:23:32 +02:00
|
|
|
The behavior of this operation on signed arithmetic overflow is
|
|
|
|
controlled by the @code{flag_wrapv} and @code{flag_trapv} variables.
|
|
|
|
|
2003-08-12 03:45:23 +02:00
|
|
|
@item ABS_EXPR
|
|
|
|
These nodes represent the absolute value of the single operand, for
|
|
|
|
both integer and floating-point types. This is typically used to
|
|
|
|
implement the @code{abs}, @code{labs} and @code{llabs} builtins for
|
|
|
|
integer types, and the @code{fabs}, @code{fabsf} and @code{fabsl}
|
|
|
|
builtins for floating point types. The type of abs operation can
|
|
|
|
be determined by looking at the type of the expression.
|
|
|
|
|
|
|
|
This node is not used for complex types. To represent the modulus
|
|
|
|
or complex abs of a complex value, use the @code{BUILT_IN_CABS},
|
|
|
|
@code{BUILT_IN_CABSF} or @code{BUILT_IN_CABSL} builtins, as used
|
|
|
|
to implement the C99 @code{cabs}, @code{cabsf} and @code{cabsl}
|
|
|
|
built-in functions.
|
|
|
|
|
1999-09-19 17:50:40 +02:00
|
|
|
@item BIT_NOT_EXPR
|
|
|
|
These nodes represent bitwise complement, and will always have integral
|
|
|
|
type. The only operand is the value to be complemented.
|
|
|
|
|
|
|
|
@item TRUTH_NOT_EXPR
|
|
|
|
These nodes represent logical negation, and will always have integral
|
2004-09-22 21:43:04 +02:00
|
|
|
(or boolean) type. The operand is the value being negated. The type
|
|
|
|
of the operand and that of the result are always of @code{BOOLEAN_TYPE}
|
|
|
|
or @code{INTEGER_TYPE}.
|
1999-09-19 17:50:40 +02:00
|
|
|
|
|
|
|
@item PREDECREMENT_EXPR
|
|
|
|
@itemx PREINCREMENT_EXPR
|
|
|
|
@itemx POSTDECREMENT_EXPR
|
|
|
|
@itemx POSTINCREMENT_EXPR
|
|
|
|
These nodes represent increment and decrement expressions. The value of
|
|
|
|
the single operand is computed, and the operand incremented or
|
|
|
|
decremented. In the case of @code{PREDECREMENT_EXPR} and
|
|
|
|
@code{PREINCREMENT_EXPR}, the value of the expression is the value
|
|
|
|
resulting after the increment or decrement; in the case of
|
|
|
|
@code{POSTDECREMENT_EXPR} and @code{POSTINCREMENT_EXPR} is the value
|
|
|
|
before the increment or decrement occurs. The type of the operand, like
|
|
|
|
that of the result, will be either integral, boolean, or floating-point.
|
|
|
|
|
|
|
|
@item ADDR_EXPR
|
|
|
|
These nodes are used to represent the address of an object. (These
|
2000-06-05 03:42:22 +02:00
|
|
|
expressions will always have pointer or reference type.) The operand may
|
1999-09-19 17:50:40 +02:00
|
|
|
be another expression, or it may be a declaration.
|
|
|
|
|
2000-09-24 23:47:45 +02:00
|
|
|
As an extension, GCC allows users to take the address of a label. In
|
1999-09-19 17:50:40 +02:00
|
|
|
this case, the operand of the @code{ADDR_EXPR} will be a
|
|
|
|
@code{LABEL_DECL}. The type of such an expression is @code{void*}.
|
|
|
|
|
2000-02-10 10:07:59 +01:00
|
|
|
If the object addressed is not an lvalue, a temporary is created, and
|
|
|
|
the address of the temporary is used.
|
|
|
|
|
c-tree.texi, [...]: Remove trailing whitespace.
* c-tree.texi, contrib.texi, cpp.texi, extend.texi, gcc.texi,
gcov.texi, install.texi, md.texi, objc.texi, rtl.texi, tm.texi:
Remove trailing whitespace.
From-SVN: r42678
2001-05-28 22:57:50 +02:00
|
|
|
@item INDIRECT_REF
|
1999-09-19 17:50:40 +02:00
|
|
|
These nodes are used to represent the object pointed to by a pointer.
|
|
|
|
The operand is the pointer being dereferenced; it will always have
|
|
|
|
pointer or reference type.
|
|
|
|
|
|
|
|
@item FIX_TRUNC_EXPR
|
|
|
|
These nodes represent conversion of a floating-point value to an
|
2007-01-28 00:51:49 +01:00
|
|
|
integer. The single operand will have a floating-point type, while
|
1999-09-19 17:50:40 +02:00
|
|
|
the complete expression will have an integral (or boolean) type. The
|
|
|
|
operand is rounded towards zero.
|
|
|
|
|
|
|
|
@item FLOAT_EXPR
|
|
|
|
These nodes represent conversion of an integral (or boolean) value to a
|
|
|
|
floating-point value. The single operand will have integral type, while
|
c-tree.texi, [...]: Remove trailing whitespace.
* c-tree.texi, contrib.texi, cpp.texi, extend.texi, gcc.texi,
gcov.texi, install.texi, md.texi, objc.texi, rtl.texi, tm.texi:
Remove trailing whitespace.
From-SVN: r42678
2001-05-28 22:57:50 +02:00
|
|
|
the complete expression will have a floating-point type.
|
1999-09-19 17:50:40 +02:00
|
|
|
|
|
|
|
FIXME: How is the operand supposed to be rounded? Is this dependent on
|
c-tree.texi, [...]: Use more logical markup.
* doc/c-tree.texi, doc/contrib.texi, doc/extend.texi,
doc/gcc.texi, doc/gcov.texi, doc/install-old.texi,
doc/invoke.texi, doc/md.texi, doc/rtl.texi, doc/tm.texi: Use more
logical markup. Use TeX quotes and dashes. Use @dots{} and
@minus{}. Avoid spaces inside @var. Update last modification
date in gcc.texi.
* doc/gcc.1, doc/gcov.1: Regenerate.
From-SVN: r43369
2001-06-14 13:08:04 +02:00
|
|
|
@option{-mieee}?
|
1999-09-19 17:50:40 +02:00
|
|
|
|
2000-04-22 14:01:30 +02:00
|
|
|
@item COMPLEX_EXPR
|
|
|
|
These nodes are used to represent complex numbers constructed from two
|
|
|
|
expressions of the same (integer or real) type. The first operand is the
|
|
|
|
real part and the second operand is the imaginary part.
|
|
|
|
|
|
|
|
@item CONJ_EXPR
|
|
|
|
These nodes represent the conjugate of their operand.
|
|
|
|
|
|
|
|
@item REALPART_EXPR
|
2003-12-30 16:00:43 +01:00
|
|
|
@itemx IMAGPART_EXPR
|
2000-04-22 14:01:30 +02:00
|
|
|
These nodes represent respectively the real and the imaginary parts
|
|
|
|
of complex numbers (their sole argument).
|
|
|
|
|
1999-09-19 17:50:40 +02:00
|
|
|
@item NON_LVALUE_EXPR
|
|
|
|
These nodes indicate that their one and only operand is not an lvalue.
|
2001-06-21 02:03:48 +02:00
|
|
|
A back end can treat these identically to the single operand.
|
1999-09-19 17:50:40 +02:00
|
|
|
|
|
|
|
@item NOP_EXPR
|
|
|
|
These nodes are used to represent conversions that do not require any
|
|
|
|
code-generation. For example, conversion of a @code{char*} to an
|
|
|
|
@code{int*} does not require any code be generated; such a conversion is
|
|
|
|
represented by a @code{NOP_EXPR}. The single operand is the expression
|
|
|
|
to be converted. The conversion from a pointer to a reference is also
|
|
|
|
represented with a @code{NOP_EXPR}.
|
|
|
|
|
|
|
|
@item CONVERT_EXPR
|
|
|
|
These nodes are similar to @code{NOP_EXPR}s, but are used in those
|
|
|
|
situations where code may need to be generated. For example, if an
|
|
|
|
@code{int*} is converted to an @code{int} code may need to be generated
|
|
|
|
on some platforms. These nodes are never used for C++-specific
|
|
|
|
conversions, like conversions between pointers to different classes in
|
|
|
|
an inheritance hierarchy. Any adjustments that need to be made in such
|
|
|
|
cases are always indicated explicitly. Similarly, a user-defined
|
|
|
|
conversion is never represented by a @code{CONVERT_EXPR}; instead, the
|
|
|
|
function calls are made explicit.
|
|
|
|
|
|
|
|
@item THROW_EXPR
|
|
|
|
These nodes represent @code{throw} expressions. The single operand is
|
1999-09-27 03:27:18 +02:00
|
|
|
an expression for the code that should be executed to throw the
|
|
|
|
exception. However, there is one implicit action not represented in
|
|
|
|
that expression; namely the call to @code{__throw}. This function takes
|
1999-09-28 09:40:15 +02:00
|
|
|
no arguments. If @code{setjmp}/@code{longjmp} exceptions are used, the
|
2001-06-21 02:03:48 +02:00
|
|
|
function @code{__sjthrow} is called instead. The normal GCC back end
|
1999-09-27 03:27:18 +02:00
|
|
|
uses the function @code{emit_throw} to generate this code; you can
|
|
|
|
examine this function to see what needs to be done.
|
1999-09-19 17:50:40 +02:00
|
|
|
|
|
|
|
@item LSHIFT_EXPR
|
|
|
|
@itemx RSHIFT_EXPR
|
|
|
|
These nodes represent left and right shifts, respectively. The first
|
|
|
|
operand is the value to shift; it will always be of integral type. The
|
|
|
|
second operand is an expression for the number of bits by which to
|
|
|
|
shift. Right shift should be treated as arithmetic, i.e., the
|
|
|
|
high-order bits should be zero-filled when the expression has unsigned
|
|
|
|
type and filled with the sign bit when the expression has signed type.
|
2001-07-19 20:33:30 +02:00
|
|
|
Note that the result is undefined if the second operand is larger
|
2004-12-14 18:24:46 +01:00
|
|
|
than or equal to the first operand's type size.
|
2001-07-19 20:33:30 +02:00
|
|
|
|
1999-09-19 17:50:40 +02:00
|
|
|
|
|
|
|
@item BIT_IOR_EXPR
|
|
|
|
@itemx BIT_XOR_EXPR
|
|
|
|
@itemx BIT_AND_EXPR
|
|
|
|
These nodes represent bitwise inclusive or, bitwise exclusive or, and
|
|
|
|
bitwise and, respectively. Both operands will always have integral
|
|
|
|
type.
|
|
|
|
|
|
|
|
@item TRUTH_ANDIF_EXPR
|
|
|
|
@itemx TRUTH_ORIF_EXPR
|
2007-02-01 06:36:17 +01:00
|
|
|
These nodes represent logical ``and'' and logical ``or'', respectively.
|
|
|
|
These operators are not strict; i.e., the second operand is evaluated
|
|
|
|
only if the value of the expression is not determined by evaluation of
|
|
|
|
the first operand. The type of the operands and that of the result are
|
|
|
|
always of @code{BOOLEAN_TYPE} or @code{INTEGER_TYPE}.
|
1999-09-19 17:50:40 +02:00
|
|
|
|
|
|
|
@item TRUTH_AND_EXPR
|
|
|
|
@itemx TRUTH_OR_EXPR
|
|
|
|
@itemx TRUTH_XOR_EXPR
|
|
|
|
These nodes represent logical and, logical or, and logical exclusive or.
|
|
|
|
They are strict; both arguments are always evaluated. There are no
|
2001-06-21 02:03:48 +02:00
|
|
|
corresponding operators in C or C++, but the front end will sometimes
|
1999-09-19 17:50:40 +02:00
|
|
|
generate these expressions anyhow, if it can tell that strictness does
|
2004-09-22 21:43:04 +02:00
|
|
|
not matter. The type of the operands and that of the result are
|
|
|
|
always of @code{BOOLEAN_TYPE} or @code{INTEGER_TYPE}.
|
1999-09-19 17:50:40 +02:00
|
|
|
|
[multiple changes]
2007-06-15 Andrew Pinski <andrew_pinski@playstation.sony.com>
Zdenek Dvorak <dvorakz@suse.cz>
Richard Guenther <rguenther@suse.de>
Kaz Kojima <kkojima@gcc.gnu.org>
* tree-vrp.c (compare_values_warnv): Convert val2 to
the type of val1.
(extract_range_from_assert): Create
POINTER_PLUS_EXPR for pointer types.
(extract_range_from_binary_expr): Handle
only POINTER_PLUS_EXPR, MIN_EXPR, and MAX_EXPR
for pointer types.
* doc/c-tree.texi (POINTER_PLUS_EXPR): Document.
* tree-ssa-loop-niter.c (split_to_var_and_offset): Handle
POINTER_PLUS_EXPR as PLUS_EXPR.
(number_of_iterations_lt_to_ne):
For pointer types, use sizetype when
creating MINUS_EXPR/PLUS_EXPRs.
(assert_loop_rolls_lt): For pointer types, use sizetype when
creating MINUS_EXPR/PLUS_EXPRs.
(number_of_iterations_le): Likewise.
(expand_simple_operations): POINTER_PLUS_EXPR are simple also.
(derive_constant_upper_bound): Handle POINTER_PLUS_EXPR just
like PLUS_EXPR and MINUS_EXPR.
* tree-pretty-print.c (dump_generic_node): Handle
POINTER_PLUS_EXPR.
(op_prio): Likewise.
(op_symbol_1): Likewise.
* optabs.c (optab_for_tree_code): Likewise.
* tree-ssa-loop-manip.c (create_iv): Handle pointer base
specially.
* tree-tailcall.c (process_assignment): Mention
POINTER_PLUS_EXPR in a TODO comment.
* tree.c (build2_stat): Assert when trying to use PLUS_EXPR or
MINUS_EXPR with a pointer. Also assert for POINTER_PLUS_EXPR
not used with a pointer and an integer type.
* tree-scalar-evolution.c (add_to_evolution_1): Convert the
increment using chrec_convert_rhs instead of chrec_convert.
(follow_ssa_edge_in_rhs): Handle POINTER_PLUS_EXPR like
PLUS_EXPR except for the right hand side's type will be
sizetype.
(interpret_rhs_modify_stmt): Handle POINTER_PLUS_EXPR.
(fold_used_pointer_cast): Kill.
(pointer_offset_p): Kill.
(fold_used_pointer): Kill.
(pointer_used_p): Kill.
(analyze_scalar_evolution_1 <case GIMPLE_MODIFY_STMT>): Don't
call fold_used_pointer.
(instantiate_parameters_1): Convert the increment
using chrec_convert_rhs instead of chrec_convert.
Handle POINTER_PLUS_EXPR as PLUS_EXPR.
* builtins.c (get_pointer_alignment): Handle POINTER_PLUS_EXPR
instead of PLUS_EXPR.
(expand_builtin_strcat): Create a POINTER_PLUS_EXPR instead of
PLUS_EXPR for pointers.
(std_gimplify_va_arg_expr): Likewise.
(fold_builtin_memory_op): Likewise.
(fold_builtin_strstr): Likewise.
(fold_builtin_strchr): Likewise.
(fold_builtin_strrchr): Likewise.
(fold_builtin_strpbrk): Likewise.
(expand_builtin_memory_chk): Likewise.
(fold_builtin_memory_chk): Likewise.
(std_expand_builtin_va_start): Use
sizetype for the call to make_tree and then convert
to the pointer type.
(fold_builtin_memchr): Use POINTER_PLUS_EXPR
instead of PLUS_EXPR for adding to a pointer.
(std_gimplify_va_arg_expr): Use fold_build2 for
the creating of POINTER_PLUS_EXPR. For the BIT_AND_EXPR, cast
the operands to sizetype first and then cast the BIT_AND_EXPR
back to the pointer type.
* fold-const.c (build_range_check): Handle pointer types
specially.
(extract_array_ref): Look for POINTER_PLUS_EXPR instead
of PLUS_EXPR's. Make sure the offset is converted to
sizetype.
(try_move_mult_to_index): Strip the NOPs from the offset.
Remove code argument and replace all uses with PLUS_EXPR.
(fold_to_nonsharp_ineq_using_bound): Handle pointer types
specially. Don't use a pointer type for MINUS_EXPR.
(fold_unary): Handle for (T1)(X op Y),
only p+ as that is the only as that can be handled for
binary operators now.
(fold_binary <case POINTER_PLUS_EXPR>): Add folding of
POINTER_PLUS_EXPR.
<case PLUS_EXPR>: Add folding of PTR+INT into
PTR p+ INT.
Don't call try_move_mult_to_index.
<case MINUS_EXPR>: Fold (PTR0 p+ A) - (PTR1 p+ B)
into (PTR0 - PTR1) + (A - B). Fold (PTR0 p+ A) - PTR1 into
(PTR0 - PTR1) + A iff (PTR0 - PTR1) simplifies.
Don't call try_move_mult_to_index.
(tree_expr_nonnegative_warnv_p): Handle POINTER_PLUS_EXPR.
(tree_expr_nonzero_p): Likewise.
(fold_indirect_ref_1): Look at POINTER_PLUS_EXPR instead
of PLUS_EXPR for the complex expression folding.
* tree-chrec.c (chrec_fold_plus_poly_poly): If the
first chrec is a pointer type, then the second should
be sizetype and not the first's type.
For POINTER_PLUS_EXPR, use a different right hand side type.
Handle POINTER_PLUS_EXPR like PLUS_EXPR.
(chrec_fold_plus_1): For POINTER_PLUS_EXPR, use a
different right hand side type.
Handle POINTER_PLUS_EXPR like PLUS_EXPR.
(chrec_fold_plus): For pointer types, use POINTER_PLUS_EXPR
instead of PLUS_EXPR.
When either operand is zero, convert the other operand.
(chrec_apply): Use chrec_convert_rhs
on the argument x instead of chrec_convert.
(reset_evolution_in_loop): For pointer types, the new_evol
should be sizetype.
(convert_affine_scev): For POINTER_PLUS_EXPR, use a
different right hand side type.
Handle POINTER_PLUS_EXPR like PLUS_EXPR.
(chrec_convert_rhs): New function.
(chrec_convert_aggressive): For POINTER_PLUS_EXPR, use a
different right hand side type.
Handle POINTER_PLUS_EXPR like PLUS_EXPR.
* tree-chrec.h (chrec_convert_rhs): New prototype.
(build_polynomial_chrec): For pointer types, the right hand
* tree-ssa-ccp.c (maybe_fold_stmt_indirect): Look for
POINTER_PLUS_EXPR instead of PLUS_EXPR's.
Remove subtraction case as it is always addition now.
Make sure the offset is converted to sizetype.
(fold_stmt_r): Don't handle PLUS_EXPR/MINUS_EXPR specially.
Handle POINTER_PLUS_EXPR like PLUS_EXPR was handled before.
* tree-ssa-loop-ivopts.c (determine_base_object): Abort for
PLUS_EXPR in pointer type.
Handle POINTER_PLUS_EXPR.
(tree_to_aff_combination): Likewise.
(force_expr_to_var_cost): Likewise.
(force_expr_to_var_cost): Likewise. Create a POINTER_PLUS_EXPR
instead of PLUS_EXPR for pointers.
* c-format.c (check_format_arg): Handle POINTER_PLUS_EXPR
instead of PLUS_EXPR of pointer types.
* tree-stdarg.c (va_list_counter_bump): Handle POINTER_PLUS_EXPR
as PLUS_EXPR.
(check_va_list_escapes): Likewise.
(check_all_va_list_escapes): Likewise.
* dwarf2out.c (loc_descriptor_from_tree_1):
Handle POINT_PLUS_EXPR as a PLUS_EXPR.
* expr.c (expand_expr_real_1): Handle POINTER_PLUS_EXPR.
(string_constant): Likewise.
* tree-ssa-address.c (tree_mem_ref_addr): When adding
the offset to the base, use POINTER_PLUS_EXPR.
(add_to_parts): Convert the index to sizetype.
(create_mem_ref): Create A POINTER_PLUS_EXPR for the one case.
* matrix-reorg.c (collect_data_for_malloc_call): Stmt
will now only be either INDIRECT_REF and POINTER_PLUS_EXPR.
Offset only holds something for PLUS_EXPR.
(ssa_accessed_in_tree): Handle POINTER_PLUS_EXPR just as
a PLUS_EXPR.
(analyze_transpose): POINTER_PLUS_EXPR will only show up now
and not PLUS_EXPR.
(analyze_accesses_for_modify_stmt): Likewise.
Remove comment about the type being integral type as it is
wrong now.
(can_calculate_expr_before_stmt): Handle POINTER_PLUS_EXPR as
PLUS_EXPR.
(transform_access_sites): POINTER_PLUS_EXPR will only show up now
and not PLUS_EXPR.
Correct the type which the artimentic is done in (is now
sizetype).
Reindent one loop.
* tree-data-ref.c (split_constant_offset): Handle
POINTER_PLUS_EXPR
* tree-affine.c (tree_to_aff_combination): Likewise.
* c-typeck.c (build_unary_op): For pointers create the increment
as a sizetype. Create a POINTER_PLUS_EXPR instead of PLUS_EXPR
for pointers.
* gimplify.c (gimplify_self_mod_expr): Create a
POINTER_PLUS_EXPR instead of PLUS_EXPR for pointers.
(gimplify_omp_atomic_fetch_op): Handle POINTER_PLUS_EXPR.
* tree.def (POINTER_PLUS_EXPR): New tree code.
* tree-predcom.c (ref_at_iteration): If we have a pointer
type do the multiplication in sizetype.
* tree-mudflap.c (mf_xform_derefs_1): Create a
POINTER_PLUS_EXPR instead of PLUS_EXPR for pointers.
* tree-ssa-forwprop.c
(forward_propagate_addr_into_variable_array_index):
Don't expect there to be a cast for the index as that
does not exist anymore.
(forward_propagate_addr_expr_1): Check for POINTER_PLUS_EXPR
instead of PLUS_EXPR.
Don't check for the first operand of the POINTER_PLUS_EXPR
was the index as it cannot be.
Call forward_propagate_addr_into_variable_array_index with
the SSA_NAME instead of the statement.
* varasm.c (const_hash_1): Handle POINTER_PLUS_EXPR.
(compare_constant): Likewise.
(copy_constant): Likewise.
(compute_reloc_for_constant): Likewise.
(output_addressed_constants): Likewise.
(initializer_constant_valid_p): Likewise.
* tree-ssa.c (tree_ssa_useless_type_conversion_1):
Convert the MIN/MAX of the inner type to the outer
type before comparing them.
* tree-ssa-loop-prefetch.c (idx_analyze_ref): Handle
POINTER_PLUS_EXPR instead of PLUS_EXPR.
(issue_prefetch_ref): Create a POINTER_PLUS_EXPR instead
of PLUS_EXPR for pointers.
* tree-inline.c (estimate_num_insns_1): Handle
POINTER_PLUS_EXPR.
* tree-vect-transform.c (vect_create_addr_base_for_vector_ref):
Create a POINTER_PLUS_EXPR instead of PLUS_EXPR for pointers.
(bump_vector_ptr): Create a POINTER_PLUS_EXPR
instead of PLUS_EXPR for the pointer increment statement.
(vect_update_ivs_after_vectorizer): For pointer types, create
POINTER_PLUS_EXPR instead of PLUS_EXPR and also create
MULT_EXPR in sizetype.
(vect_gen_niters_for_prolog_loop): Add a cast when creating
byte_misalign.
* tree-object-size.c (plus_expr_object_size): Handle
POINTER_PLUS_EXPR instead of PLUS_EXPR. Removing all the extra
code which is trying to figure out which side is a pointer and
is the index.
(check_for_plus_in_loops_1): Likewise.
(check_for_plus_in_loops): Likewise.
* c-common.c (pointer_int_sum): Create a
POINTER_PLUS_EXPR instead of PLUS_EXPR for pointers.
* tree-ssa-structalias.c (handle_ptr_arith): Handle
only POINTER_PLUS_EXPR. Removing all the extra
code which is trying to figure out which side is a pointer and
is the index.
* tree-cfg.c (verify_expr): Add extra checking for pointers and
PLUS_EXPR and MINUS_EXPR.
Also add checking to make sure the operands of POINTER_PLUS_EXPR
are correct.
* config/frv/frv.c (frv_expand_builtin_va_start): Use sizetype
with make_tree, instead of a pointer type.
* config/s390/s390.c (s390_va_start): Use POINTER_PLUS_EXPR
for pointers instead of PLUS_EXPR.
(s390_gimplify_va_arg): Likewise.
* config/spu/spu.c (spu_va_start): Create POINTER_PLUS_EXPR
instead of PLUS_EXPR when doing addition on pointer
types. Use sizetype for the second operand.
(spu_gimplify_va_arg_expr): Likewise.
* config/sparc/sparc.c (sparc_gimplify_va_arg): Use
POINTER_PLUS_EXPR instead of PLUS_EXPR when the operand was
a pointer. Don't create a BIT_AND_EXPR for pointer types.
* config/i386/i386.c (ix86_va_start): Use POINTER_PLUS_EXPR
for the pointer addition and also use size_int/sizetype
for the offset.
(ix86_gimplify_va_arg): Likewise.
Perform BIT_AND_EXPR on sizetype arguments.
* config/sh/sh.c (sh_va_start): Call make_tree with sizetype
and convert its result to a pointer type. Use POINTER_PLUS_EXPR
for the pointer additions and also use size_int for the offsets.
(sh_gimplify_va_arg_expr): Use POINTER_PLUS_EXPR for the pointer
additions and also use size_int for the offsets. Perform
BIT_AND_EXPR on sizetype arguments.
* config/ia64/ia64.c (ia64_gimplify_va_arg): Use
POINTER_PLUS_EXPR for pointers and create the
BIT_AND_EXPR in sizetype.
* config/rs6000/rs6000.c (rs6000_va_start): Use POINTER_PLUS_EXPR
instead of PLUS_EXPR for pointer addition.
(rs6000_va_start): Likewise.
Also use sizetype for the offset.
* config/pa/pa.c (reloc_needed): Handle POINTER_PLUS_EXPR
as PLUS_EXPR/MINUS_EXPR.
(hppa_gimplify_va_arg_expr): Don't create MINUS_EXPR or
PLUS_EXPR for pointers, instead use POINTER_PLUS_EXPR.
Don't use BIT_AND_EXPR on a pointer type, convert the
expression to sizetype first.
* config/mips/mips.c (mips_va_start): Use POINTER_PLUS_EXPR
for pointers.
(mips_gimplify_va_arg_expr): Likewise.
Don't create BIT_AND_EXPR in a pointer type.
2007-06-15 Andrew Pinski <andrew_pinski@playstation.sony.com>
* trans-intrinsic.c (gfc_conv_intrinsic_repeat): Use
POINTER_PLUS_EXPR instead of PLUS_EXPR for pointer addition.
* trans-expr.c (gfc_trans_string_copy): Create
POINTER_PLUS_EXPR instead of a PLUS_EXPR
for pointer types.
2007-06-15 Andrew Pinski <andrew_pinski@playstation.sony.com>
* typeck.c (build_binary_op): For templates build the
expression in pieces to avoid the assert in build2_stat.
(get_member_function_from_ptrfunc):
Change over to using POINTER_PLUS_EXPR and convert
the second operand to sizetype.
* typeck2.c (build_m_component_ref): Likewise.
* init.c (expand_virtual_init): Create a POINTER_PLUS_EXPR
instead of PLUS_EXPR for pointers.
(build_new_1): Likewise.
(build_vec_delete_1): Likewise.
(build_vec_delete): Likewise.
* class.c (build_base_path): Likewise.
(build_base_path): Likewise.
(convert_to_base_statically): Likewise.
(fixed_type_or_null): Handle POINTER_PLUS_EXPR.
(get_vtbl_decl_for_binfo): Handle POINTER_PLUS_EXPR
instead of PLUS_EXPR.
(dfs_accumulate_vtbl_inits): Create a POINTER_PLUS_EXPR
instead of PLUS_EXPR for pointers.
* call.c (build_special_member_call): Likewise.
* rtti.c (build_headof): Likewise.
Use sizetype instead of ptrdiff_type_node.
(tinfo_base_init): Create a POINTER_PLUS_EXPR
instead of PLUS_EXPR for pointers.
* except.c (expand_start_catch_block): Do a
NEGATIVE and then a POINTER_PLUS_EXPR instead
of a MINUS_EXPR.
* cp-gimplify.c (cxx_omp_clause_apply_fn): Convert
PLUS_EXPR on pointer types over to use
POINTER_PLUS_EXPR and remove the conversion
to the pointer types.
* method.c (thunk_adjust): Use POINTER_PLUS_EXPR for
adding to a pointer type. Use size_int instead of
ssize_int. Convert the index to sizetype before
adding it to the pointer.
2007-06-15 Andrew Pinski <andrew_pinski@playstation.sony.com>
* trans.c (Attribute_to_gnu): When subtracting an
offset from a pointer, use POINTER_PLUS_EXPR with
NEGATE_EXPR instead of MINUS_EXPR.
(gnat_to_gnu): Likewise.
* utils.c (convert): When converting between
thin pointers, use POINTER_PLUS_EXPR and sizetype
for the offset.
* utils2.c (known_alignment): POINTER_PLUS_EXPR
have the same semantics as PLUS_EXPR for alignment.
(build_binary_op): Add support for the semantics of
POINTER_PLUS_EXPR's operands.
When adding an offset to a pointer, use POINTER_PLUS_EXPR.
2007-06-15 Andrew Pinski <andrew_pinski@playstation.sony.com>
* class.c (make_class_data): Build the index in sizetype.
Use POINTER_PLUS_EXPR instead of PLUS_EXPR when
adding to a pointer type.
(build_symbol_entry): Likewise.
* expr.c (build_java_arrayaccess): Likewise.
(build_field_ref): Likewise.
(build_known_method_ref): Likewise.
(build_invokevirtual): Likewise.
* except.c (build_exception_object_ref): Do a
NEGATIVE and then a POINTER_PLUS_EXPR instead
of a MINUS_EXPR.
2007-06-15 Andrew Pinski <andrew_pinski@playstation.sony.com>
PR tree-opt/32225
* gcc.c-torture/compile/20070605-1.c: New test.
* gcc.c-torture/compile/20070603-1.c: New testcase.
* gcc.c-torture/compile/20070603-2.c: New testcase.
* gcc.c-torture/compile/20070531-1.c: New test.
PR tree-opt/32167
* gcc.c-torture/compile/20070531-2.c: New test.
PR tree-opt/32144
* gcc.c-torture/compile/20070529-1.c: New test.
PR tree-opt/32145
* gcc.c-torture/compile/20070529-2.c: New test.
PR tree-opt/32015
* gcc.c-torture/compile/20070520-1.c: New test.
* g++.dg/ext/java-1.C: New test.
* gcc.dg/vect/vect-106.c: We are now able to vectorize two
loops instead of one. Remove the "can't determine dependence"
check.
* gcc.dg/tree-ssa/20030815-1.c: Remove testcase which is no longer
needed as the cast is gone in the first place.
* gcc.dg/max-1.c: Change local variable a to be a global one.
* gcc.dg/tree-ssa/ssa-pre-8.c: Update testcase since we don't
have a cast which is PREd.
From-SVN: r125755
2007-06-16 07:42:36 +02:00
|
|
|
@itemx POINTER_PLUS_EXPR
|
|
|
|
This node represents pointer arithmetic. The first operand is always
|
|
|
|
a pointer/reference type. The second operand is always an unsigned
|
|
|
|
integer type compatible with sizetype. This is the only binary
|
|
|
|
arithmetic operand that can operate on pointer types.
|
|
|
|
|
1999-09-19 17:50:40 +02:00
|
|
|
@itemx PLUS_EXPR
|
|
|
|
@itemx MINUS_EXPR
|
|
|
|
@itemx MULT_EXPR
|
|
|
|
These nodes represent various binary arithmetic operations.
|
|
|
|
Respectively, these operations are addition, subtraction (of the second
|
2004-05-31 00:20:07 +02:00
|
|
|
operand from the first) and multiplication. Their operands may have
|
|
|
|
either integral or floating type, but there will never be case in which
|
|
|
|
one operand is of floating type and the other is of integral type.
|
1999-09-19 17:50:40 +02:00
|
|
|
|
2003-05-31 15:23:32 +02:00
|
|
|
The behavior of these operations on signed arithmetic overflow is
|
|
|
|
controlled by the @code{flag_wrapv} and @code{flag_trapv} variables.
|
|
|
|
|
2004-05-31 00:20:07 +02:00
|
|
|
@item RDIV_EXPR
|
|
|
|
This node represents a floating point division operation.
|
|
|
|
|
|
|
|
@item TRUNC_DIV_EXPR
|
|
|
|
@itemx FLOOR_DIV_EXPR
|
|
|
|
@itemx CEIL_DIV_EXPR
|
|
|
|
@itemx ROUND_DIV_EXPR
|
|
|
|
These nodes represent integer division operations that return an integer
|
|
|
|
result. @code{TRUNC_DIV_EXPR} rounds towards zero, @code{FLOOR_DIV_EXPR}
|
|
|
|
rounds towards negative infinity, @code{CEIL_DIV_EXPR} rounds towards
|
|
|
|
positive infinity and @code{ROUND_DIV_EXPR} rounds to the closest integer.
|
c-tree.texi, [...]: Correct end-of-sentence markup and markup of "etc.", "e.g." and "i.e.".
* doc/c-tree.texi, doc/cfg.texi, doc/contrib.texi, doc/cpp.texi,
doc/cppopts.texi, doc/extend.texi, doc/fragments.texi,
doc/frontends.texi, doc/gcov.texi, doc/hostconfig.texi,
doc/implement-c.texi, doc/install.texi, doc/invoke.texi,
doc/libgcc.texi, doc/md.texi, doc/passes.texi,
doc/portability.texi, doc/rtl.texi, doc/sourcebuild.texi,
doc/standards.texi, doc/tm.texi, doc/tree-ssa.texi,
doc/trouble.texi: Correct end-of-sentence markup and markup of
"etc.", "e.g." and "i.e.". Use @code in various places where
appropriate.
From-SVN: r90101
2004-11-05 02:36:57 +01:00
|
|
|
Integer division in C and C++ is truncating, i.e.@: @code{TRUNC_DIV_EXPR}.
|
2004-05-31 00:20:07 +02:00
|
|
|
|
|
|
|
The behavior of these operations on signed arithmetic overflow, when
|
|
|
|
dividing the minimum signed integer by minus one, is controlled by the
|
|
|
|
@code{flag_wrapv} and @code{flag_trapv} variables.
|
|
|
|
|
|
|
|
@item TRUNC_MOD_EXPR
|
|
|
|
@itemx FLOOR_MOD_EXPR
|
|
|
|
@itemx CEIL_MOD_EXPR
|
|
|
|
@itemx ROUND_MOD_EXPR
|
|
|
|
These nodes represent the integer remainder or modulus operation.
|
|
|
|
The integer modulus of two operands @code{a} and @code{b} is
|
|
|
|
defined as @code{a - (a/b)*b} where the division calculated using
|
|
|
|
the corresponding division operator. Hence for @code{TRUNC_MOD_EXPR}
|
c-tree.texi, [...]: Correct end-of-sentence markup and markup of "etc.", "e.g." and "i.e.".
* doc/c-tree.texi, doc/cfg.texi, doc/contrib.texi, doc/cpp.texi,
doc/cppopts.texi, doc/extend.texi, doc/fragments.texi,
doc/frontends.texi, doc/gcov.texi, doc/hostconfig.texi,
doc/implement-c.texi, doc/install.texi, doc/invoke.texi,
doc/libgcc.texi, doc/md.texi, doc/passes.texi,
doc/portability.texi, doc/rtl.texi, doc/sourcebuild.texi,
doc/standards.texi, doc/tm.texi, doc/tree-ssa.texi,
doc/trouble.texi: Correct end-of-sentence markup and markup of
"etc.", "e.g." and "i.e.". Use @code in various places where
appropriate.
From-SVN: r90101
2004-11-05 02:36:57 +01:00
|
|
|
this definition assumes division using truncation towards zero, i.e.@:
|
2004-05-31 00:20:07 +02:00
|
|
|
@code{TRUNC_DIV_EXPR}. Integer remainder in C and C++ uses truncating
|
c-tree.texi, [...]: Correct end-of-sentence markup and markup of "etc.", "e.g." and "i.e.".
* doc/c-tree.texi, doc/cfg.texi, doc/contrib.texi, doc/cpp.texi,
doc/cppopts.texi, doc/extend.texi, doc/fragments.texi,
doc/frontends.texi, doc/gcov.texi, doc/hostconfig.texi,
doc/implement-c.texi, doc/install.texi, doc/invoke.texi,
doc/libgcc.texi, doc/md.texi, doc/passes.texi,
doc/portability.texi, doc/rtl.texi, doc/sourcebuild.texi,
doc/standards.texi, doc/tm.texi, doc/tree-ssa.texi,
doc/trouble.texi: Correct end-of-sentence markup and markup of
"etc.", "e.g." and "i.e.". Use @code in various places where
appropriate.
From-SVN: r90101
2004-11-05 02:36:57 +01:00
|
|
|
division, i.e.@: @code{TRUNC_MOD_EXPR}.
|
2004-05-31 00:20:07 +02:00
|
|
|
|
|
|
|
@item EXACT_DIV_EXPR
|
|
|
|
The @code{EXACT_DIV_EXPR} code is used to represent integer divisions where
|
|
|
|
the numerator is known to be an exact multiple of the denominator. This
|
|
|
|
allows the backend to choose between the faster of @code{TRUNC_DIV_EXPR},
|
|
|
|
@code{CEIL_DIV_EXPR} and @code{FLOOR_DIV_EXPR} for the current target.
|
|
|
|
|
1999-09-19 17:50:40 +02:00
|
|
|
@item ARRAY_REF
|
|
|
|
These nodes represent array accesses. The first operand is the array;
|
|
|
|
the second is the index. To calculate the address of the memory
|
|
|
|
accessed, you must scale the index by the size of the type of the array
|
2001-06-04 17:48:16 +02:00
|
|
|
elements. The type of these expressions must be the type of a component of
|
2004-09-01 23:22:24 +02:00
|
|
|
the array. The third and fourth operands are used after gimplification
|
|
|
|
to represent the lower bound and component size but should not be used
|
|
|
|
directly; call @code{array_ref_low_bound} and @code{array_ref_element_size}
|
|
|
|
instead.
|
2001-06-04 17:48:16 +02:00
|
|
|
|
|
|
|
@item ARRAY_RANGE_REF
|
|
|
|
These nodes represent access to a range (or ``slice'') of an array. The
|
|
|
|
operands are the same as that for @code{ARRAY_REF} and have the same
|
|
|
|
meanings. The type of these expressions must be an array whose component
|
|
|
|
type is the same as that of the first operand. The range of that array
|
|
|
|
type determines the amount of data these expressions access.
|
1999-09-19 17:50:40 +02:00
|
|
|
|
tree-ssa-address.c: New file.
* tree-ssa-address.c: New file.
* Makefile.in (tree-ssa-address.o): Add.
* expr.c (expand_expr_real_1): Do not handle REF_ORIGINAL on
INDIRECT_REFs. Handle TARGET_MEM_REFs.
* tree-eh.c (tree_could_trap_p): Handle TARGET_MEM_REFs.
* tree-flow.h (struct mem_address): New.
(struct affine_tree_combination): Moved from tree-ssa-loop-ivopts.c.
(create_mem_ref, addr_for_mem_ref, get_address_description,
maybe_fold_tmr, multiplier_allowed_in_address_p,
multiply_by_cost): Declare.
* tree-mudflap.c (mf_xform_derefs_1): Handle TARGET_MEM_REFs.
* tree-pretty-print.c (dump_generic_node): Ditto.
* tree-ssa-loop-im.c (for_each_index): Ditto.
* tree-ssa-loop-ivopts.c (may_be_unaligned_p,
find_interesting_uses_address): Ditto.
(rewrite_address_base, build_addr_strip_iref): Removed.
(struct affine_tree_combination): Moved to tree-flow.h.
(get_ref_tag, copy_ref_info): New functions.
(rewrite_use_address): Produce TARGET_MEM_REFs.
(tree_ssa_iv_optimize): Do not call update_ssa
and rewrite_into_loop_closed_ssa.
(tree_to_aff_combination): Use build_fold_addr_expr instead of
build_addr_strip_iref.
(unshare_aff_combination): New function.
(fold_affine_sum): Removed.
(get_computation_at): Use get_computation_aff. Unshare the result.
(get_computation_aff, multiplier_allowed_in_address_p): New function.
(multiply_by_cost): Exported.
(get_address_cost): Use multiplier_allowed_in_address_p.
* tree-ssa-operands.c (get_tmr_operands): New function.
(get_expr_operands): Handle TARGET_MEM_REFs.
* tree.c (copy_node_stat): Copy annotations for TARGET_MEM_REFs.
(build): Handle 7 arguments.
(build7_stat): New function.
* tree.def (TARGET_MEM_DEF): New.
* tree.h (REF_ORIGINAL): Removed.
(TMR_SYMBOL, TMR_BASE, TMR_INDEX, TMR_STEP, TMR_OFFSET, TMR_ORIGINAL,
TMR_TAG, build7): New macros.
(build7_stat, tree_mem_ref_addr, copy_mem_ref_info): Declare.
* tree-ssa-ccp.c (fold_stmt_r): Call maybe_fold_tmr.
* doc/c-tree.texi: Document TARGET_MEM_REF.
* doc/tree-ssa.texi: Add TARGET_MEM_REF to gimple grammar.
* gcc.dg/tree-ssa/loop-2.c: Update outcome.
* gcc.dg/tree-ssa/loop-3.c: Update outcome.
* gcc.dg/tree-ssa/loop-4.c: Update outcome.
* gcc.dg/tree-ssa/loop-9.c: New test.
From-SVN: r100708
2005-06-07 14:01:47 +02:00
|
|
|
@item TARGET_MEM_REF
|
|
|
|
These nodes represent memory accesses whose address directly map to
|
|
|
|
an addressing mode of the target architecture. The first argument
|
|
|
|
is @code{TMR_SYMBOL} and must be a @code{VAR_DECL} of an object with
|
|
|
|
a fixed address. The second argument is @code{TMR_BASE} and the
|
|
|
|
third one is @code{TMR_INDEX}. The fourth argument is
|
|
|
|
@code{TMR_STEP} and must be an @code{INTEGER_CST}. The fifth
|
|
|
|
argument is @code{TMR_OFFSET} and must be an @code{INTEGER_CST}.
|
|
|
|
Any of the arguments may be NULL if the appropriate component
|
|
|
|
does not appear in the address. Address of the @code{TARGET_MEM_REF}
|
|
|
|
is determined in the following way.
|
|
|
|
|
|
|
|
@smallexample
|
|
|
|
&TMR_SYMBOL + TMR_BASE + TMR_INDEX * TMR_STEP + TMR_OFFSET
|
|
|
|
@end smallexample
|
|
|
|
|
|
|
|
The sixth argument is the reference to the original memory access, which
|
|
|
|
is preserved for the purposes of the RTL alias analysis. The seventh
|
|
|
|
argument is a tag representing the results of tree level alias analysis.
|
|
|
|
|
1999-09-19 17:50:40 +02:00
|
|
|
@item LT_EXPR
|
|
|
|
@itemx LE_EXPR
|
|
|
|
@itemx GT_EXPR
|
|
|
|
@itemx GE_EXPR
|
|
|
|
@itemx EQ_EXPR
|
|
|
|
@itemx NE_EXPR
|
|
|
|
These nodes represent the less than, less than or equal to, greater
|
|
|
|
than, greater than or equal to, equal, and not equal comparison
|
|
|
|
operators. The first and second operand with either be both of integral
|
|
|
|
type or both of floating type. The result type of these expressions
|
2004-05-31 00:20:07 +02:00
|
|
|
will always be of integral or boolean type. These operations return
|
|
|
|
the result type's zero value for false, and the result type's one value
|
|
|
|
for true.
|
1999-09-19 17:50:40 +02:00
|
|
|
|
2004-05-31 00:20:07 +02:00
|
|
|
For floating point comparisons, if we honor IEEE NaNs and either operand
|
|
|
|
is NaN, then @code{NE_EXPR} always returns true and the remaining operators
|
|
|
|
always return false. On some targets, comparisons against an IEEE NaN,
|
|
|
|
other than equality and inequality, may generate a floating point exception.
|
re PR rtl-optimization/15649 (ICE with __builtin_isgreater and -ffast-math)
gcc/ChangeLog:
2004-05-27 Paolo Bonzini <bonzini@gnu.org>
Roger Sayle <roger@eyesopen.com>
PR rtl-optimization/15649
Add LTGT_EXPR and improve pretty-printing of unordered
comparisons.
* c-common.c (c_common_truthvalue_conversion):
Handle LTGT_EXPR.
* c-typeck.c (build_binary_op): Likewise.
* dojump.c (do_jump): Likewise.
* expr.c (expand_expr_real_1, do_store_flag): Likewise.
* predict.c (tree_predict_by_opcode): Likewise.
* real.c (real_compare): Likewise.
* tree-cfg.c (verify_expr): Likewise.
* tree-inline.c (estimate_num_insns_1): Likewise.
* tree-pretty-print.c (dump_generic_node): Likewise.
Handle ORDERED_EXPR, UNORDERED_EXPR.
(op_symbol): Print unordered comparisons differently
than ordered ones.
* tree.def (LTGT_EXPR): New '<' tree code.
* doc/c-tree.texi (Expressions): Document floating-point
comparison nodes.
Fold comparisons between floating point values.
* fold-const.c (enum comparison_code): New, from
#define'd constants. Define compcodes for unordered
comparisons and for invalid transformations.
(invert_tree_comparison): Add "honor_nans" parameter.
(fold_truthop): Revamp to work on floating-point types too.
(comparison_to_compcode): Support unordered comparisons.
Use new enum comparison_code.
(compcode_to_comparison): Likewise.
(combine_compcodes): New function.
(invert_truthvalue): Let invert_tree_comparison decide
whether it is valid to fold the comparison. Fold ORDERED
and UNORDERED even if flag_unsafe_math_optimizations is off,
and the remaining even if flag_unsafe_math_optimizations
is off but we are under -fno-trapping-math.
(fold_relational_const): Integer modes do not honor NaNs.
gcc/testsuite/ChangeLog:
2004-05-27 Paolo Bonzini <bonzini@gnu.org>
* gcc.c-torture/compare-fp-1.c, gcc.c-torture/compare-fp-2.c,
gcc.c-torture/compare-fp-3.c, gcc.c-torture/compare-fp-4.c,
gcc.c-torture/compare-fp-3.x, gcc.c-torture/compare-fp-4.x,
gcc.c-torture/pr15649-1.c: New.
Co-Authored-By: Roger Sayle <roger@eyesopen.com>
From-SVN: r82365
2004-05-28 18:37:08 +02:00
|
|
|
|
|
|
|
@item ORDERED_EXPR
|
|
|
|
@itemx UNORDERED_EXPR
|
2004-05-31 00:20:07 +02:00
|
|
|
These nodes represent non-trapping ordered and unordered comparison
|
|
|
|
operators. These operations take two floating point operands and
|
|
|
|
determine whether they are ordered or unordered relative to each other.
|
|
|
|
If either operand is an IEEE NaN, their comparison is defined to be
|
|
|
|
unordered, otherwise the comparison is defined to be ordered. The
|
|
|
|
result type of these expressions will always be of integral or boolean
|
|
|
|
type. These operations return the result type's zero value for false,
|
|
|
|
and the result type's one value for true.
|
|
|
|
|
re PR rtl-optimization/15649 (ICE with __builtin_isgreater and -ffast-math)
gcc/ChangeLog:
2004-05-27 Paolo Bonzini <bonzini@gnu.org>
Roger Sayle <roger@eyesopen.com>
PR rtl-optimization/15649
Add LTGT_EXPR and improve pretty-printing of unordered
comparisons.
* c-common.c (c_common_truthvalue_conversion):
Handle LTGT_EXPR.
* c-typeck.c (build_binary_op): Likewise.
* dojump.c (do_jump): Likewise.
* expr.c (expand_expr_real_1, do_store_flag): Likewise.
* predict.c (tree_predict_by_opcode): Likewise.
* real.c (real_compare): Likewise.
* tree-cfg.c (verify_expr): Likewise.
* tree-inline.c (estimate_num_insns_1): Likewise.
* tree-pretty-print.c (dump_generic_node): Likewise.
Handle ORDERED_EXPR, UNORDERED_EXPR.
(op_symbol): Print unordered comparisons differently
than ordered ones.
* tree.def (LTGT_EXPR): New '<' tree code.
* doc/c-tree.texi (Expressions): Document floating-point
comparison nodes.
Fold comparisons between floating point values.
* fold-const.c (enum comparison_code): New, from
#define'd constants. Define compcodes for unordered
comparisons and for invalid transformations.
(invert_tree_comparison): Add "honor_nans" parameter.
(fold_truthop): Revamp to work on floating-point types too.
(comparison_to_compcode): Support unordered comparisons.
Use new enum comparison_code.
(compcode_to_comparison): Likewise.
(combine_compcodes): New function.
(invert_truthvalue): Let invert_tree_comparison decide
whether it is valid to fold the comparison. Fold ORDERED
and UNORDERED even if flag_unsafe_math_optimizations is off,
and the remaining even if flag_unsafe_math_optimizations
is off but we are under -fno-trapping-math.
(fold_relational_const): Integer modes do not honor NaNs.
gcc/testsuite/ChangeLog:
2004-05-27 Paolo Bonzini <bonzini@gnu.org>
* gcc.c-torture/compare-fp-1.c, gcc.c-torture/compare-fp-2.c,
gcc.c-torture/compare-fp-3.c, gcc.c-torture/compare-fp-4.c,
gcc.c-torture/compare-fp-3.x, gcc.c-torture/compare-fp-4.x,
gcc.c-torture/pr15649-1.c: New.
Co-Authored-By: Roger Sayle <roger@eyesopen.com>
From-SVN: r82365
2004-05-28 18:37:08 +02:00
|
|
|
@item UNLT_EXPR
|
|
|
|
@itemx UNLE_EXPR
|
|
|
|
@itemx UNGT_EXPR
|
|
|
|
@itemx UNGE_EXPR
|
|
|
|
@itemx UNEQ_EXPR
|
|
|
|
@itemx LTGT_EXPR
|
2004-05-31 00:20:07 +02:00
|
|
|
These nodes represent the unordered comparison operators.
|
|
|
|
These operations take two floating point operands and determine whether
|
|
|
|
the operands are unordered or are less than, less than or equal to,
|
|
|
|
greater than, greater than or equal to, or equal respectively. For
|
|
|
|
example, @code{UNLT_EXPR} returns true if either operand is an IEEE
|
|
|
|
NaN or the first operand is less than the second. With the possible
|
|
|
|
exception of @code{LTGT_EXPR}, all of these operations are guaranteed
|
|
|
|
not to generate a floating point exception. The result
|
|
|
|
type of these expressions will always be of integral or boolean type.
|
|
|
|
These operations return the result type's zero value for false,
|
|
|
|
and the result type's one value for true.
|
re PR rtl-optimization/15649 (ICE with __builtin_isgreater and -ffast-math)
gcc/ChangeLog:
2004-05-27 Paolo Bonzini <bonzini@gnu.org>
Roger Sayle <roger@eyesopen.com>
PR rtl-optimization/15649
Add LTGT_EXPR and improve pretty-printing of unordered
comparisons.
* c-common.c (c_common_truthvalue_conversion):
Handle LTGT_EXPR.
* c-typeck.c (build_binary_op): Likewise.
* dojump.c (do_jump): Likewise.
* expr.c (expand_expr_real_1, do_store_flag): Likewise.
* predict.c (tree_predict_by_opcode): Likewise.
* real.c (real_compare): Likewise.
* tree-cfg.c (verify_expr): Likewise.
* tree-inline.c (estimate_num_insns_1): Likewise.
* tree-pretty-print.c (dump_generic_node): Likewise.
Handle ORDERED_EXPR, UNORDERED_EXPR.
(op_symbol): Print unordered comparisons differently
than ordered ones.
* tree.def (LTGT_EXPR): New '<' tree code.
* doc/c-tree.texi (Expressions): Document floating-point
comparison nodes.
Fold comparisons between floating point values.
* fold-const.c (enum comparison_code): New, from
#define'd constants. Define compcodes for unordered
comparisons and for invalid transformations.
(invert_tree_comparison): Add "honor_nans" parameter.
(fold_truthop): Revamp to work on floating-point types too.
(comparison_to_compcode): Support unordered comparisons.
Use new enum comparison_code.
(compcode_to_comparison): Likewise.
(combine_compcodes): New function.
(invert_truthvalue): Let invert_tree_comparison decide
whether it is valid to fold the comparison. Fold ORDERED
and UNORDERED even if flag_unsafe_math_optimizations is off,
and the remaining even if flag_unsafe_math_optimizations
is off but we are under -fno-trapping-math.
(fold_relational_const): Integer modes do not honor NaNs.
gcc/testsuite/ChangeLog:
2004-05-27 Paolo Bonzini <bonzini@gnu.org>
* gcc.c-torture/compare-fp-1.c, gcc.c-torture/compare-fp-2.c,
gcc.c-torture/compare-fp-3.c, gcc.c-torture/compare-fp-4.c,
gcc.c-torture/compare-fp-3.x, gcc.c-torture/compare-fp-4.x,
gcc.c-torture/pr15649-1.c: New.
Co-Authored-By: Roger Sayle <roger@eyesopen.com>
From-SVN: r82365
2004-05-28 18:37:08 +02:00
|
|
|
|
1999-09-19 17:50:40 +02:00
|
|
|
@item MODIFY_EXPR
|
|
|
|
These nodes represent assignment. The left-hand side is the first
|
|
|
|
operand; the right-hand side is the second operand. The left-hand side
|
|
|
|
will be a @code{VAR_DECL}, @code{INDIRECT_REF}, @code{COMPONENT_REF}, or
|
|
|
|
other lvalue.
|
|
|
|
|
|
|
|
These nodes are used to represent not only assignment with @samp{=} but
|
c-tree.texi, [...]: Fix spelling and typos.
* doc/c-tree.texi, doc/contrib.texi, doc/extend.texi,
doc/gcc.texi, doc/install.texi, doc/invoke.texi, doc/md.texi,
doc/objc.texi, doc/rtl.texi, doc/tm.texi: Fix spelling and typos.
Consistently use "built-in" and "bit-field". Minor logical markup
improvements.
* doc/gcc.1: Regenerate.
From-SVN: r43383
2001-06-15 00:51:18 +02:00
|
|
|
also compound assignments (like @samp{+=}), by reduction to @samp{=}
|
1999-09-19 17:50:40 +02:00
|
|
|
assignment. In other words, the representation for @samp{i += 3} looks
|
|
|
|
just like that for @samp{i = i + 3}.
|
|
|
|
|
|
|
|
@item INIT_EXPR
|
|
|
|
These nodes are just like @code{MODIFY_EXPR}, but are used only when a
|
2006-02-09 10:54:36 +01:00
|
|
|
variable is initialized, rather than assigned to subsequently. This
|
|
|
|
means that we can assume that the target of the initialization is not
|
|
|
|
used in computing its own value; any reference to the lhs in computing
|
|
|
|
the rhs is undefined.
|
1999-09-19 17:50:40 +02:00
|
|
|
|
|
|
|
@item COMPONENT_REF
|
|
|
|
These nodes represent non-static data member accesses. The first
|
|
|
|
operand is the object (rather than a pointer to it); the second operand
|
2004-09-01 23:22:24 +02:00
|
|
|
is the @code{FIELD_DECL} for the data member. The third operand represents
|
c-tree.texi, [...]: Remove trailing whitespace.
* doc/c-tree.texi, doc/cfg.texi, doc/extend.texi, doc/gty.texi,
doc/install.texi, doc/invoke.texi, doc/md.texi, doc/passes.texi,
doc/rtl.texi, doc/tm.texi, doc/tree-ssa.texi: Remove trailing
whitespace.
From-SVN: r90100
2004-11-05 01:53:49 +01:00
|
|
|
the byte offset of the field, but should not be used directly; call
|
2004-09-01 23:22:24 +02:00
|
|
|
@code{component_ref_field_offset} instead.
|
1999-09-19 17:50:40 +02:00
|
|
|
|
|
|
|
@item COMPOUND_EXPR
|
2000-09-24 23:47:45 +02:00
|
|
|
These nodes represent comma-expressions. The first operand is an
|
|
|
|
expression whose value is computed and thrown away prior to the
|
1999-09-19 17:50:40 +02:00
|
|
|
evaluation of the second operand. The value of the entire expression is
|
|
|
|
the value of the second operand.
|
|
|
|
|
|
|
|
@item COND_EXPR
|
2000-09-24 23:47:45 +02:00
|
|
|
These nodes represent @code{?:} expressions. The first operand
|
2001-10-10 01:11:55 +02:00
|
|
|
is of boolean or integral type. If it evaluates to a nonzero value,
|
1999-09-19 17:50:40 +02:00
|
|
|
the second operand should be evaluated, and returned as the value of the
|
|
|
|
expression. Otherwise, the third operand is evaluated, and returned as
|
2002-10-18 05:29:17 +02:00
|
|
|
the value of the expression.
|
|
|
|
|
|
|
|
The second operand must have the same type as the entire expression,
|
|
|
|
unless it unconditionally throws an exception or calls a noreturn
|
|
|
|
function, in which case it should have void type. The same constraints
|
|
|
|
apply to the third operand. This allows array bounds checks to be
|
|
|
|
represented conveniently as @code{(i >= 0 && i < 10) ? i : abort()}.
|
|
|
|
|
|
|
|
As a GNU extension, the C language front-ends allow the second
|
|
|
|
operand of the @code{?:} operator may be omitted in the source.
|
|
|
|
For example, @code{x ? : 3} is equivalent to @code{x ? x : 3},
|
|
|
|
assuming that @code{x} is an expression without side-effects.
|
|
|
|
In the tree representation, however, the second operand is always
|
|
|
|
present, possibly protected by @code{SAVE_EXPR} if the first
|
|
|
|
argument does cause side-effects.
|
1999-09-19 17:50:40 +02:00
|
|
|
|
|
|
|
@item CALL_EXPR
|
|
|
|
These nodes are used to represent calls to functions, including
|
tree.h (enum tree_code_class): Add tcc_vl_exp.
2007-02-15 Sandra Loosemore <sandra@codesourcery.com>
Brooks Moses <brooks.moses@codesourcery.com>
Lee Millward <lee.millward@codesourcery.com>
* tree.h (enum tree_code_class): Add tcc_vl_exp.
(VL_EXP_CLASS_P): New.
(TREE_OPERAND_CHECK): Use TREE_OPERAND_LENGTH instead of
TREE_CODE_LENGTH.
(TREE_OPERAND_CHECK_CODE): Likewise.
(GIMPLE_STMT_OPERAND_CHECK): Likewise.
(TREE_RTL_OPERAND_CHECK): Likewise.
(tree_operand_check_failed): Make second parameter the whole tree
instead of its code. Fixed callers.
(VL_EXP_CHECK): New.
(TREE_OPERAND_LENGTH): New.
(VL_EXP_OPERAND_LENGTH): New.
(CALL_EXPR_FN): New.
(CALL_EXPR_STATIC_CHAIN): New.
(CALL_EXPR_ARGS): New.
(CALL_EXPR_ARG): New.
(call_expr_nargs): New.
(CALL_EXPR_ARGP): New.
(build_nt_call_list): Declare.
(build_vl_exp_stat): Declare.
(build_vl_exp): New.
(build_call_list): Declare.
(build_call_nary): Declare.
(build_call_valist): Declare.
(build_call_array): Declare.
(call_expr_arg): Declare.
(call_expr_argp): Declare.
(call_expr_arglist): Declare.
(fold_build_call_list): Declare.
(fold_build_call_list_initializer): Declare.
(fold_call_expr): Declare to replace fold_builtin.
(fold_builtin_fputs): Update to agree with modified definition.
(fold_builtin_strcpy): Likewise.
(fold_builtin_strncpy): Likewise.
(fold_builtin_memory_chk): Likewise.
(fold_builtin_stxcpy_chk): Likewise.
(fold_builtin_strncpy_chk): Likewise.
(fold_builtin_next_arg): Likewise.
(fold_build_call_expr): Declare.
(fold_builtin_call_list): Declare.
(fold_builtin_call_valist): Declare.
(build_call_expr): Declare.
(validate_arglist): Update to agree with modified definition.
(tree_operand_length): New.
(call_expr_arg_iterator): New.
(init_call_expr_arg_iterator): New.
(next_call_expr_arg): New.
(first_call_expr_arg): New.
(more_call_expr_args_p): New.
(FOR_EACH_CALL_EXPR_ARG): New.
* tree.c (tree_code_class_string): Add entries for tcc_vl_exp
and tcc_gimple_stmt.
(tree_code_size): Update documentation. Use sizeof (tree) rather
than sizeof (char *).
(tree_size): Likewise. Add case for tcc_vl_exp.
(tree_node_structure): Add case for tcc_vl_exp.
(contains_placeholder_p): Likewise.
(substitute_in_expr): Likewise.
(substitute_placeholder_in_expr): Likewise.
(stabilize_reference_1): Likewise.
(build3_stat): Remove logic for CALL_EXPRs. Replace with assertion
to diagnose breakage of this interface for constructing CALL_EXPRs.
(build_nt): Add similar assertion here.
(build_nt_call_list): New.
(simple_cst_equal) <CALL_EXPR>: Rewrite to use new accessors.
(iterative_hash_expr): Use TREE_OPERAND_LENGTH instead of
TREE_CODE_LENGTH.
(get_callee_fndecl): Use new CALL_EXPR accessors.
(tree_operand_check_failed): Change parameters to pass entire node
instead of its code, so that we can call TREE_OPERAND_LENGTH on it.
(process_call_operands): New.
(build_vl_exp_stat): New.
(build_call_list): New.
(build_call_nary): New.
(build_call_valist): New.
(build_call_array): New.
(walk_tree): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH.
(call_expr_arglist): New.
* tree.def (CALL_EXPR): Change representation of CALL_EXPRs to use
tcc_vl_exp instead of a fixed-size tcc_expression.
* doc/c-tree.texi (CALL_EXPR): Document new representation and
accessors for CALL_EXPRs.
(AGGR_INIT_EXPR): Likewise.
2007-02-15 Sandra Loosemore <sandra@codesourcery.com>
Brooks Moses <brooks.moses@codesourcery.com>
Lee Millward <lee.millward@codesourcery.com>
* builtins.c (c_strlen): Return NULL_TREE instead of 0.
(expand_builtin_nonlocal_goto): Change parameter to be entire
CALL_EXPR instead of an arglist. Use new CALL_EXPR accessors.
(expand_builtin_prefetch): Likewise.
(expand_builtin_classify_type): Likewise.
(mathfn_built_in): Return NULL_TREE instead of 0.
(expand_errno_check): Use new CALL_EXPR accessors.
(expand_builtin_mathfn): Use new CALL_EXPR accessors and constructors.
Return NULL_RTX instead of 0.
(expand_builtin_mathfn_2): Likewise.
(expand_builtin_mathfn_3): Likewise.
(expand_builtin_interclass_mathfn): Likewise.
(expand_builtin_sincos): Likewise.
(expand_builtin_cexpi): Likewise.
(expand_builtin_int_roundingfn): Likewise.
(expand_builtin_int_roundingfn_2): Likewise.
(expand_builtin_pow): Likewise.
(expand_builtin_powi): Likewise.
(expand_builtin_strlen): Pass entire CALL_EXPR as parameter instead
of arglist, fixing callers appropriately. Use new CALL_EXPR
accessors and constructors. Return NULL_RTX instead of 0.
(expand_builtin_strstr): Likewise.
(expand_builtin_strchr): Likewise.
(expand_builtin_strrchr): Likewise.
(expand_builtin_strpbrk): Likewise.
(expand_builtin_memcpy): Likewise.
(expand_builtin_mempcpy): Likewise.
(expand_builtin_mempcpy_args): New.
(expand_builtin_memmove): Similarly to expand_builtin_mempcpy.
(expand_builtin_memmove_args): New.
(expand_builtin_bcopy): Similarly to expand_builtin_mempcpy.
(expand_movstr): Likewise.
(expand_builtin_strcpy): Likewise.
(expand_builtin_strcpy_args): New.
(expand_builtin_stpcpy): Similarly to expand_builtin_strcpy.
(expand_builtin_strncpy): Likewise.
(expand_builtin_memset): Likewise.
(expand_builtin_memset_args): New.
(expand_builtin_bzero): Similarly to expand_builtin_memset.
(expand_builtin_memcmp): Likewise.
(expand_builtin_strcmp): Likewise.
(expand_builtin_strncmp): Likewise.
(expand_builtin_strcat): Likewise.
(expand_builtin_strncat): Likewise.
(expand_builtin_strspn): Likewise.
(expand_builtin_strcspn): Likewise.
(expand_builtin_args_info): Likewise.
(expand_builtin_va_start): Likewise.
(gimplify_va_arg_expr): Likewise.
(expand_builtin_va_end): Likewise.
(expand_builtin_va_copy): Likewise.
(expand_builtin_frame_address): Likewise.
(expand_builtin_alloca): Likewise.
(expand_builtin_bswap): Likewise.
(expand_builtin_unop): Likewise.
(expand_builtin_fputs): Likewise.
(expand_builtin_expect): Likewise.
(expand_builtin_fabs): Likewise.
(expand_builtin_copysign): Likewise.
(expand_builtin_printf): Likewise.
(expand_builtin_fprintf): Likewise.
(expand_builtin_sprintf): Likewise.
(expand_builtin_init_trampoline): Likewise.
(expand_builtin_signbit): Likewise.
(expand_builtin_fork_or_exec): Likewise.
(expand_builtin_sync_operation): Likewise.
(expand_builtin_compare_and_swap): Likewise.
(expand_builtin_lock_test_and_set): Likewise.
(expand_builtin_lock_release): Likewise.
(expand_builtin): Likewise.
(builtin_mathfn_code): Likewise.
(fold_builtin_constant_p): Pass call arguments individually instead
of as an arglist, fixing callers appropriately. Use new CALL_EXPR
accessors and constructors. Return NULL_TREE instead of 0.
(fold_builtin_expect): Likewise.
(fold_builtin_classify_type): Likewise.
(fold_builtin_strlen): Likewise.
(fold_builtin_nan): Likewise.
(integer_valued_real_p): Likewise.
(fold_trunc_transparent_mathfn): Likewise.
(fold_fixed_mathfn): Likewise.
(fold_builtin_cabs): Likewise.
(fold_builtin_sqrt): Likewise.
(fold_builtin_cbrt): Likewise.
(fold_builtin_cos): Likewise.
(fold_builtin_cosh): Likewise.
(fold_builtin_tan): Likewise.
(fold_builtin_sincos): Likewise.
(fold_builtin_cexp): Likewise.
(fold_builtin_trunc): Likewise.
(fold_builtin_floor): Likewise.
(fold_builtin_ceil): Likewise.
(fold_builtin_round): Likewise.
(fold_builtin_int_roundingfn): Likewise.
(fold_builtin_bitop): Likewise.
(fold_builtin_bswap): Likewise.
(fold_builtin_logarithm): Likewise.
(fold_builtin_hypot): Likewise.
(fold_builtin_pow): Likewise.
(fold_builtin_powi): Likewise.
(fold_builtin_exponent): Likewise.
(fold_builtin_memset): Likewise.
(fold_builtin_bzero): Likewise.
(fold_builtin_memory_op): Likewise.
(fold_builtin_bcopy): Deleted; call site changed to invoke
fold_builtin_memory_op directly.
(fold_builtin_strcpy): Similarly as for fold_builtin_memory_op.
(fold_builtin_strncpy): Likewise.
(fold_builtin_memcmp): Likewise.
(fold_builtin_strcmp): Likewise.
(fold_builtin_strncmp): Likewise.
(fold_builtin_signbit): Likewise.
(fold_builtin_copysign): Likewise.
(fold_builtin_isascii): Likewise.
(fold_builtin_toascii): Likewise.
(fold_builtin_isdigit): Likewise.
(fold_builtin_fabs): Likewise.
(fold_builtin_abs): Likewise.
(fold_builtin_fmin_fmax): Likewise.
(fold_builtin_carg): Likewise.
(fold_builtin_classify): Likewise.
(fold_builtin_unordered_cmp): Likewise.
(fold_builtin_0, fold_builtin_2, fold_builtin_3, fold_builtin_4):
New functions split out from fold_builtin_1.
(fold_builtin_n): New.
(fold_builtin_varargs): New.
(fold_builtin): Deleted. Most callers changed to use fold_call_expr
instead.
(fold_call_expr): New.
(build_function_call_expr): Rewrite to use new helper function.
(fold_builtin_call_list): New.
(build_call_expr): New.
(fold_builtin_call_valist): New.
(rewrite_call_expr): New.
(validate_arg): New.
(validate_arglist): Change parameter to be entire CALL_EXPR instead
of an arglist. Change return type to bool. Use new CALL_EXPR
accessors.
(fold_builtin_strstr): Pass call arguments individually instead
of as an arglist, fixing callers appropriately. Use new CALL_EXPR
accessors and constructors. Return NULL_TREE instead of 0.
(fold_builtin_strchr): Likewise.
(fold_builtin_strrchr): Likewise.
(fold_builtin_strpbrk): Likewise.
(fold_builtin_strcat): Likewise.
(fold_builtin_strncat): Likewise.
(fold_builtin_strspn): Likewise.
(fold_builtin_strcspn): Likewise.
(fold_builtin_fputs): Likewise.
(fold_builtin_next_arg): Likewise.
(fold_builtin_sprintf): Likewise.
(expand_builtin_object_size): Use new CALL_EXPR accessors. Use
NULL_RTX instead of 0.
(expand_builtin_memory_chk): Likewise.
(maybe_emit_chk_warning): Likewise.
(maybe_emit_sprintf_chk_warning): Likewise.
(fold_builtin_object_size): Pass call arguments individually instead
of as an arglist, fixing callers appropriately. Use new CALL_EXPR
accessors and constructors. Return NULL_TREE instead of 0.
(fold_builtin_memory_chk): Likewise.
(fold_builtin_stxcpy_chk): Likewise.
(fold_builtin_strncpy_chk): Likewise.
(fold_builtin_strcat_chk): Likewise.
(fold_builtin_strcat_chk): Likewise.
(fold_builtin_strncat_chk): Likewise.
(fold_builtin_sprintf_chk): Likewise.
(fold_builtin_snprintf_chk): Likewise.
(fold_builtin_printf): Likewise.
(fold_builtin_vprintf): Likewise.
* fold-const.c (negate_expr_p): Use new CALL_EXPR accessors and
constructors.
(operand_equal_p): Add separate tcc_vl_exp/CALL_EXPR case.
(make_range): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH.
(extract_muldiv_1): Add VL_EXP_CLASS_P case.
(fold_mathfn_compare): Use new CALL_EXPR accessors and constructors.
(fold_unary): Likewise.
(fold_binary): Likewise.
(fold_ternary): Remove CALL_EXPR case, since they are no longer
ternary expressions.
(fold): Add logic for tcc_vl_exp.
(fold_checksum_tree): Make it know about tcc_vl_exp. Use
TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH.
(fold_build3_stat): Add assertion to flag broken interface for
constructing CALL_EXPRs.
(fold_build_call_list): New.
(fold_build_call_list_initializer): New.
(tree_expr_nonnegative_p): Use new CALL_EXPR accessors and
constructors.
(fold_strip_sign_ops): Likewise.
2007-02-15 Sandra Loosemore <sandra@codesourcery.com>
Brooks Moses <brooks.moses@codesourcery.com>
Lee Millward <lee.millward@codesourcery.com>
* tree-dump.c (dequeue_and_dump) <CALL_EXPR>: Use new CALL_EXPR
accessors and dump arguments explicitly.
* tree-pretty-print.c (do_niy): Use TREE_OPERAND_LENGTH instead of
TREE_CODE_LENGTH.
(dump_generic_node): Use new CALL_EXPR accessors and walk arguments
explicitly.
(print_call_name): Use new CALL_EXPR accessors.
* print-tree.c (print_node): Add case tcc_vl_exp. Print
CALL_EXPR arguments explicitly instead of as a list. Use
TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH.
* tree-vrp.c (stmt_interesting_for_vrp): Use new CALL_EXPR accessors.
(vrp_visit_stmt): Likewise.
* tree-ssa-loop-im.c (outermost_invariant_loop_expr): Make it
know about tcc_vl_exp. Use TREE_OPERAND_LENGTH instead of
TREE_CODE_LENGTH.
(force_move_till_expr): Likewise.
* targhooks.c (default_external_stack_protect_fail): Use
build_call_expr instead of build_function_call_expr.
(default_hidden_stack_protect_fail): Likewise.
* tree-complex.c (expand_complex_libcall): Use build_call_expr to
build the call.
* cgraphbuild.c (build_cgraph_edges): Use new CALL_EXPR accessors
and walk arguments explicitly.
* tree-ssa-loop-niter.c (simplify_replace_tree): Use
TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH.
(expand_simple_operations): Likewise.
(infer_loop_bounds_from_array): Use new CALL_EXPR accessors.
* gengtype.c (adjust_field_tree_exp): Use TREE_OPERAND_LENGTH instead
of TREE_CODE_LENGTH.
(walk_type): Tweak walking of arrays not to blow up on CALL_EXPRs.
* optabs.c (expand_widen_pattern-expr): Use TREE_OPERAND_LENGTH
instead of TREE_CODE_LENGTH.
* value_prof.c (tree_ic): Use new CALL_EXPR accessors.
(tree_ic_transform): Likewise.
(interesting_stringop_to_profile_p): Pass entire CALL_EXPR as
parameter instead of arglist. Fix callers.
(tree_stringop_fixed_value): Use new CALL_EXPR accessors.
(tree_stringops_transform): Likewise.
(tree_indirect_call_to_profile): Likewise.
(tree_stringops_values_to_profile): Likewise.
* tree-tailcall.c (find_tail_calls): Use new CALL_EXPR iterator.
(eliminate_tail_call): Likewise.
* ipa-cp.c (ipcp_update_callgraph): Use new CALL_EXPR accessors.
* tree-scalar-evolution.c (chrec_contains_symbols_defined_in_loop):
Use TREE_OPERAND_LENGTH and generalize to handle any number of
operands.
(instantiate_parameters_1): Can't handle tcc_vl_exp here.
* omp-low.c (build_omp_barrier): Use build_call_expr.
(lower_rec_input_clauses): Likewise.
(lower_reduction_clauses): Likewise.
(expand_parallel_call): Likewise.
(maybe_catch_exception): Likewise.
(expand_omp_for_generic): Likewise.
(expand_omp_for_static_nochunk): Likewise.
(expand_omp_sections): Likewise.
(lower_omp_single_simple): Likewise.
(lower_omp_single_copy): Likewise.
(lower_omp_master): Likewise.
(lower_omp_ordered): Likewise.
(lower_omp_critical): Likewise.
* ipa-reference.c (check-call): Use new CALL_EXPR iterator.
(scan_for_static_refs): Create tcc_vl_exp case for CALL_EXPR.
* tree-gimple.c (is_gimple_call_addr): Fix doc.
(recalculate_side_effects): Use TREE_OPERAND_LENGTH instead of
TREE_CODE_LENGTH. Add tcc_vl_exp case.
* tree-chrec.c (chrec_contains_symbols): Use TREE_OPERAND_LENGTH
and generalize to handle any number of operands.
(chrec_contains_undetermined): Likewise.
(tree_contains_chrecs): Likewise.
(evolution_function_is_invariant_rec_p): Use TREE_OPERAND_LENGTH.
* cgraphunit.c (update_call_expr): Use new CALL_EXPR accessors.
* tree-ssa-ccp.c (ccp_fold): Use new CALL_EXPR accessors. Use
fold_call_expr instead of fold_builtin.
(ccp_fold_builtin): Likewise. Update calls into builtins.c to
match declarations there.
(fold_stmt): Use new CALL_EXPR constructor and accessors. Doc
updates.
* tree-ssa-loop-ivopts.c (expr_invariant_in_loop_p): Use
TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH.
* ipa-pure-const.c (check_call): Use new CALL_EXPR accessors.
(scan_function): Add case tcc_vl_exp for CALL_EXPR.
* tree-stdarg.c (execute_optimize_stdarg): Use new CALL_EXPR
accessors.
* tree-ssa-math-opts.c (execute_cse_sincos_1): Use build_call_expr.
(execute_cse_sincos): Use new CALL_EXPR accessors.
* tree-ssa-alias.c (find_used_portions): Use new CALL_EXPR iterator.
* gimple-low.c (lower_function_body): Use build_call_expr.
(lower_builtin_setjmp): Likewise.
* expr.c (emit_block_move_via_libcall): Use build_call_expr.
(set_storage_via_libcall): Likewise.
(safe_from_p): Add tcc_vl_exp case. Use TREE_OPERAND_LENGTH
instead of TREE_CODE_LENGTH.
(expand_expr_real_1): Use new CALL_EXPR accessors.
* tree-browser.c (store_child_info): Use TREE_OPERAND_LENGTH and
generalize to handle any number of operands.
(TB_parent_eq): Likewise.
* predict.c (expr_expected_value): Use new CALL_EXPR accessors.
(strip_builtin_expect): Likewise.
* function.c (gimplify_parameters): Use build_call_expr.
* tree-vectorizer.c (vect_is_simple_reduction): Use TREE_OPERAND_LENGTH
instead of TREE_CODE_LENGTH.
* ipa-type-escape.c (check_call): Use new CALL_EXPR iterators.
(scan_for_refs): Add case tcc_vl_exp for CALL_EXPR.
* tree-data-ref.c (get_references_in_stmt): Use new CALL_EXPR
iterators.
* gimplify.c (build_stack_save_restore): Use build_call_expr.
(gimplify_decl_expr): Likewise.
(gimplify_call_expr): Use fold_call_expr instead of fold_builtin.
Use new CALL_EXPR iterators.
(gimplify_modify_expr_to_memcpy): Use build_call_expr.
(gimplify_modify_expr_to_memset): Likewise.
(gimplify_variable_sized_compare): Likewise.
(gimplify_omp_atomic_fetch_op): Likewise.
(gimplify_omp_atomic_pipeline): Likewise.
(gimplify_omp_atomic_mutex): Likewise.
(gimplify_function_tree): Likewise.
* calls.c (alloca_call_p): Use new CALL_EXPR accessors.
(call_expr_flags): Likewise.
(expand_call): Likewise.
* except.c (expand_builtin_eh_return_data_regno): Pass entire
CALL_EXPR as parameter instead of arglist. Use new CALL_EXPR
accessors.
* coverage.c (create_coverage): Use build_call_expr.
* tree-ssa-pre.c (expression_node_pool, list_node_pool): Delete.
(temp_call_expr_obstack): New.
(pool_copy_list): Delete.
(temp_copy_call_expr): New.
(phi_translate): Add case tcc_vl_exp for CALL_EXPR. Use new
CALL_EXPR accessors. Get rid of special goo for copying argument
lists and use temp_copy_call_expr instead.
(valid_in_sets): Add case tcc_vl_exp for CALL_EXPR. Use new
CALL_EXPR accessors.
(create_expression_by_pieces): Likewise. Use build_call_array
to construct the result instead of fold_build3.
(create_value_expr_from): Add tcc_vl_exp. Delete special goo for
dealing with argument lists.
(init_pre): Remove references to expression_node_pool and
list_node_pool. Init temp_call_expr_obstack instead.
(fini_pre): Remove references to expression_node_pool and
list_node_pool.
* tree-sra.c (sra_walk_call_expr): Use new CALL_EXPR accessors
and walk arguments explicitly instead of as a list.
* tree-mudflap.c (mf_build_check_statement_for): Use build_call_expr.
(mx_register_decls): Likewise.
(mudflap_register_call): Likewise.
(mudflap_finish_file): Likewise.
* ipa-prop.c (ipa_callsite_compute_count): Use new CALL_EXPR accessors.
(ipa_callsite_compute_param): Likewise.
* tree-vect-patterns.c (vect_recog_pow_pattern): Use new CALL_EXPR
accessors and constructor.
* tree-nested.c (convert_nl_goto_reference): Use new CALL_EXPR
accessors and constructor.
(convert_tramp_reference): Likewise.
(convert_call_expr): Likewise.
(finalize_nesting_tree_1): Likewise.
* tree-ssa.c (tree_ssa_useless_type_conversion): Use new CALL_EXPR
accessors.
* tree-ssa-loop-prefetch.c (issue_prefetch_ref): Use build_call_expr.
* tree-inline.c (initialize_inlined_parameters): Pass entire
CALL_EXPR as parameter instead of arglist. Use new CALL_EXPR
accessors.
(estimate_num_insns_1): Use new CALL_EXPR accessors.
(expand_call_inline): Tidy up call to initialize_inlined_parameters.
* tree-vect-transform.c (vect_create_epilog_for_reduction): Use
TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH.
(vectorizable_reduction): Likewise.
(vectorizable_call): Use new CALL_EXPR iterators.
(vectorizable_conversion): Use build_call_expr.
(vectorizable_operation): Use TREE_OPERAND_LENGTH.
(vect_gen_widened_results_half): Use build_call_expr.
(vect_setup_realignment): Likewise.
(vectorizable_live_operation): Use TREE_OPERAND_LENGTH.
* tree-object-size.c (alloc_object_size): Use new CALL_EXPR accessors.
(pass_through_call): Likewise.
(compute_object_sizes): Likewise. Use fold_call_expr instead of
fold_builtin.
* tree-profile.c (tree_gen_interval_profiler): Use build_call_expr.
(tree_gen_pow2_profiler): Likewise.
(tree_gen_one_value_profiler): Likewise.
(tree_gen_ic_func_profiler): Likewise.
(tree_gen_average_profiler): Likewise.
(tree_gen_ior_profiler): Likewise.
* tree-ssa-structalias.c (get_constraint_for): Add case tcc_vl_exp.
(find_func_aliases): Use new CALL_EXPR accessors. Add case
tcc_vl_exp. Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH.
* tree-ssa-reassoc.c (get_rank): Use TREE_OPERAND_LENGTH instead
of TREE_CODE_LENGTH.
* stmt.c (warn_if_unused_value): Use TREE_OPERAND_LENGTH instead
of TREE_CODE_LENGTH.
* convert.c (convert_to_real): Use new CALL_EXPR accessors and
constructor.
(convert_to_integer): Likewise.
* tree-ssa-operands.c (get_call_expr_operands): Use new CALL_EXPR
accessors.
2007-02-15 Sandra Loosemore <sandra@codesourcery.com>
Brooks Moses <brooks.moses@codesourcery.com>
Lee Millward <lee.millward@codesourcery.com>
* config/alpha/alpha.c (alpha_expand_builtin): Use new CALL_EXPR
accessors.
* config/frv/frv.c (frv_expand_builtin): Likewise.
* config/s390/s390.c (s390_expand_builtin): Likewise.
* config/sparc/sparc.c (sparc_gimplify_va_arg): Use build_call_expr.
(sparc_expand_builtin): Use new CALL_EXPR accessors.
* config/i386/i386.c (ix86_function_ok_for_sibcall): Likewise.
(ix86_expand_binop_builtin): Pass entire CALL_EXPR as parameter
instead of arglist. Use new CALL_EXPR accessors on it. Fix callers.
(ix86_expand_store_builtin): Likewise.
(ix86_expand_unop_builtin): Likewise.
(ix86_expand_unop1_builtin): Likewise.
(ix86_expand_sse_compare): Likewise.
(ix86_expand_sse_comi): Likewise.
(ix86_expand_vec_init_builtin): Likewise.
(ix86_expand_vec_ext_builtin): Likewise.
(ix86_expand_vec_set_builtin): Likewise.
(ix86_expand_builtin): Use new CALL_EXPR accessors.
* config/sh/sh.c (sh_expand_builtin): Use new CALL_EXPR accessors.
* config/c4x/c4x.c (c4x_expand_builtin): Likewise.
* config/iq2000/iq2000.c (expand_one_builtin): Pass entire CALL_EXPR
instead of arglist. Use new CALL_EXPR accessors. Fix callers.
(iq2000_expand_builtin): Use new CALL_EXPR accessors.
* config/rs6000/rs6000-c.c (altivec_build_resolved_builtin): Use
build_call_expr.
* config/rs6000/rs6000.c (rs6000_gimplify_va_arg): Likewise.
(rs6000_expand_unop_builtin): Pass entire CALL_EXPR instead of
arglist. Use new CALL_EXPR accessors. Fix callers.
(altivec_expand_abs_builtin): Likewise.
(rs6000_expand_binop_builtin): Likewise.
(altivec_expand_predicate_builtin): Likewise.
(altivec_expand_lv_builtin): Likewise.
(spe_expand_stv_builtin): Likewise.
(altivec_expand_stv_builtin): Likewise.
(rs6000_expand_ternop_builtin): Likewise.
(altivec_expand_ld_builtin): Use new CALL_EXPR accessors.
(altivec_expand_st_builtin): Likewise.
(altivec_expand_dst_builtin): Likewise.
(altivec_expand_vec_init_builtin): Pass entire CALL_EXPR instead of
arglist. Use new CALL_EXPR accessors. Fix callers.
(altivec_expand_vec_set_builtin): Likewise.
(altivec_expand_vec_ext_builtin): Likewise.
(altivec_expand_builtin): Use new CALL_EXPR accessors.
(spe_expand_builtin): Likewise.
(spe_expand_predicate_builtin): Pass entire CALL_EXPR instead of
arglist. Use new CALL_EXPR accessors. Fix callers.
(spe_expand_evsel_builtin): Likewise.
(rs6000_expand_builtin): Use new CALL_EXPR accessors. VCFUX and
FCFSX cases must construct whole new CALL_EXPR, not just arglist.
* config/arm/arm.c (arm_expand_binop_builtin): Pass entire CALL_EXPR
instead of arglist. Use new CALL_EXPR accessors. Fix callers.
(arm_expand_unop_builtin): Likewise.
(arm_expand_builtin): Use new CALL_EXPR accessors.
* config/mips/mips.c (mips_expand_builtin): Use new CALL_EXPR
accessors.
* config/bfin/bfin.c (bfin_expand_binop_builtin): Pass entire CALL_EXPR
instead of arglist. Use new CALL_EXPR accessors. Fix callers.
(bfin_expand_unop_builtin): Likewise.
(bfin_expand_builtin): Use new CALL_EXPR accessors.
2007-02-15 Sandra Loosemore <sandra@codesourcery.com>
Brooks Moses <brooks.moses@codesourcery.com>
Lee Millward <lee.millward@codesourcery.com>
* c-semantics.c (build_stmt): Add internal diagnostic check.
* c-pretty-print.c (pp_c_postfix_expression): Use new CALL_EXPR
accessors. Print arguments explicitly instead of as a list.
* c-typeck.c (build_function_call): Use new CALL_EXPR constructors.
* c-omp.c (c_finish_omp_barrier): Use build_call_expr.
(c_finish_omp_flish): Likewise.
* c-common.c (verify_tree): Use new CALL_EXPR accessors. Traverse
arguments explicitly instead of as a list. Use TREE_OPERAND_LENGTH
instead of TREE_CODE_LENGTH.
(check_function_arguments_recurse): Use new CALL_EXPR accessors.
(c_warn_unused_result): Likewise.
2007-02-15 Sandra Loosemore <sandra@codesourcery.com>
Brooks Moses <brooks.moses@codesourcery.com>
Lee Millward <lee.millward@codesourcery.com>
* cp-tree.def (AGGR_INIT_EXPR): Adjust documentation.
Change class to tcc_vl_exp.
* call.c (build_call): Use build_call_list instead
of build3.
(build_over_call): Likewise.
(build_new_method_call): Use build_min_non_dep_call_list
instead of build_min_non_dep.
* error.c (dump_call_expr_args): New function.
(dump_aggr_init_expr_args): New function.
(dump_expr) <AGGR_INIT_EXPR, CALL_EXPR, INDIRECT_REF>: Use them.
Update to use new CALL_EXPR and AGGR_INIT_EXPR accessor macros.
* cvt.c (convert_to_void): Use build_call_array instead
of build3; use new AGGR_INIT_EXPR accessor macros.
* mangle.c (write_expression): Use TREE_OPERAND_LENGTH
instead of TREE_CODE_LENGTH.
* dump.c (cp_dump_tree) <AGGR_INIT_EXPR>: Update to use new
AGGR_INIT_EXPR accessor macros.
* cp-gimplify.c (cp_gimplify_init_expr): Use
AGGR_INIT_EXPR_SLOT to set the slot operand.
* cp-tree.h (AGGR_INIT_EXPR_FN): New macro.
(AGGR_INIT_EXPR_SLOT): New macro.
(AGGR_INIT_EXPR_ARG): New macro.
(aggr_init_expr_nargs): New macro.
(AGGR_INIT_EXPR_ARGP): New macro.
(aggr_init_expr_arg_iterator): New.
(init_aggr_init_expr_arg_iterator): New.
(next_aggr_init_expr_arg): New.
(first_aggr_init_expr_arg): New.
(more_aggr_init_expr_args_p): New.
(FOR_EACH_AGGR_INIT_EXPR_ARG): New.
(stabilize_aggr_init): New declaration.
(build_min_non_dep_call_list): Likewise.
* tree.c (process_aggr_init_operands): New function.
(build_aggr_init_array) New function.
(build_cplus_new): Update to use new CALL_EXPR and
AGGR_INIT_EXPR accessor macros. Replace use of build3 with
build_aggr_init_array.
(build_min_non_dep_call_list) New function.
(build_min_nt): Assert input code parameter is not a variable
length expression class.
(build_min, build_min_non_dep): Likewise.
(cp_tree_equal) <CALL_EXPR>: Iterate through the arguments
to check for equality instead of recursing. Handle tcc_vl_exp
tree code classes.
(stabilize_call): Update to only handle CALL_EXPRs, not
AGGR_INIT_EXPRs; use new CALL_EXPR accessor macros.
(stabilize_aggr_init): New function.
(stabilize_init): Use it.
* cxx-pretty-print.c (pp_cxx_postfix_expression)
<AGGR_INIT_EXPR, CALL_EXPR>: Update to use new CALL_EXPR and
AGGR_INIT_EXPR accessor macros and argument iterators.
* pt.c (tsubst_copy) <CALL_EXPR>: Replace build_nt with
build_vl_exp. Iterate through the operands, recursively
processing each one.
(tsubst_copy_and_build) <CALL_EXPR>: Update to use new
CALL_EXPR accessor macros.
(value_dependent_expression_p) <default>: Handle tcc_vl_exp
tree code classes. Use TREE_OPERAND_LENGTH instead of
TREE_CODE_LENGTH.
* semantics.c (finish_call_expr): Use build_nt_call_list
instead of build_nt.
(simplify_aggr_init_expr): Update to use new AGGR_INIT_EXPR
accessor macros. Use build_call_array to construct the
CALL_EXPR node instead of build3
* decl2.c (build_offset_ref_call_from_tree): Use
build_nt_call_list and build_min_non_dep_call_list instead
of build_min_nt and build_min_non_dep.
* parser.c (cp_parser_postfix_expression) <CPP_OPEN_PAREN>:
Use build_nt_call_list instead of build_min_nt.
2007-02-15 Sandra Loosemore <sandra@codesourcery.com>
Brooks Moses <brooks.moses@codesourcery.com>
Lee Millward <lee.millward@codesourcery.com>
* java-tree.h (BUILD_MONITOR_ENTER): Use build_call_nary instead
of build3.
(BUILD_MONITOR_EXIT): Likewise.
* java-gimplify.c (java_gimplify_component_ref): Use build_call_expr.
(java_gimplify_modify_expr): Likewise.
* class.c (cache_this_class_ref): Use build_call_expr.
(build_static_field_ref): Likewise.
(emit_indirect_register_classes): Likewise.
(emit_register_classes): Likewise.
* resource.c (write_resource_constructor): Use build_call_expr.
* builtins.c (builtin_creator_function): Change interpretation of
the second parameter to be the whole CALL_EXPR instead of the arglist.
(max_builtin): Tweak parameter list. Use new CALL_EXPR accessors.
(min_builtin): Likewise.
(abs_builtin): Likewise.
(java_build_function_call_expr): Likewise.
(convert_real): Likewise.
(UNMARSHAL3): Likewise.
(UNMARSHAL4): Likewise.
(UNMARSHAL5): Likewise.
(build_arglist_for_builtin): Delete. Fix callers to use
build_call_expr instead.
(putObject_builtin): Tweak parameter list. Use new CALL_EXPR
accessors.
(compareAndSwapInt_builtin): Likewise.
(compareAndSwapLong_builtin): Likewise.
(compareAndSwapObject_builtin): Likewise.
(putVolatile_builtin): Likewise.
(getVolatile_builtin): Likewise.
(VMSupportsCS8_builtin): Likewise.
(check_for_builtin): Pass entire CALL_EXPR to builtin expander
instead of arglist.
* expr.c (build_java_athrow): Use build_call_nary instead of build3.
(build_java_throw_out_of_bounds_exception): Likewise.
(java_check_reference): Likewise.
(build_java_arraystore_check): Likewise.
(build_newarray): Likewise.
(build_anewarray): Likewise.
(expand_java_multinewarray): Use build_call_list instead of build3.
(build_java_monitor): Use build_call_nary instead of build3.
(java_create_object): Likewise.
(expand_java_NEW): Likewise.
(build_instanceof): Likewise.
(expand_java_CHECKCAST): Likewise.
(build_java_soft_divmod): Likewise.
(build_java_binop): Likewise.
(build_field_ref): Likewise.
(build_class_init): Likewise.
(rewrite_arglist_getcaller): Use build_call_expr.
(build_invokeinterface): Use build_call_nary instead of build3.
(expand_invoke): Use build_call_list instead of build3.
(build_jni_stub): Use build_call_nary, build_call_list, or
build_call_expr instead of build3.
(expand_java_field_op): Use build_call_expr instead of build3.
(force_evaluation_order): Use new CALL_EXPR accessors.
* lang.c (java_get_callee_fndecl): Use new CALL_EXPR accessors.
2007-02-15 Sandra Loosemore <sandra@codesourcery.com>
Brooks Moses <brooks.moses@codesourcery.com>
Lee Millward <lee.millward@codesourcery.com>
* objc-act.c (receiver_is_class_object): Use new CALL_EXPR accessors.
(objc_get_callee_fndecl): Likewise.
2007-02-15 Sandra Loosemore <sandra@codesourcery.com>
Brooks Moses <brooks.moses@codesourcery.com>
Lee Millward <lee.millward@codesourcery.com>
* trans-expr.c (gfc_conv_power_op): Use build_call_expr.
(gfc_conv_string_tmp): Likewise.
(gfc_conv_concat_op): Likewise.
(gfc_build_compare_string): Likewise.
(gfc_conv_function_call): Use build_call_list instead of build3.
* trans-array.c (gfc_trans_allocate_array_storage): Use
build_call_expr.
(gfc_grow_array): Likewise.
(gfc_trans_array_ctor_element): Likewise.
(gfc_trans_array_constructor_value): Likewise.
(gfc_array_allocate): Likewise.
(gfc_array_deallocate): Likewise.
(gfc_trans_auto_array_allocation): Likewise.
(gfc_trans_dummy_array_bias): Likewise.
(gfc_conv_array_parameter): Likewise.
(gfc_trans_dealloc_allocated): Likewise.
(gfc_duplicate_allocatable): Likewise.
* trans-openmp.c (gfc_trans_omp_barrier): Use build_call_expr.
(gfc_trans_omp_flush): Likewise.
* trans-stmt.c (gfc_conv_elementel_dependencies): Use build_call_expr.
(gfc_trans_pause): Likewise.
(gfc_trans_stop): Likewise.
(gfc_trans_character_select): Likewise.
(gfc_do_allocate): Likewise.
(gfc_trans_assign_need_temp): Likewise.
(gfc_trans_pointer_assign_need_temp): Likewise.
(gfc_trans_forall_1): Likewise.
(gfc_trans_where_2): Likewise.
(gfc_trans_allocate): Likewise.
(gfc_trans_deallocate): Likewise.
* trans.c (gfc_trans_runtime_check): Use build_call_expr.
* trans-io.c (gfc_trans_open): Use build_call_expr.
(gfc_trans_close): Likewise.
(build_filepos): Likewise.
(gfc_trans_inquire): Likewise.
(NML_FIRST_ARG): Delete.
(NML_ADD_ARG): Delete.
(transfer_namelist_element): Use build_call_expr.
(build_dt): Likewise.
(gfc_trans_dt_end): Likewise.
(transfer_expr): Likewise.
(transfer_array-desc): Likewise.
* trans-decl.c (gfc_generate_function_code): Use build_call_expr.
(gfc_generate_constructors): Likewise.
* trans-intrinsic.c (gfc_conv_intrinsic_ctime): Use build_call_expr.
(gfc_conv_intrinsic_fdate): Likewise.
(gfc_conv_intrinsic_ttynam): Likewise.
(gfc_conv_intrinsic_array_transfer): Likewise.
(gfc_conv_associated): Likewise.
(gfc_conv_intrinsic_si_kind): Likewise.
(gfc_conv_intrinsic_trim): Likewise.
(gfc_conv_intrinsic_repeat: Likewise.
(gfc_conv_intrinsic_iargc): Likewise.
Co-Authored-By: Brooks Moses <brooks.moses@codesourcery.com>
Co-Authored-By: Lee Millward <lee.millward@codesourcery.com>
From-SVN: r122018
2007-02-16 00:50:49 +01:00
|
|
|
non-static member functions. @code{CALL_EXPR}s are implemented as
|
|
|
|
expression nodes with a variable number of operands. Rather than using
|
|
|
|
@code{TREE_OPERAND} to extract them, it is preferable to use the
|
|
|
|
specialized accessor macros and functions that operate specifically on
|
|
|
|
@code{CALL_EXPR} nodes.
|
|
|
|
|
|
|
|
@code{CALL_EXPR_FN} returns a pointer to the
|
2000-11-10 06:56:47 +01:00
|
|
|
function to call; it is always an expression whose type is a
|
tree.h (enum tree_code_class): Add tcc_vl_exp.
2007-02-15 Sandra Loosemore <sandra@codesourcery.com>
Brooks Moses <brooks.moses@codesourcery.com>
Lee Millward <lee.millward@codesourcery.com>
* tree.h (enum tree_code_class): Add tcc_vl_exp.
(VL_EXP_CLASS_P): New.
(TREE_OPERAND_CHECK): Use TREE_OPERAND_LENGTH instead of
TREE_CODE_LENGTH.
(TREE_OPERAND_CHECK_CODE): Likewise.
(GIMPLE_STMT_OPERAND_CHECK): Likewise.
(TREE_RTL_OPERAND_CHECK): Likewise.
(tree_operand_check_failed): Make second parameter the whole tree
instead of its code. Fixed callers.
(VL_EXP_CHECK): New.
(TREE_OPERAND_LENGTH): New.
(VL_EXP_OPERAND_LENGTH): New.
(CALL_EXPR_FN): New.
(CALL_EXPR_STATIC_CHAIN): New.
(CALL_EXPR_ARGS): New.
(CALL_EXPR_ARG): New.
(call_expr_nargs): New.
(CALL_EXPR_ARGP): New.
(build_nt_call_list): Declare.
(build_vl_exp_stat): Declare.
(build_vl_exp): New.
(build_call_list): Declare.
(build_call_nary): Declare.
(build_call_valist): Declare.
(build_call_array): Declare.
(call_expr_arg): Declare.
(call_expr_argp): Declare.
(call_expr_arglist): Declare.
(fold_build_call_list): Declare.
(fold_build_call_list_initializer): Declare.
(fold_call_expr): Declare to replace fold_builtin.
(fold_builtin_fputs): Update to agree with modified definition.
(fold_builtin_strcpy): Likewise.
(fold_builtin_strncpy): Likewise.
(fold_builtin_memory_chk): Likewise.
(fold_builtin_stxcpy_chk): Likewise.
(fold_builtin_strncpy_chk): Likewise.
(fold_builtin_next_arg): Likewise.
(fold_build_call_expr): Declare.
(fold_builtin_call_list): Declare.
(fold_builtin_call_valist): Declare.
(build_call_expr): Declare.
(validate_arglist): Update to agree with modified definition.
(tree_operand_length): New.
(call_expr_arg_iterator): New.
(init_call_expr_arg_iterator): New.
(next_call_expr_arg): New.
(first_call_expr_arg): New.
(more_call_expr_args_p): New.
(FOR_EACH_CALL_EXPR_ARG): New.
* tree.c (tree_code_class_string): Add entries for tcc_vl_exp
and tcc_gimple_stmt.
(tree_code_size): Update documentation. Use sizeof (tree) rather
than sizeof (char *).
(tree_size): Likewise. Add case for tcc_vl_exp.
(tree_node_structure): Add case for tcc_vl_exp.
(contains_placeholder_p): Likewise.
(substitute_in_expr): Likewise.
(substitute_placeholder_in_expr): Likewise.
(stabilize_reference_1): Likewise.
(build3_stat): Remove logic for CALL_EXPRs. Replace with assertion
to diagnose breakage of this interface for constructing CALL_EXPRs.
(build_nt): Add similar assertion here.
(build_nt_call_list): New.
(simple_cst_equal) <CALL_EXPR>: Rewrite to use new accessors.
(iterative_hash_expr): Use TREE_OPERAND_LENGTH instead of
TREE_CODE_LENGTH.
(get_callee_fndecl): Use new CALL_EXPR accessors.
(tree_operand_check_failed): Change parameters to pass entire node
instead of its code, so that we can call TREE_OPERAND_LENGTH on it.
(process_call_operands): New.
(build_vl_exp_stat): New.
(build_call_list): New.
(build_call_nary): New.
(build_call_valist): New.
(build_call_array): New.
(walk_tree): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH.
(call_expr_arglist): New.
* tree.def (CALL_EXPR): Change representation of CALL_EXPRs to use
tcc_vl_exp instead of a fixed-size tcc_expression.
* doc/c-tree.texi (CALL_EXPR): Document new representation and
accessors for CALL_EXPRs.
(AGGR_INIT_EXPR): Likewise.
2007-02-15 Sandra Loosemore <sandra@codesourcery.com>
Brooks Moses <brooks.moses@codesourcery.com>
Lee Millward <lee.millward@codesourcery.com>
* builtins.c (c_strlen): Return NULL_TREE instead of 0.
(expand_builtin_nonlocal_goto): Change parameter to be entire
CALL_EXPR instead of an arglist. Use new CALL_EXPR accessors.
(expand_builtin_prefetch): Likewise.
(expand_builtin_classify_type): Likewise.
(mathfn_built_in): Return NULL_TREE instead of 0.
(expand_errno_check): Use new CALL_EXPR accessors.
(expand_builtin_mathfn): Use new CALL_EXPR accessors and constructors.
Return NULL_RTX instead of 0.
(expand_builtin_mathfn_2): Likewise.
(expand_builtin_mathfn_3): Likewise.
(expand_builtin_interclass_mathfn): Likewise.
(expand_builtin_sincos): Likewise.
(expand_builtin_cexpi): Likewise.
(expand_builtin_int_roundingfn): Likewise.
(expand_builtin_int_roundingfn_2): Likewise.
(expand_builtin_pow): Likewise.
(expand_builtin_powi): Likewise.
(expand_builtin_strlen): Pass entire CALL_EXPR as parameter instead
of arglist, fixing callers appropriately. Use new CALL_EXPR
accessors and constructors. Return NULL_RTX instead of 0.
(expand_builtin_strstr): Likewise.
(expand_builtin_strchr): Likewise.
(expand_builtin_strrchr): Likewise.
(expand_builtin_strpbrk): Likewise.
(expand_builtin_memcpy): Likewise.
(expand_builtin_mempcpy): Likewise.
(expand_builtin_mempcpy_args): New.
(expand_builtin_memmove): Similarly to expand_builtin_mempcpy.
(expand_builtin_memmove_args): New.
(expand_builtin_bcopy): Similarly to expand_builtin_mempcpy.
(expand_movstr): Likewise.
(expand_builtin_strcpy): Likewise.
(expand_builtin_strcpy_args): New.
(expand_builtin_stpcpy): Similarly to expand_builtin_strcpy.
(expand_builtin_strncpy): Likewise.
(expand_builtin_memset): Likewise.
(expand_builtin_memset_args): New.
(expand_builtin_bzero): Similarly to expand_builtin_memset.
(expand_builtin_memcmp): Likewise.
(expand_builtin_strcmp): Likewise.
(expand_builtin_strncmp): Likewise.
(expand_builtin_strcat): Likewise.
(expand_builtin_strncat): Likewise.
(expand_builtin_strspn): Likewise.
(expand_builtin_strcspn): Likewise.
(expand_builtin_args_info): Likewise.
(expand_builtin_va_start): Likewise.
(gimplify_va_arg_expr): Likewise.
(expand_builtin_va_end): Likewise.
(expand_builtin_va_copy): Likewise.
(expand_builtin_frame_address): Likewise.
(expand_builtin_alloca): Likewise.
(expand_builtin_bswap): Likewise.
(expand_builtin_unop): Likewise.
(expand_builtin_fputs): Likewise.
(expand_builtin_expect): Likewise.
(expand_builtin_fabs): Likewise.
(expand_builtin_copysign): Likewise.
(expand_builtin_printf): Likewise.
(expand_builtin_fprintf): Likewise.
(expand_builtin_sprintf): Likewise.
(expand_builtin_init_trampoline): Likewise.
(expand_builtin_signbit): Likewise.
(expand_builtin_fork_or_exec): Likewise.
(expand_builtin_sync_operation): Likewise.
(expand_builtin_compare_and_swap): Likewise.
(expand_builtin_lock_test_and_set): Likewise.
(expand_builtin_lock_release): Likewise.
(expand_builtin): Likewise.
(builtin_mathfn_code): Likewise.
(fold_builtin_constant_p): Pass call arguments individually instead
of as an arglist, fixing callers appropriately. Use new CALL_EXPR
accessors and constructors. Return NULL_TREE instead of 0.
(fold_builtin_expect): Likewise.
(fold_builtin_classify_type): Likewise.
(fold_builtin_strlen): Likewise.
(fold_builtin_nan): Likewise.
(integer_valued_real_p): Likewise.
(fold_trunc_transparent_mathfn): Likewise.
(fold_fixed_mathfn): Likewise.
(fold_builtin_cabs): Likewise.
(fold_builtin_sqrt): Likewise.
(fold_builtin_cbrt): Likewise.
(fold_builtin_cos): Likewise.
(fold_builtin_cosh): Likewise.
(fold_builtin_tan): Likewise.
(fold_builtin_sincos): Likewise.
(fold_builtin_cexp): Likewise.
(fold_builtin_trunc): Likewise.
(fold_builtin_floor): Likewise.
(fold_builtin_ceil): Likewise.
(fold_builtin_round): Likewise.
(fold_builtin_int_roundingfn): Likewise.
(fold_builtin_bitop): Likewise.
(fold_builtin_bswap): Likewise.
(fold_builtin_logarithm): Likewise.
(fold_builtin_hypot): Likewise.
(fold_builtin_pow): Likewise.
(fold_builtin_powi): Likewise.
(fold_builtin_exponent): Likewise.
(fold_builtin_memset): Likewise.
(fold_builtin_bzero): Likewise.
(fold_builtin_memory_op): Likewise.
(fold_builtin_bcopy): Deleted; call site changed to invoke
fold_builtin_memory_op directly.
(fold_builtin_strcpy): Similarly as for fold_builtin_memory_op.
(fold_builtin_strncpy): Likewise.
(fold_builtin_memcmp): Likewise.
(fold_builtin_strcmp): Likewise.
(fold_builtin_strncmp): Likewise.
(fold_builtin_signbit): Likewise.
(fold_builtin_copysign): Likewise.
(fold_builtin_isascii): Likewise.
(fold_builtin_toascii): Likewise.
(fold_builtin_isdigit): Likewise.
(fold_builtin_fabs): Likewise.
(fold_builtin_abs): Likewise.
(fold_builtin_fmin_fmax): Likewise.
(fold_builtin_carg): Likewise.
(fold_builtin_classify): Likewise.
(fold_builtin_unordered_cmp): Likewise.
(fold_builtin_0, fold_builtin_2, fold_builtin_3, fold_builtin_4):
New functions split out from fold_builtin_1.
(fold_builtin_n): New.
(fold_builtin_varargs): New.
(fold_builtin): Deleted. Most callers changed to use fold_call_expr
instead.
(fold_call_expr): New.
(build_function_call_expr): Rewrite to use new helper function.
(fold_builtin_call_list): New.
(build_call_expr): New.
(fold_builtin_call_valist): New.
(rewrite_call_expr): New.
(validate_arg): New.
(validate_arglist): Change parameter to be entire CALL_EXPR instead
of an arglist. Change return type to bool. Use new CALL_EXPR
accessors.
(fold_builtin_strstr): Pass call arguments individually instead
of as an arglist, fixing callers appropriately. Use new CALL_EXPR
accessors and constructors. Return NULL_TREE instead of 0.
(fold_builtin_strchr): Likewise.
(fold_builtin_strrchr): Likewise.
(fold_builtin_strpbrk): Likewise.
(fold_builtin_strcat): Likewise.
(fold_builtin_strncat): Likewise.
(fold_builtin_strspn): Likewise.
(fold_builtin_strcspn): Likewise.
(fold_builtin_fputs): Likewise.
(fold_builtin_next_arg): Likewise.
(fold_builtin_sprintf): Likewise.
(expand_builtin_object_size): Use new CALL_EXPR accessors. Use
NULL_RTX instead of 0.
(expand_builtin_memory_chk): Likewise.
(maybe_emit_chk_warning): Likewise.
(maybe_emit_sprintf_chk_warning): Likewise.
(fold_builtin_object_size): Pass call arguments individually instead
of as an arglist, fixing callers appropriately. Use new CALL_EXPR
accessors and constructors. Return NULL_TREE instead of 0.
(fold_builtin_memory_chk): Likewise.
(fold_builtin_stxcpy_chk): Likewise.
(fold_builtin_strncpy_chk): Likewise.
(fold_builtin_strcat_chk): Likewise.
(fold_builtin_strcat_chk): Likewise.
(fold_builtin_strncat_chk): Likewise.
(fold_builtin_sprintf_chk): Likewise.
(fold_builtin_snprintf_chk): Likewise.
(fold_builtin_printf): Likewise.
(fold_builtin_vprintf): Likewise.
* fold-const.c (negate_expr_p): Use new CALL_EXPR accessors and
constructors.
(operand_equal_p): Add separate tcc_vl_exp/CALL_EXPR case.
(make_range): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH.
(extract_muldiv_1): Add VL_EXP_CLASS_P case.
(fold_mathfn_compare): Use new CALL_EXPR accessors and constructors.
(fold_unary): Likewise.
(fold_binary): Likewise.
(fold_ternary): Remove CALL_EXPR case, since they are no longer
ternary expressions.
(fold): Add logic for tcc_vl_exp.
(fold_checksum_tree): Make it know about tcc_vl_exp. Use
TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH.
(fold_build3_stat): Add assertion to flag broken interface for
constructing CALL_EXPRs.
(fold_build_call_list): New.
(fold_build_call_list_initializer): New.
(tree_expr_nonnegative_p): Use new CALL_EXPR accessors and
constructors.
(fold_strip_sign_ops): Likewise.
2007-02-15 Sandra Loosemore <sandra@codesourcery.com>
Brooks Moses <brooks.moses@codesourcery.com>
Lee Millward <lee.millward@codesourcery.com>
* tree-dump.c (dequeue_and_dump) <CALL_EXPR>: Use new CALL_EXPR
accessors and dump arguments explicitly.
* tree-pretty-print.c (do_niy): Use TREE_OPERAND_LENGTH instead of
TREE_CODE_LENGTH.
(dump_generic_node): Use new CALL_EXPR accessors and walk arguments
explicitly.
(print_call_name): Use new CALL_EXPR accessors.
* print-tree.c (print_node): Add case tcc_vl_exp. Print
CALL_EXPR arguments explicitly instead of as a list. Use
TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH.
* tree-vrp.c (stmt_interesting_for_vrp): Use new CALL_EXPR accessors.
(vrp_visit_stmt): Likewise.
* tree-ssa-loop-im.c (outermost_invariant_loop_expr): Make it
know about tcc_vl_exp. Use TREE_OPERAND_LENGTH instead of
TREE_CODE_LENGTH.
(force_move_till_expr): Likewise.
* targhooks.c (default_external_stack_protect_fail): Use
build_call_expr instead of build_function_call_expr.
(default_hidden_stack_protect_fail): Likewise.
* tree-complex.c (expand_complex_libcall): Use build_call_expr to
build the call.
* cgraphbuild.c (build_cgraph_edges): Use new CALL_EXPR accessors
and walk arguments explicitly.
* tree-ssa-loop-niter.c (simplify_replace_tree): Use
TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH.
(expand_simple_operations): Likewise.
(infer_loop_bounds_from_array): Use new CALL_EXPR accessors.
* gengtype.c (adjust_field_tree_exp): Use TREE_OPERAND_LENGTH instead
of TREE_CODE_LENGTH.
(walk_type): Tweak walking of arrays not to blow up on CALL_EXPRs.
* optabs.c (expand_widen_pattern-expr): Use TREE_OPERAND_LENGTH
instead of TREE_CODE_LENGTH.
* value_prof.c (tree_ic): Use new CALL_EXPR accessors.
(tree_ic_transform): Likewise.
(interesting_stringop_to_profile_p): Pass entire CALL_EXPR as
parameter instead of arglist. Fix callers.
(tree_stringop_fixed_value): Use new CALL_EXPR accessors.
(tree_stringops_transform): Likewise.
(tree_indirect_call_to_profile): Likewise.
(tree_stringops_values_to_profile): Likewise.
* tree-tailcall.c (find_tail_calls): Use new CALL_EXPR iterator.
(eliminate_tail_call): Likewise.
* ipa-cp.c (ipcp_update_callgraph): Use new CALL_EXPR accessors.
* tree-scalar-evolution.c (chrec_contains_symbols_defined_in_loop):
Use TREE_OPERAND_LENGTH and generalize to handle any number of
operands.
(instantiate_parameters_1): Can't handle tcc_vl_exp here.
* omp-low.c (build_omp_barrier): Use build_call_expr.
(lower_rec_input_clauses): Likewise.
(lower_reduction_clauses): Likewise.
(expand_parallel_call): Likewise.
(maybe_catch_exception): Likewise.
(expand_omp_for_generic): Likewise.
(expand_omp_for_static_nochunk): Likewise.
(expand_omp_sections): Likewise.
(lower_omp_single_simple): Likewise.
(lower_omp_single_copy): Likewise.
(lower_omp_master): Likewise.
(lower_omp_ordered): Likewise.
(lower_omp_critical): Likewise.
* ipa-reference.c (check-call): Use new CALL_EXPR iterator.
(scan_for_static_refs): Create tcc_vl_exp case for CALL_EXPR.
* tree-gimple.c (is_gimple_call_addr): Fix doc.
(recalculate_side_effects): Use TREE_OPERAND_LENGTH instead of
TREE_CODE_LENGTH. Add tcc_vl_exp case.
* tree-chrec.c (chrec_contains_symbols): Use TREE_OPERAND_LENGTH
and generalize to handle any number of operands.
(chrec_contains_undetermined): Likewise.
(tree_contains_chrecs): Likewise.
(evolution_function_is_invariant_rec_p): Use TREE_OPERAND_LENGTH.
* cgraphunit.c (update_call_expr): Use new CALL_EXPR accessors.
* tree-ssa-ccp.c (ccp_fold): Use new CALL_EXPR accessors. Use
fold_call_expr instead of fold_builtin.
(ccp_fold_builtin): Likewise. Update calls into builtins.c to
match declarations there.
(fold_stmt): Use new CALL_EXPR constructor and accessors. Doc
updates.
* tree-ssa-loop-ivopts.c (expr_invariant_in_loop_p): Use
TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH.
* ipa-pure-const.c (check_call): Use new CALL_EXPR accessors.
(scan_function): Add case tcc_vl_exp for CALL_EXPR.
* tree-stdarg.c (execute_optimize_stdarg): Use new CALL_EXPR
accessors.
* tree-ssa-math-opts.c (execute_cse_sincos_1): Use build_call_expr.
(execute_cse_sincos): Use new CALL_EXPR accessors.
* tree-ssa-alias.c (find_used_portions): Use new CALL_EXPR iterator.
* gimple-low.c (lower_function_body): Use build_call_expr.
(lower_builtin_setjmp): Likewise.
* expr.c (emit_block_move_via_libcall): Use build_call_expr.
(set_storage_via_libcall): Likewise.
(safe_from_p): Add tcc_vl_exp case. Use TREE_OPERAND_LENGTH
instead of TREE_CODE_LENGTH.
(expand_expr_real_1): Use new CALL_EXPR accessors.
* tree-browser.c (store_child_info): Use TREE_OPERAND_LENGTH and
generalize to handle any number of operands.
(TB_parent_eq): Likewise.
* predict.c (expr_expected_value): Use new CALL_EXPR accessors.
(strip_builtin_expect): Likewise.
* function.c (gimplify_parameters): Use build_call_expr.
* tree-vectorizer.c (vect_is_simple_reduction): Use TREE_OPERAND_LENGTH
instead of TREE_CODE_LENGTH.
* ipa-type-escape.c (check_call): Use new CALL_EXPR iterators.
(scan_for_refs): Add case tcc_vl_exp for CALL_EXPR.
* tree-data-ref.c (get_references_in_stmt): Use new CALL_EXPR
iterators.
* gimplify.c (build_stack_save_restore): Use build_call_expr.
(gimplify_decl_expr): Likewise.
(gimplify_call_expr): Use fold_call_expr instead of fold_builtin.
Use new CALL_EXPR iterators.
(gimplify_modify_expr_to_memcpy): Use build_call_expr.
(gimplify_modify_expr_to_memset): Likewise.
(gimplify_variable_sized_compare): Likewise.
(gimplify_omp_atomic_fetch_op): Likewise.
(gimplify_omp_atomic_pipeline): Likewise.
(gimplify_omp_atomic_mutex): Likewise.
(gimplify_function_tree): Likewise.
* calls.c (alloca_call_p): Use new CALL_EXPR accessors.
(call_expr_flags): Likewise.
(expand_call): Likewise.
* except.c (expand_builtin_eh_return_data_regno): Pass entire
CALL_EXPR as parameter instead of arglist. Use new CALL_EXPR
accessors.
* coverage.c (create_coverage): Use build_call_expr.
* tree-ssa-pre.c (expression_node_pool, list_node_pool): Delete.
(temp_call_expr_obstack): New.
(pool_copy_list): Delete.
(temp_copy_call_expr): New.
(phi_translate): Add case tcc_vl_exp for CALL_EXPR. Use new
CALL_EXPR accessors. Get rid of special goo for copying argument
lists and use temp_copy_call_expr instead.
(valid_in_sets): Add case tcc_vl_exp for CALL_EXPR. Use new
CALL_EXPR accessors.
(create_expression_by_pieces): Likewise. Use build_call_array
to construct the result instead of fold_build3.
(create_value_expr_from): Add tcc_vl_exp. Delete special goo for
dealing with argument lists.
(init_pre): Remove references to expression_node_pool and
list_node_pool. Init temp_call_expr_obstack instead.
(fini_pre): Remove references to expression_node_pool and
list_node_pool.
* tree-sra.c (sra_walk_call_expr): Use new CALL_EXPR accessors
and walk arguments explicitly instead of as a list.
* tree-mudflap.c (mf_build_check_statement_for): Use build_call_expr.
(mx_register_decls): Likewise.
(mudflap_register_call): Likewise.
(mudflap_finish_file): Likewise.
* ipa-prop.c (ipa_callsite_compute_count): Use new CALL_EXPR accessors.
(ipa_callsite_compute_param): Likewise.
* tree-vect-patterns.c (vect_recog_pow_pattern): Use new CALL_EXPR
accessors and constructor.
* tree-nested.c (convert_nl_goto_reference): Use new CALL_EXPR
accessors and constructor.
(convert_tramp_reference): Likewise.
(convert_call_expr): Likewise.
(finalize_nesting_tree_1): Likewise.
* tree-ssa.c (tree_ssa_useless_type_conversion): Use new CALL_EXPR
accessors.
* tree-ssa-loop-prefetch.c (issue_prefetch_ref): Use build_call_expr.
* tree-inline.c (initialize_inlined_parameters): Pass entire
CALL_EXPR as parameter instead of arglist. Use new CALL_EXPR
accessors.
(estimate_num_insns_1): Use new CALL_EXPR accessors.
(expand_call_inline): Tidy up call to initialize_inlined_parameters.
* tree-vect-transform.c (vect_create_epilog_for_reduction): Use
TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH.
(vectorizable_reduction): Likewise.
(vectorizable_call): Use new CALL_EXPR iterators.
(vectorizable_conversion): Use build_call_expr.
(vectorizable_operation): Use TREE_OPERAND_LENGTH.
(vect_gen_widened_results_half): Use build_call_expr.
(vect_setup_realignment): Likewise.
(vectorizable_live_operation): Use TREE_OPERAND_LENGTH.
* tree-object-size.c (alloc_object_size): Use new CALL_EXPR accessors.
(pass_through_call): Likewise.
(compute_object_sizes): Likewise. Use fold_call_expr instead of
fold_builtin.
* tree-profile.c (tree_gen_interval_profiler): Use build_call_expr.
(tree_gen_pow2_profiler): Likewise.
(tree_gen_one_value_profiler): Likewise.
(tree_gen_ic_func_profiler): Likewise.
(tree_gen_average_profiler): Likewise.
(tree_gen_ior_profiler): Likewise.
* tree-ssa-structalias.c (get_constraint_for): Add case tcc_vl_exp.
(find_func_aliases): Use new CALL_EXPR accessors. Add case
tcc_vl_exp. Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH.
* tree-ssa-reassoc.c (get_rank): Use TREE_OPERAND_LENGTH instead
of TREE_CODE_LENGTH.
* stmt.c (warn_if_unused_value): Use TREE_OPERAND_LENGTH instead
of TREE_CODE_LENGTH.
* convert.c (convert_to_real): Use new CALL_EXPR accessors and
constructor.
(convert_to_integer): Likewise.
* tree-ssa-operands.c (get_call_expr_operands): Use new CALL_EXPR
accessors.
2007-02-15 Sandra Loosemore <sandra@codesourcery.com>
Brooks Moses <brooks.moses@codesourcery.com>
Lee Millward <lee.millward@codesourcery.com>
* config/alpha/alpha.c (alpha_expand_builtin): Use new CALL_EXPR
accessors.
* config/frv/frv.c (frv_expand_builtin): Likewise.
* config/s390/s390.c (s390_expand_builtin): Likewise.
* config/sparc/sparc.c (sparc_gimplify_va_arg): Use build_call_expr.
(sparc_expand_builtin): Use new CALL_EXPR accessors.
* config/i386/i386.c (ix86_function_ok_for_sibcall): Likewise.
(ix86_expand_binop_builtin): Pass entire CALL_EXPR as parameter
instead of arglist. Use new CALL_EXPR accessors on it. Fix callers.
(ix86_expand_store_builtin): Likewise.
(ix86_expand_unop_builtin): Likewise.
(ix86_expand_unop1_builtin): Likewise.
(ix86_expand_sse_compare): Likewise.
(ix86_expand_sse_comi): Likewise.
(ix86_expand_vec_init_builtin): Likewise.
(ix86_expand_vec_ext_builtin): Likewise.
(ix86_expand_vec_set_builtin): Likewise.
(ix86_expand_builtin): Use new CALL_EXPR accessors.
* config/sh/sh.c (sh_expand_builtin): Use new CALL_EXPR accessors.
* config/c4x/c4x.c (c4x_expand_builtin): Likewise.
* config/iq2000/iq2000.c (expand_one_builtin): Pass entire CALL_EXPR
instead of arglist. Use new CALL_EXPR accessors. Fix callers.
(iq2000_expand_builtin): Use new CALL_EXPR accessors.
* config/rs6000/rs6000-c.c (altivec_build_resolved_builtin): Use
build_call_expr.
* config/rs6000/rs6000.c (rs6000_gimplify_va_arg): Likewise.
(rs6000_expand_unop_builtin): Pass entire CALL_EXPR instead of
arglist. Use new CALL_EXPR accessors. Fix callers.
(altivec_expand_abs_builtin): Likewise.
(rs6000_expand_binop_builtin): Likewise.
(altivec_expand_predicate_builtin): Likewise.
(altivec_expand_lv_builtin): Likewise.
(spe_expand_stv_builtin): Likewise.
(altivec_expand_stv_builtin): Likewise.
(rs6000_expand_ternop_builtin): Likewise.
(altivec_expand_ld_builtin): Use new CALL_EXPR accessors.
(altivec_expand_st_builtin): Likewise.
(altivec_expand_dst_builtin): Likewise.
(altivec_expand_vec_init_builtin): Pass entire CALL_EXPR instead of
arglist. Use new CALL_EXPR accessors. Fix callers.
(altivec_expand_vec_set_builtin): Likewise.
(altivec_expand_vec_ext_builtin): Likewise.
(altivec_expand_builtin): Use new CALL_EXPR accessors.
(spe_expand_builtin): Likewise.
(spe_expand_predicate_builtin): Pass entire CALL_EXPR instead of
arglist. Use new CALL_EXPR accessors. Fix callers.
(spe_expand_evsel_builtin): Likewise.
(rs6000_expand_builtin): Use new CALL_EXPR accessors. VCFUX and
FCFSX cases must construct whole new CALL_EXPR, not just arglist.
* config/arm/arm.c (arm_expand_binop_builtin): Pass entire CALL_EXPR
instead of arglist. Use new CALL_EXPR accessors. Fix callers.
(arm_expand_unop_builtin): Likewise.
(arm_expand_builtin): Use new CALL_EXPR accessors.
* config/mips/mips.c (mips_expand_builtin): Use new CALL_EXPR
accessors.
* config/bfin/bfin.c (bfin_expand_binop_builtin): Pass entire CALL_EXPR
instead of arglist. Use new CALL_EXPR accessors. Fix callers.
(bfin_expand_unop_builtin): Likewise.
(bfin_expand_builtin): Use new CALL_EXPR accessors.
2007-02-15 Sandra Loosemore <sandra@codesourcery.com>
Brooks Moses <brooks.moses@codesourcery.com>
Lee Millward <lee.millward@codesourcery.com>
* c-semantics.c (build_stmt): Add internal diagnostic check.
* c-pretty-print.c (pp_c_postfix_expression): Use new CALL_EXPR
accessors. Print arguments explicitly instead of as a list.
* c-typeck.c (build_function_call): Use new CALL_EXPR constructors.
* c-omp.c (c_finish_omp_barrier): Use build_call_expr.
(c_finish_omp_flish): Likewise.
* c-common.c (verify_tree): Use new CALL_EXPR accessors. Traverse
arguments explicitly instead of as a list. Use TREE_OPERAND_LENGTH
instead of TREE_CODE_LENGTH.
(check_function_arguments_recurse): Use new CALL_EXPR accessors.
(c_warn_unused_result): Likewise.
2007-02-15 Sandra Loosemore <sandra@codesourcery.com>
Brooks Moses <brooks.moses@codesourcery.com>
Lee Millward <lee.millward@codesourcery.com>
* cp-tree.def (AGGR_INIT_EXPR): Adjust documentation.
Change class to tcc_vl_exp.
* call.c (build_call): Use build_call_list instead
of build3.
(build_over_call): Likewise.
(build_new_method_call): Use build_min_non_dep_call_list
instead of build_min_non_dep.
* error.c (dump_call_expr_args): New function.
(dump_aggr_init_expr_args): New function.
(dump_expr) <AGGR_INIT_EXPR, CALL_EXPR, INDIRECT_REF>: Use them.
Update to use new CALL_EXPR and AGGR_INIT_EXPR accessor macros.
* cvt.c (convert_to_void): Use build_call_array instead
of build3; use new AGGR_INIT_EXPR accessor macros.
* mangle.c (write_expression): Use TREE_OPERAND_LENGTH
instead of TREE_CODE_LENGTH.
* dump.c (cp_dump_tree) <AGGR_INIT_EXPR>: Update to use new
AGGR_INIT_EXPR accessor macros.
* cp-gimplify.c (cp_gimplify_init_expr): Use
AGGR_INIT_EXPR_SLOT to set the slot operand.
* cp-tree.h (AGGR_INIT_EXPR_FN): New macro.
(AGGR_INIT_EXPR_SLOT): New macro.
(AGGR_INIT_EXPR_ARG): New macro.
(aggr_init_expr_nargs): New macro.
(AGGR_INIT_EXPR_ARGP): New macro.
(aggr_init_expr_arg_iterator): New.
(init_aggr_init_expr_arg_iterator): New.
(next_aggr_init_expr_arg): New.
(first_aggr_init_expr_arg): New.
(more_aggr_init_expr_args_p): New.
(FOR_EACH_AGGR_INIT_EXPR_ARG): New.
(stabilize_aggr_init): New declaration.
(build_min_non_dep_call_list): Likewise.
* tree.c (process_aggr_init_operands): New function.
(build_aggr_init_array) New function.
(build_cplus_new): Update to use new CALL_EXPR and
AGGR_INIT_EXPR accessor macros. Replace use of build3 with
build_aggr_init_array.
(build_min_non_dep_call_list) New function.
(build_min_nt): Assert input code parameter is not a variable
length expression class.
(build_min, build_min_non_dep): Likewise.
(cp_tree_equal) <CALL_EXPR>: Iterate through the arguments
to check for equality instead of recursing. Handle tcc_vl_exp
tree code classes.
(stabilize_call): Update to only handle CALL_EXPRs, not
AGGR_INIT_EXPRs; use new CALL_EXPR accessor macros.
(stabilize_aggr_init): New function.
(stabilize_init): Use it.
* cxx-pretty-print.c (pp_cxx_postfix_expression)
<AGGR_INIT_EXPR, CALL_EXPR>: Update to use new CALL_EXPR and
AGGR_INIT_EXPR accessor macros and argument iterators.
* pt.c (tsubst_copy) <CALL_EXPR>: Replace build_nt with
build_vl_exp. Iterate through the operands, recursively
processing each one.
(tsubst_copy_and_build) <CALL_EXPR>: Update to use new
CALL_EXPR accessor macros.
(value_dependent_expression_p) <default>: Handle tcc_vl_exp
tree code classes. Use TREE_OPERAND_LENGTH instead of
TREE_CODE_LENGTH.
* semantics.c (finish_call_expr): Use build_nt_call_list
instead of build_nt.
(simplify_aggr_init_expr): Update to use new AGGR_INIT_EXPR
accessor macros. Use build_call_array to construct the
CALL_EXPR node instead of build3
* decl2.c (build_offset_ref_call_from_tree): Use
build_nt_call_list and build_min_non_dep_call_list instead
of build_min_nt and build_min_non_dep.
* parser.c (cp_parser_postfix_expression) <CPP_OPEN_PAREN>:
Use build_nt_call_list instead of build_min_nt.
2007-02-15 Sandra Loosemore <sandra@codesourcery.com>
Brooks Moses <brooks.moses@codesourcery.com>
Lee Millward <lee.millward@codesourcery.com>
* java-tree.h (BUILD_MONITOR_ENTER): Use build_call_nary instead
of build3.
(BUILD_MONITOR_EXIT): Likewise.
* java-gimplify.c (java_gimplify_component_ref): Use build_call_expr.
(java_gimplify_modify_expr): Likewise.
* class.c (cache_this_class_ref): Use build_call_expr.
(build_static_field_ref): Likewise.
(emit_indirect_register_classes): Likewise.
(emit_register_classes): Likewise.
* resource.c (write_resource_constructor): Use build_call_expr.
* builtins.c (builtin_creator_function): Change interpretation of
the second parameter to be the whole CALL_EXPR instead of the arglist.
(max_builtin): Tweak parameter list. Use new CALL_EXPR accessors.
(min_builtin): Likewise.
(abs_builtin): Likewise.
(java_build_function_call_expr): Likewise.
(convert_real): Likewise.
(UNMARSHAL3): Likewise.
(UNMARSHAL4): Likewise.
(UNMARSHAL5): Likewise.
(build_arglist_for_builtin): Delete. Fix callers to use
build_call_expr instead.
(putObject_builtin): Tweak parameter list. Use new CALL_EXPR
accessors.
(compareAndSwapInt_builtin): Likewise.
(compareAndSwapLong_builtin): Likewise.
(compareAndSwapObject_builtin): Likewise.
(putVolatile_builtin): Likewise.
(getVolatile_builtin): Likewise.
(VMSupportsCS8_builtin): Likewise.
(check_for_builtin): Pass entire CALL_EXPR to builtin expander
instead of arglist.
* expr.c (build_java_athrow): Use build_call_nary instead of build3.
(build_java_throw_out_of_bounds_exception): Likewise.
(java_check_reference): Likewise.
(build_java_arraystore_check): Likewise.
(build_newarray): Likewise.
(build_anewarray): Likewise.
(expand_java_multinewarray): Use build_call_list instead of build3.
(build_java_monitor): Use build_call_nary instead of build3.
(java_create_object): Likewise.
(expand_java_NEW): Likewise.
(build_instanceof): Likewise.
(expand_java_CHECKCAST): Likewise.
(build_java_soft_divmod): Likewise.
(build_java_binop): Likewise.
(build_field_ref): Likewise.
(build_class_init): Likewise.
(rewrite_arglist_getcaller): Use build_call_expr.
(build_invokeinterface): Use build_call_nary instead of build3.
(expand_invoke): Use build_call_list instead of build3.
(build_jni_stub): Use build_call_nary, build_call_list, or
build_call_expr instead of build3.
(expand_java_field_op): Use build_call_expr instead of build3.
(force_evaluation_order): Use new CALL_EXPR accessors.
* lang.c (java_get_callee_fndecl): Use new CALL_EXPR accessors.
2007-02-15 Sandra Loosemore <sandra@codesourcery.com>
Brooks Moses <brooks.moses@codesourcery.com>
Lee Millward <lee.millward@codesourcery.com>
* objc-act.c (receiver_is_class_object): Use new CALL_EXPR accessors.
(objc_get_callee_fndecl): Likewise.
2007-02-15 Sandra Loosemore <sandra@codesourcery.com>
Brooks Moses <brooks.moses@codesourcery.com>
Lee Millward <lee.millward@codesourcery.com>
* trans-expr.c (gfc_conv_power_op): Use build_call_expr.
(gfc_conv_string_tmp): Likewise.
(gfc_conv_concat_op): Likewise.
(gfc_build_compare_string): Likewise.
(gfc_conv_function_call): Use build_call_list instead of build3.
* trans-array.c (gfc_trans_allocate_array_storage): Use
build_call_expr.
(gfc_grow_array): Likewise.
(gfc_trans_array_ctor_element): Likewise.
(gfc_trans_array_constructor_value): Likewise.
(gfc_array_allocate): Likewise.
(gfc_array_deallocate): Likewise.
(gfc_trans_auto_array_allocation): Likewise.
(gfc_trans_dummy_array_bias): Likewise.
(gfc_conv_array_parameter): Likewise.
(gfc_trans_dealloc_allocated): Likewise.
(gfc_duplicate_allocatable): Likewise.
* trans-openmp.c (gfc_trans_omp_barrier): Use build_call_expr.
(gfc_trans_omp_flush): Likewise.
* trans-stmt.c (gfc_conv_elementel_dependencies): Use build_call_expr.
(gfc_trans_pause): Likewise.
(gfc_trans_stop): Likewise.
(gfc_trans_character_select): Likewise.
(gfc_do_allocate): Likewise.
(gfc_trans_assign_need_temp): Likewise.
(gfc_trans_pointer_assign_need_temp): Likewise.
(gfc_trans_forall_1): Likewise.
(gfc_trans_where_2): Likewise.
(gfc_trans_allocate): Likewise.
(gfc_trans_deallocate): Likewise.
* trans.c (gfc_trans_runtime_check): Use build_call_expr.
* trans-io.c (gfc_trans_open): Use build_call_expr.
(gfc_trans_close): Likewise.
(build_filepos): Likewise.
(gfc_trans_inquire): Likewise.
(NML_FIRST_ARG): Delete.
(NML_ADD_ARG): Delete.
(transfer_namelist_element): Use build_call_expr.
(build_dt): Likewise.
(gfc_trans_dt_end): Likewise.
(transfer_expr): Likewise.
(transfer_array-desc): Likewise.
* trans-decl.c (gfc_generate_function_code): Use build_call_expr.
(gfc_generate_constructors): Likewise.
* trans-intrinsic.c (gfc_conv_intrinsic_ctime): Use build_call_expr.
(gfc_conv_intrinsic_fdate): Likewise.
(gfc_conv_intrinsic_ttynam): Likewise.
(gfc_conv_intrinsic_array_transfer): Likewise.
(gfc_conv_associated): Likewise.
(gfc_conv_intrinsic_si_kind): Likewise.
(gfc_conv_intrinsic_trim): Likewise.
(gfc_conv_intrinsic_repeat: Likewise.
(gfc_conv_intrinsic_iargc): Likewise.
Co-Authored-By: Brooks Moses <brooks.moses@codesourcery.com>
Co-Authored-By: Lee Millward <lee.millward@codesourcery.com>
From-SVN: r122018
2007-02-16 00:50:49 +01:00
|
|
|
@code{POINTER_TYPE}.
|
|
|
|
|
|
|
|
The number of arguments to the call is returned by @code{call_expr_nargs},
|
|
|
|
while the arguments themselves can be accessed with the @code{CALL_EXPR_ARG}
|
|
|
|
macro. The arguments are zero-indexed and numbered left-to-right.
|
|
|
|
You can iterate over the arguments using @code{FOR_EACH_CALL_EXPR_ARG}, as in:
|
|
|
|
|
|
|
|
@smallexample
|
|
|
|
tree call, arg;
|
|
|
|
call_expr_arg_iterator iter;
|
|
|
|
FOR_EACH_CALL_EXPR_ARG (arg, iter, call)
|
|
|
|
/* arg is bound to successive arguments of call. */
|
|
|
|
...;
|
|
|
|
@end smallexample
|
|
|
|
|
|
|
|
For non-static
|
1999-09-19 17:50:40 +02:00
|
|
|
member functions, there will be an operand corresponding to the
|
|
|
|
@code{this} pointer. There will always be expressions corresponding to
|
|
|
|
all of the arguments, even if the function is declared with default
|
|
|
|
arguments and some arguments are not explicitly provided at the call
|
|
|
|
sites.
|
|
|
|
|
tree.h (enum tree_code_class): Add tcc_vl_exp.
2007-02-15 Sandra Loosemore <sandra@codesourcery.com>
Brooks Moses <brooks.moses@codesourcery.com>
Lee Millward <lee.millward@codesourcery.com>
* tree.h (enum tree_code_class): Add tcc_vl_exp.
(VL_EXP_CLASS_P): New.
(TREE_OPERAND_CHECK): Use TREE_OPERAND_LENGTH instead of
TREE_CODE_LENGTH.
(TREE_OPERAND_CHECK_CODE): Likewise.
(GIMPLE_STMT_OPERAND_CHECK): Likewise.
(TREE_RTL_OPERAND_CHECK): Likewise.
(tree_operand_check_failed): Make second parameter the whole tree
instead of its code. Fixed callers.
(VL_EXP_CHECK): New.
(TREE_OPERAND_LENGTH): New.
(VL_EXP_OPERAND_LENGTH): New.
(CALL_EXPR_FN): New.
(CALL_EXPR_STATIC_CHAIN): New.
(CALL_EXPR_ARGS): New.
(CALL_EXPR_ARG): New.
(call_expr_nargs): New.
(CALL_EXPR_ARGP): New.
(build_nt_call_list): Declare.
(build_vl_exp_stat): Declare.
(build_vl_exp): New.
(build_call_list): Declare.
(build_call_nary): Declare.
(build_call_valist): Declare.
(build_call_array): Declare.
(call_expr_arg): Declare.
(call_expr_argp): Declare.
(call_expr_arglist): Declare.
(fold_build_call_list): Declare.
(fold_build_call_list_initializer): Declare.
(fold_call_expr): Declare to replace fold_builtin.
(fold_builtin_fputs): Update to agree with modified definition.
(fold_builtin_strcpy): Likewise.
(fold_builtin_strncpy): Likewise.
(fold_builtin_memory_chk): Likewise.
(fold_builtin_stxcpy_chk): Likewise.
(fold_builtin_strncpy_chk): Likewise.
(fold_builtin_next_arg): Likewise.
(fold_build_call_expr): Declare.
(fold_builtin_call_list): Declare.
(fold_builtin_call_valist): Declare.
(build_call_expr): Declare.
(validate_arglist): Update to agree with modified definition.
(tree_operand_length): New.
(call_expr_arg_iterator): New.
(init_call_expr_arg_iterator): New.
(next_call_expr_arg): New.
(first_call_expr_arg): New.
(more_call_expr_args_p): New.
(FOR_EACH_CALL_EXPR_ARG): New.
* tree.c (tree_code_class_string): Add entries for tcc_vl_exp
and tcc_gimple_stmt.
(tree_code_size): Update documentation. Use sizeof (tree) rather
than sizeof (char *).
(tree_size): Likewise. Add case for tcc_vl_exp.
(tree_node_structure): Add case for tcc_vl_exp.
(contains_placeholder_p): Likewise.
(substitute_in_expr): Likewise.
(substitute_placeholder_in_expr): Likewise.
(stabilize_reference_1): Likewise.
(build3_stat): Remove logic for CALL_EXPRs. Replace with assertion
to diagnose breakage of this interface for constructing CALL_EXPRs.
(build_nt): Add similar assertion here.
(build_nt_call_list): New.
(simple_cst_equal) <CALL_EXPR>: Rewrite to use new accessors.
(iterative_hash_expr): Use TREE_OPERAND_LENGTH instead of
TREE_CODE_LENGTH.
(get_callee_fndecl): Use new CALL_EXPR accessors.
(tree_operand_check_failed): Change parameters to pass entire node
instead of its code, so that we can call TREE_OPERAND_LENGTH on it.
(process_call_operands): New.
(build_vl_exp_stat): New.
(build_call_list): New.
(build_call_nary): New.
(build_call_valist): New.
(build_call_array): New.
(walk_tree): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH.
(call_expr_arglist): New.
* tree.def (CALL_EXPR): Change representation of CALL_EXPRs to use
tcc_vl_exp instead of a fixed-size tcc_expression.
* doc/c-tree.texi (CALL_EXPR): Document new representation and
accessors for CALL_EXPRs.
(AGGR_INIT_EXPR): Likewise.
2007-02-15 Sandra Loosemore <sandra@codesourcery.com>
Brooks Moses <brooks.moses@codesourcery.com>
Lee Millward <lee.millward@codesourcery.com>
* builtins.c (c_strlen): Return NULL_TREE instead of 0.
(expand_builtin_nonlocal_goto): Change parameter to be entire
CALL_EXPR instead of an arglist. Use new CALL_EXPR accessors.
(expand_builtin_prefetch): Likewise.
(expand_builtin_classify_type): Likewise.
(mathfn_built_in): Return NULL_TREE instead of 0.
(expand_errno_check): Use new CALL_EXPR accessors.
(expand_builtin_mathfn): Use new CALL_EXPR accessors and constructors.
Return NULL_RTX instead of 0.
(expand_builtin_mathfn_2): Likewise.
(expand_builtin_mathfn_3): Likewise.
(expand_builtin_interclass_mathfn): Likewise.
(expand_builtin_sincos): Likewise.
(expand_builtin_cexpi): Likewise.
(expand_builtin_int_roundingfn): Likewise.
(expand_builtin_int_roundingfn_2): Likewise.
(expand_builtin_pow): Likewise.
(expand_builtin_powi): Likewise.
(expand_builtin_strlen): Pass entire CALL_EXPR as parameter instead
of arglist, fixing callers appropriately. Use new CALL_EXPR
accessors and constructors. Return NULL_RTX instead of 0.
(expand_builtin_strstr): Likewise.
(expand_builtin_strchr): Likewise.
(expand_builtin_strrchr): Likewise.
(expand_builtin_strpbrk): Likewise.
(expand_builtin_memcpy): Likewise.
(expand_builtin_mempcpy): Likewise.
(expand_builtin_mempcpy_args): New.
(expand_builtin_memmove): Similarly to expand_builtin_mempcpy.
(expand_builtin_memmove_args): New.
(expand_builtin_bcopy): Similarly to expand_builtin_mempcpy.
(expand_movstr): Likewise.
(expand_builtin_strcpy): Likewise.
(expand_builtin_strcpy_args): New.
(expand_builtin_stpcpy): Similarly to expand_builtin_strcpy.
(expand_builtin_strncpy): Likewise.
(expand_builtin_memset): Likewise.
(expand_builtin_memset_args): New.
(expand_builtin_bzero): Similarly to expand_builtin_memset.
(expand_builtin_memcmp): Likewise.
(expand_builtin_strcmp): Likewise.
(expand_builtin_strncmp): Likewise.
(expand_builtin_strcat): Likewise.
(expand_builtin_strncat): Likewise.
(expand_builtin_strspn): Likewise.
(expand_builtin_strcspn): Likewise.
(expand_builtin_args_info): Likewise.
(expand_builtin_va_start): Likewise.
(gimplify_va_arg_expr): Likewise.
(expand_builtin_va_end): Likewise.
(expand_builtin_va_copy): Likewise.
(expand_builtin_frame_address): Likewise.
(expand_builtin_alloca): Likewise.
(expand_builtin_bswap): Likewise.
(expand_builtin_unop): Likewise.
(expand_builtin_fputs): Likewise.
(expand_builtin_expect): Likewise.
(expand_builtin_fabs): Likewise.
(expand_builtin_copysign): Likewise.
(expand_builtin_printf): Likewise.
(expand_builtin_fprintf): Likewise.
(expand_builtin_sprintf): Likewise.
(expand_builtin_init_trampoline): Likewise.
(expand_builtin_signbit): Likewise.
(expand_builtin_fork_or_exec): Likewise.
(expand_builtin_sync_operation): Likewise.
(expand_builtin_compare_and_swap): Likewise.
(expand_builtin_lock_test_and_set): Likewise.
(expand_builtin_lock_release): Likewise.
(expand_builtin): Likewise.
(builtin_mathfn_code): Likewise.
(fold_builtin_constant_p): Pass call arguments individually instead
of as an arglist, fixing callers appropriately. Use new CALL_EXPR
accessors and constructors. Return NULL_TREE instead of 0.
(fold_builtin_expect): Likewise.
(fold_builtin_classify_type): Likewise.
(fold_builtin_strlen): Likewise.
(fold_builtin_nan): Likewise.
(integer_valued_real_p): Likewise.
(fold_trunc_transparent_mathfn): Likewise.
(fold_fixed_mathfn): Likewise.
(fold_builtin_cabs): Likewise.
(fold_builtin_sqrt): Likewise.
(fold_builtin_cbrt): Likewise.
(fold_builtin_cos): Likewise.
(fold_builtin_cosh): Likewise.
(fold_builtin_tan): Likewise.
(fold_builtin_sincos): Likewise.
(fold_builtin_cexp): Likewise.
(fold_builtin_trunc): Likewise.
(fold_builtin_floor): Likewise.
(fold_builtin_ceil): Likewise.
(fold_builtin_round): Likewise.
(fold_builtin_int_roundingfn): Likewise.
(fold_builtin_bitop): Likewise.
(fold_builtin_bswap): Likewise.
(fold_builtin_logarithm): Likewise.
(fold_builtin_hypot): Likewise.
(fold_builtin_pow): Likewise.
(fold_builtin_powi): Likewise.
(fold_builtin_exponent): Likewise.
(fold_builtin_memset): Likewise.
(fold_builtin_bzero): Likewise.
(fold_builtin_memory_op): Likewise.
(fold_builtin_bcopy): Deleted; call site changed to invoke
fold_builtin_memory_op directly.
(fold_builtin_strcpy): Similarly as for fold_builtin_memory_op.
(fold_builtin_strncpy): Likewise.
(fold_builtin_memcmp): Likewise.
(fold_builtin_strcmp): Likewise.
(fold_builtin_strncmp): Likewise.
(fold_builtin_signbit): Likewise.
(fold_builtin_copysign): Likewise.
(fold_builtin_isascii): Likewise.
(fold_builtin_toascii): Likewise.
(fold_builtin_isdigit): Likewise.
(fold_builtin_fabs): Likewise.
(fold_builtin_abs): Likewise.
(fold_builtin_fmin_fmax): Likewise.
(fold_builtin_carg): Likewise.
(fold_builtin_classify): Likewise.
(fold_builtin_unordered_cmp): Likewise.
(fold_builtin_0, fold_builtin_2, fold_builtin_3, fold_builtin_4):
New functions split out from fold_builtin_1.
(fold_builtin_n): New.
(fold_builtin_varargs): New.
(fold_builtin): Deleted. Most callers changed to use fold_call_expr
instead.
(fold_call_expr): New.
(build_function_call_expr): Rewrite to use new helper function.
(fold_builtin_call_list): New.
(build_call_expr): New.
(fold_builtin_call_valist): New.
(rewrite_call_expr): New.
(validate_arg): New.
(validate_arglist): Change parameter to be entire CALL_EXPR instead
of an arglist. Change return type to bool. Use new CALL_EXPR
accessors.
(fold_builtin_strstr): Pass call arguments individually instead
of as an arglist, fixing callers appropriately. Use new CALL_EXPR
accessors and constructors. Return NULL_TREE instead of 0.
(fold_builtin_strchr): Likewise.
(fold_builtin_strrchr): Likewise.
(fold_builtin_strpbrk): Likewise.
(fold_builtin_strcat): Likewise.
(fold_builtin_strncat): Likewise.
(fold_builtin_strspn): Likewise.
(fold_builtin_strcspn): Likewise.
(fold_builtin_fputs): Likewise.
(fold_builtin_next_arg): Likewise.
(fold_builtin_sprintf): Likewise.
(expand_builtin_object_size): Use new CALL_EXPR accessors. Use
NULL_RTX instead of 0.
(expand_builtin_memory_chk): Likewise.
(maybe_emit_chk_warning): Likewise.
(maybe_emit_sprintf_chk_warning): Likewise.
(fold_builtin_object_size): Pass call arguments individually instead
of as an arglist, fixing callers appropriately. Use new CALL_EXPR
accessors and constructors. Return NULL_TREE instead of 0.
(fold_builtin_memory_chk): Likewise.
(fold_builtin_stxcpy_chk): Likewise.
(fold_builtin_strncpy_chk): Likewise.
(fold_builtin_strcat_chk): Likewise.
(fold_builtin_strcat_chk): Likewise.
(fold_builtin_strncat_chk): Likewise.
(fold_builtin_sprintf_chk): Likewise.
(fold_builtin_snprintf_chk): Likewise.
(fold_builtin_printf): Likewise.
(fold_builtin_vprintf): Likewise.
* fold-const.c (negate_expr_p): Use new CALL_EXPR accessors and
constructors.
(operand_equal_p): Add separate tcc_vl_exp/CALL_EXPR case.
(make_range): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH.
(extract_muldiv_1): Add VL_EXP_CLASS_P case.
(fold_mathfn_compare): Use new CALL_EXPR accessors and constructors.
(fold_unary): Likewise.
(fold_binary): Likewise.
(fold_ternary): Remove CALL_EXPR case, since they are no longer
ternary expressions.
(fold): Add logic for tcc_vl_exp.
(fold_checksum_tree): Make it know about tcc_vl_exp. Use
TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH.
(fold_build3_stat): Add assertion to flag broken interface for
constructing CALL_EXPRs.
(fold_build_call_list): New.
(fold_build_call_list_initializer): New.
(tree_expr_nonnegative_p): Use new CALL_EXPR accessors and
constructors.
(fold_strip_sign_ops): Likewise.
2007-02-15 Sandra Loosemore <sandra@codesourcery.com>
Brooks Moses <brooks.moses@codesourcery.com>
Lee Millward <lee.millward@codesourcery.com>
* tree-dump.c (dequeue_and_dump) <CALL_EXPR>: Use new CALL_EXPR
accessors and dump arguments explicitly.
* tree-pretty-print.c (do_niy): Use TREE_OPERAND_LENGTH instead of
TREE_CODE_LENGTH.
(dump_generic_node): Use new CALL_EXPR accessors and walk arguments
explicitly.
(print_call_name): Use new CALL_EXPR accessors.
* print-tree.c (print_node): Add case tcc_vl_exp. Print
CALL_EXPR arguments explicitly instead of as a list. Use
TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH.
* tree-vrp.c (stmt_interesting_for_vrp): Use new CALL_EXPR accessors.
(vrp_visit_stmt): Likewise.
* tree-ssa-loop-im.c (outermost_invariant_loop_expr): Make it
know about tcc_vl_exp. Use TREE_OPERAND_LENGTH instead of
TREE_CODE_LENGTH.
(force_move_till_expr): Likewise.
* targhooks.c (default_external_stack_protect_fail): Use
build_call_expr instead of build_function_call_expr.
(default_hidden_stack_protect_fail): Likewise.
* tree-complex.c (expand_complex_libcall): Use build_call_expr to
build the call.
* cgraphbuild.c (build_cgraph_edges): Use new CALL_EXPR accessors
and walk arguments explicitly.
* tree-ssa-loop-niter.c (simplify_replace_tree): Use
TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH.
(expand_simple_operations): Likewise.
(infer_loop_bounds_from_array): Use new CALL_EXPR accessors.
* gengtype.c (adjust_field_tree_exp): Use TREE_OPERAND_LENGTH instead
of TREE_CODE_LENGTH.
(walk_type): Tweak walking of arrays not to blow up on CALL_EXPRs.
* optabs.c (expand_widen_pattern-expr): Use TREE_OPERAND_LENGTH
instead of TREE_CODE_LENGTH.
* value_prof.c (tree_ic): Use new CALL_EXPR accessors.
(tree_ic_transform): Likewise.
(interesting_stringop_to_profile_p): Pass entire CALL_EXPR as
parameter instead of arglist. Fix callers.
(tree_stringop_fixed_value): Use new CALL_EXPR accessors.
(tree_stringops_transform): Likewise.
(tree_indirect_call_to_profile): Likewise.
(tree_stringops_values_to_profile): Likewise.
* tree-tailcall.c (find_tail_calls): Use new CALL_EXPR iterator.
(eliminate_tail_call): Likewise.
* ipa-cp.c (ipcp_update_callgraph): Use new CALL_EXPR accessors.
* tree-scalar-evolution.c (chrec_contains_symbols_defined_in_loop):
Use TREE_OPERAND_LENGTH and generalize to handle any number of
operands.
(instantiate_parameters_1): Can't handle tcc_vl_exp here.
* omp-low.c (build_omp_barrier): Use build_call_expr.
(lower_rec_input_clauses): Likewise.
(lower_reduction_clauses): Likewise.
(expand_parallel_call): Likewise.
(maybe_catch_exception): Likewise.
(expand_omp_for_generic): Likewise.
(expand_omp_for_static_nochunk): Likewise.
(expand_omp_sections): Likewise.
(lower_omp_single_simple): Likewise.
(lower_omp_single_copy): Likewise.
(lower_omp_master): Likewise.
(lower_omp_ordered): Likewise.
(lower_omp_critical): Likewise.
* ipa-reference.c (check-call): Use new CALL_EXPR iterator.
(scan_for_static_refs): Create tcc_vl_exp case for CALL_EXPR.
* tree-gimple.c (is_gimple_call_addr): Fix doc.
(recalculate_side_effects): Use TREE_OPERAND_LENGTH instead of
TREE_CODE_LENGTH. Add tcc_vl_exp case.
* tree-chrec.c (chrec_contains_symbols): Use TREE_OPERAND_LENGTH
and generalize to handle any number of operands.
(chrec_contains_undetermined): Likewise.
(tree_contains_chrecs): Likewise.
(evolution_function_is_invariant_rec_p): Use TREE_OPERAND_LENGTH.
* cgraphunit.c (update_call_expr): Use new CALL_EXPR accessors.
* tree-ssa-ccp.c (ccp_fold): Use new CALL_EXPR accessors. Use
fold_call_expr instead of fold_builtin.
(ccp_fold_builtin): Likewise. Update calls into builtins.c to
match declarations there.
(fold_stmt): Use new CALL_EXPR constructor and accessors. Doc
updates.
* tree-ssa-loop-ivopts.c (expr_invariant_in_loop_p): Use
TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH.
* ipa-pure-const.c (check_call): Use new CALL_EXPR accessors.
(scan_function): Add case tcc_vl_exp for CALL_EXPR.
* tree-stdarg.c (execute_optimize_stdarg): Use new CALL_EXPR
accessors.
* tree-ssa-math-opts.c (execute_cse_sincos_1): Use build_call_expr.
(execute_cse_sincos): Use new CALL_EXPR accessors.
* tree-ssa-alias.c (find_used_portions): Use new CALL_EXPR iterator.
* gimple-low.c (lower_function_body): Use build_call_expr.
(lower_builtin_setjmp): Likewise.
* expr.c (emit_block_move_via_libcall): Use build_call_expr.
(set_storage_via_libcall): Likewise.
(safe_from_p): Add tcc_vl_exp case. Use TREE_OPERAND_LENGTH
instead of TREE_CODE_LENGTH.
(expand_expr_real_1): Use new CALL_EXPR accessors.
* tree-browser.c (store_child_info): Use TREE_OPERAND_LENGTH and
generalize to handle any number of operands.
(TB_parent_eq): Likewise.
* predict.c (expr_expected_value): Use new CALL_EXPR accessors.
(strip_builtin_expect): Likewise.
* function.c (gimplify_parameters): Use build_call_expr.
* tree-vectorizer.c (vect_is_simple_reduction): Use TREE_OPERAND_LENGTH
instead of TREE_CODE_LENGTH.
* ipa-type-escape.c (check_call): Use new CALL_EXPR iterators.
(scan_for_refs): Add case tcc_vl_exp for CALL_EXPR.
* tree-data-ref.c (get_references_in_stmt): Use new CALL_EXPR
iterators.
* gimplify.c (build_stack_save_restore): Use build_call_expr.
(gimplify_decl_expr): Likewise.
(gimplify_call_expr): Use fold_call_expr instead of fold_builtin.
Use new CALL_EXPR iterators.
(gimplify_modify_expr_to_memcpy): Use build_call_expr.
(gimplify_modify_expr_to_memset): Likewise.
(gimplify_variable_sized_compare): Likewise.
(gimplify_omp_atomic_fetch_op): Likewise.
(gimplify_omp_atomic_pipeline): Likewise.
(gimplify_omp_atomic_mutex): Likewise.
(gimplify_function_tree): Likewise.
* calls.c (alloca_call_p): Use new CALL_EXPR accessors.
(call_expr_flags): Likewise.
(expand_call): Likewise.
* except.c (expand_builtin_eh_return_data_regno): Pass entire
CALL_EXPR as parameter instead of arglist. Use new CALL_EXPR
accessors.
* coverage.c (create_coverage): Use build_call_expr.
* tree-ssa-pre.c (expression_node_pool, list_node_pool): Delete.
(temp_call_expr_obstack): New.
(pool_copy_list): Delete.
(temp_copy_call_expr): New.
(phi_translate): Add case tcc_vl_exp for CALL_EXPR. Use new
CALL_EXPR accessors. Get rid of special goo for copying argument
lists and use temp_copy_call_expr instead.
(valid_in_sets): Add case tcc_vl_exp for CALL_EXPR. Use new
CALL_EXPR accessors.
(create_expression_by_pieces): Likewise. Use build_call_array
to construct the result instead of fold_build3.
(create_value_expr_from): Add tcc_vl_exp. Delete special goo for
dealing with argument lists.
(init_pre): Remove references to expression_node_pool and
list_node_pool. Init temp_call_expr_obstack instead.
(fini_pre): Remove references to expression_node_pool and
list_node_pool.
* tree-sra.c (sra_walk_call_expr): Use new CALL_EXPR accessors
and walk arguments explicitly instead of as a list.
* tree-mudflap.c (mf_build_check_statement_for): Use build_call_expr.
(mx_register_decls): Likewise.
(mudflap_register_call): Likewise.
(mudflap_finish_file): Likewise.
* ipa-prop.c (ipa_callsite_compute_count): Use new CALL_EXPR accessors.
(ipa_callsite_compute_param): Likewise.
* tree-vect-patterns.c (vect_recog_pow_pattern): Use new CALL_EXPR
accessors and constructor.
* tree-nested.c (convert_nl_goto_reference): Use new CALL_EXPR
accessors and constructor.
(convert_tramp_reference): Likewise.
(convert_call_expr): Likewise.
(finalize_nesting_tree_1): Likewise.
* tree-ssa.c (tree_ssa_useless_type_conversion): Use new CALL_EXPR
accessors.
* tree-ssa-loop-prefetch.c (issue_prefetch_ref): Use build_call_expr.
* tree-inline.c (initialize_inlined_parameters): Pass entire
CALL_EXPR as parameter instead of arglist. Use new CALL_EXPR
accessors.
(estimate_num_insns_1): Use new CALL_EXPR accessors.
(expand_call_inline): Tidy up call to initialize_inlined_parameters.
* tree-vect-transform.c (vect_create_epilog_for_reduction): Use
TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH.
(vectorizable_reduction): Likewise.
(vectorizable_call): Use new CALL_EXPR iterators.
(vectorizable_conversion): Use build_call_expr.
(vectorizable_operation): Use TREE_OPERAND_LENGTH.
(vect_gen_widened_results_half): Use build_call_expr.
(vect_setup_realignment): Likewise.
(vectorizable_live_operation): Use TREE_OPERAND_LENGTH.
* tree-object-size.c (alloc_object_size): Use new CALL_EXPR accessors.
(pass_through_call): Likewise.
(compute_object_sizes): Likewise. Use fold_call_expr instead of
fold_builtin.
* tree-profile.c (tree_gen_interval_profiler): Use build_call_expr.
(tree_gen_pow2_profiler): Likewise.
(tree_gen_one_value_profiler): Likewise.
(tree_gen_ic_func_profiler): Likewise.
(tree_gen_average_profiler): Likewise.
(tree_gen_ior_profiler): Likewise.
* tree-ssa-structalias.c (get_constraint_for): Add case tcc_vl_exp.
(find_func_aliases): Use new CALL_EXPR accessors. Add case
tcc_vl_exp. Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH.
* tree-ssa-reassoc.c (get_rank): Use TREE_OPERAND_LENGTH instead
of TREE_CODE_LENGTH.
* stmt.c (warn_if_unused_value): Use TREE_OPERAND_LENGTH instead
of TREE_CODE_LENGTH.
* convert.c (convert_to_real): Use new CALL_EXPR accessors and
constructor.
(convert_to_integer): Likewise.
* tree-ssa-operands.c (get_call_expr_operands): Use new CALL_EXPR
accessors.
2007-02-15 Sandra Loosemore <sandra@codesourcery.com>
Brooks Moses <brooks.moses@codesourcery.com>
Lee Millward <lee.millward@codesourcery.com>
* config/alpha/alpha.c (alpha_expand_builtin): Use new CALL_EXPR
accessors.
* config/frv/frv.c (frv_expand_builtin): Likewise.
* config/s390/s390.c (s390_expand_builtin): Likewise.
* config/sparc/sparc.c (sparc_gimplify_va_arg): Use build_call_expr.
(sparc_expand_builtin): Use new CALL_EXPR accessors.
* config/i386/i386.c (ix86_function_ok_for_sibcall): Likewise.
(ix86_expand_binop_builtin): Pass entire CALL_EXPR as parameter
instead of arglist. Use new CALL_EXPR accessors on it. Fix callers.
(ix86_expand_store_builtin): Likewise.
(ix86_expand_unop_builtin): Likewise.
(ix86_expand_unop1_builtin): Likewise.
(ix86_expand_sse_compare): Likewise.
(ix86_expand_sse_comi): Likewise.
(ix86_expand_vec_init_builtin): Likewise.
(ix86_expand_vec_ext_builtin): Likewise.
(ix86_expand_vec_set_builtin): Likewise.
(ix86_expand_builtin): Use new CALL_EXPR accessors.
* config/sh/sh.c (sh_expand_builtin): Use new CALL_EXPR accessors.
* config/c4x/c4x.c (c4x_expand_builtin): Likewise.
* config/iq2000/iq2000.c (expand_one_builtin): Pass entire CALL_EXPR
instead of arglist. Use new CALL_EXPR accessors. Fix callers.
(iq2000_expand_builtin): Use new CALL_EXPR accessors.
* config/rs6000/rs6000-c.c (altivec_build_resolved_builtin): Use
build_call_expr.
* config/rs6000/rs6000.c (rs6000_gimplify_va_arg): Likewise.
(rs6000_expand_unop_builtin): Pass entire CALL_EXPR instead of
arglist. Use new CALL_EXPR accessors. Fix callers.
(altivec_expand_abs_builtin): Likewise.
(rs6000_expand_binop_builtin): Likewise.
(altivec_expand_predicate_builtin): Likewise.
(altivec_expand_lv_builtin): Likewise.
(spe_expand_stv_builtin): Likewise.
(altivec_expand_stv_builtin): Likewise.
(rs6000_expand_ternop_builtin): Likewise.
(altivec_expand_ld_builtin): Use new CALL_EXPR accessors.
(altivec_expand_st_builtin): Likewise.
(altivec_expand_dst_builtin): Likewise.
(altivec_expand_vec_init_builtin): Pass entire CALL_EXPR instead of
arglist. Use new CALL_EXPR accessors. Fix callers.
(altivec_expand_vec_set_builtin): Likewise.
(altivec_expand_vec_ext_builtin): Likewise.
(altivec_expand_builtin): Use new CALL_EXPR accessors.
(spe_expand_builtin): Likewise.
(spe_expand_predicate_builtin): Pass entire CALL_EXPR instead of
arglist. Use new CALL_EXPR accessors. Fix callers.
(spe_expand_evsel_builtin): Likewise.
(rs6000_expand_builtin): Use new CALL_EXPR accessors. VCFUX and
FCFSX cases must construct whole new CALL_EXPR, not just arglist.
* config/arm/arm.c (arm_expand_binop_builtin): Pass entire CALL_EXPR
instead of arglist. Use new CALL_EXPR accessors. Fix callers.
(arm_expand_unop_builtin): Likewise.
(arm_expand_builtin): Use new CALL_EXPR accessors.
* config/mips/mips.c (mips_expand_builtin): Use new CALL_EXPR
accessors.
* config/bfin/bfin.c (bfin_expand_binop_builtin): Pass entire CALL_EXPR
instead of arglist. Use new CALL_EXPR accessors. Fix callers.
(bfin_expand_unop_builtin): Likewise.
(bfin_expand_builtin): Use new CALL_EXPR accessors.
2007-02-15 Sandra Loosemore <sandra@codesourcery.com>
Brooks Moses <brooks.moses@codesourcery.com>
Lee Millward <lee.millward@codesourcery.com>
* c-semantics.c (build_stmt): Add internal diagnostic check.
* c-pretty-print.c (pp_c_postfix_expression): Use new CALL_EXPR
accessors. Print arguments explicitly instead of as a list.
* c-typeck.c (build_function_call): Use new CALL_EXPR constructors.
* c-omp.c (c_finish_omp_barrier): Use build_call_expr.
(c_finish_omp_flish): Likewise.
* c-common.c (verify_tree): Use new CALL_EXPR accessors. Traverse
arguments explicitly instead of as a list. Use TREE_OPERAND_LENGTH
instead of TREE_CODE_LENGTH.
(check_function_arguments_recurse): Use new CALL_EXPR accessors.
(c_warn_unused_result): Likewise.
2007-02-15 Sandra Loosemore <sandra@codesourcery.com>
Brooks Moses <brooks.moses@codesourcery.com>
Lee Millward <lee.millward@codesourcery.com>
* cp-tree.def (AGGR_INIT_EXPR): Adjust documentation.
Change class to tcc_vl_exp.
* call.c (build_call): Use build_call_list instead
of build3.
(build_over_call): Likewise.
(build_new_method_call): Use build_min_non_dep_call_list
instead of build_min_non_dep.
* error.c (dump_call_expr_args): New function.
(dump_aggr_init_expr_args): New function.
(dump_expr) <AGGR_INIT_EXPR, CALL_EXPR, INDIRECT_REF>: Use them.
Update to use new CALL_EXPR and AGGR_INIT_EXPR accessor macros.
* cvt.c (convert_to_void): Use build_call_array instead
of build3; use new AGGR_INIT_EXPR accessor macros.
* mangle.c (write_expression): Use TREE_OPERAND_LENGTH
instead of TREE_CODE_LENGTH.
* dump.c (cp_dump_tree) <AGGR_INIT_EXPR>: Update to use new
AGGR_INIT_EXPR accessor macros.
* cp-gimplify.c (cp_gimplify_init_expr): Use
AGGR_INIT_EXPR_SLOT to set the slot operand.
* cp-tree.h (AGGR_INIT_EXPR_FN): New macro.
(AGGR_INIT_EXPR_SLOT): New macro.
(AGGR_INIT_EXPR_ARG): New macro.
(aggr_init_expr_nargs): New macro.
(AGGR_INIT_EXPR_ARGP): New macro.
(aggr_init_expr_arg_iterator): New.
(init_aggr_init_expr_arg_iterator): New.
(next_aggr_init_expr_arg): New.
(first_aggr_init_expr_arg): New.
(more_aggr_init_expr_args_p): New.
(FOR_EACH_AGGR_INIT_EXPR_ARG): New.
(stabilize_aggr_init): New declaration.
(build_min_non_dep_call_list): Likewise.
* tree.c (process_aggr_init_operands): New function.
(build_aggr_init_array) New function.
(build_cplus_new): Update to use new CALL_EXPR and
AGGR_INIT_EXPR accessor macros. Replace use of build3 with
build_aggr_init_array.
(build_min_non_dep_call_list) New function.
(build_min_nt): Assert input code parameter is not a variable
length expression class.
(build_min, build_min_non_dep): Likewise.
(cp_tree_equal) <CALL_EXPR>: Iterate through the arguments
to check for equality instead of recursing. Handle tcc_vl_exp
tree code classes.
(stabilize_call): Update to only handle CALL_EXPRs, not
AGGR_INIT_EXPRs; use new CALL_EXPR accessor macros.
(stabilize_aggr_init): New function.
(stabilize_init): Use it.
* cxx-pretty-print.c (pp_cxx_postfix_expression)
<AGGR_INIT_EXPR, CALL_EXPR>: Update to use new CALL_EXPR and
AGGR_INIT_EXPR accessor macros and argument iterators.
* pt.c (tsubst_copy) <CALL_EXPR>: Replace build_nt with
build_vl_exp. Iterate through the operands, recursively
processing each one.
(tsubst_copy_and_build) <CALL_EXPR>: Update to use new
CALL_EXPR accessor macros.
(value_dependent_expression_p) <default>: Handle tcc_vl_exp
tree code classes. Use TREE_OPERAND_LENGTH instead of
TREE_CODE_LENGTH.
* semantics.c (finish_call_expr): Use build_nt_call_list
instead of build_nt.
(simplify_aggr_init_expr): Update to use new AGGR_INIT_EXPR
accessor macros. Use build_call_array to construct the
CALL_EXPR node instead of build3
* decl2.c (build_offset_ref_call_from_tree): Use
build_nt_call_list and build_min_non_dep_call_list instead
of build_min_nt and build_min_non_dep.
* parser.c (cp_parser_postfix_expression) <CPP_OPEN_PAREN>:
Use build_nt_call_list instead of build_min_nt.
2007-02-15 Sandra Loosemore <sandra@codesourcery.com>
Brooks Moses <brooks.moses@codesourcery.com>
Lee Millward <lee.millward@codesourcery.com>
* java-tree.h (BUILD_MONITOR_ENTER): Use build_call_nary instead
of build3.
(BUILD_MONITOR_EXIT): Likewise.
* java-gimplify.c (java_gimplify_component_ref): Use build_call_expr.
(java_gimplify_modify_expr): Likewise.
* class.c (cache_this_class_ref): Use build_call_expr.
(build_static_field_ref): Likewise.
(emit_indirect_register_classes): Likewise.
(emit_register_classes): Likewise.
* resource.c (write_resource_constructor): Use build_call_expr.
* builtins.c (builtin_creator_function): Change interpretation of
the second parameter to be the whole CALL_EXPR instead of the arglist.
(max_builtin): Tweak parameter list. Use new CALL_EXPR accessors.
(min_builtin): Likewise.
(abs_builtin): Likewise.
(java_build_function_call_expr): Likewise.
(convert_real): Likewise.
(UNMARSHAL3): Likewise.
(UNMARSHAL4): Likewise.
(UNMARSHAL5): Likewise.
(build_arglist_for_builtin): Delete. Fix callers to use
build_call_expr instead.
(putObject_builtin): Tweak parameter list. Use new CALL_EXPR
accessors.
(compareAndSwapInt_builtin): Likewise.
(compareAndSwapLong_builtin): Likewise.
(compareAndSwapObject_builtin): Likewise.
(putVolatile_builtin): Likewise.
(getVolatile_builtin): Likewise.
(VMSupportsCS8_builtin): Likewise.
(check_for_builtin): Pass entire CALL_EXPR to builtin expander
instead of arglist.
* expr.c (build_java_athrow): Use build_call_nary instead of build3.
(build_java_throw_out_of_bounds_exception): Likewise.
(java_check_reference): Likewise.
(build_java_arraystore_check): Likewise.
(build_newarray): Likewise.
(build_anewarray): Likewise.
(expand_java_multinewarray): Use build_call_list instead of build3.
(build_java_monitor): Use build_call_nary instead of build3.
(java_create_object): Likewise.
(expand_java_NEW): Likewise.
(build_instanceof): Likewise.
(expand_java_CHECKCAST): Likewise.
(build_java_soft_divmod): Likewise.
(build_java_binop): Likewise.
(build_field_ref): Likewise.
(build_class_init): Likewise.
(rewrite_arglist_getcaller): Use build_call_expr.
(build_invokeinterface): Use build_call_nary instead of build3.
(expand_invoke): Use build_call_list instead of build3.
(build_jni_stub): Use build_call_nary, build_call_list, or
build_call_expr instead of build3.
(expand_java_field_op): Use build_call_expr instead of build3.
(force_evaluation_order): Use new CALL_EXPR accessors.
* lang.c (java_get_callee_fndecl): Use new CALL_EXPR accessors.
2007-02-15 Sandra Loosemore <sandra@codesourcery.com>
Brooks Moses <brooks.moses@codesourcery.com>
Lee Millward <lee.millward@codesourcery.com>
* objc-act.c (receiver_is_class_object): Use new CALL_EXPR accessors.
(objc_get_callee_fndecl): Likewise.
2007-02-15 Sandra Loosemore <sandra@codesourcery.com>
Brooks Moses <brooks.moses@codesourcery.com>
Lee Millward <lee.millward@codesourcery.com>
* trans-expr.c (gfc_conv_power_op): Use build_call_expr.
(gfc_conv_string_tmp): Likewise.
(gfc_conv_concat_op): Likewise.
(gfc_build_compare_string): Likewise.
(gfc_conv_function_call): Use build_call_list instead of build3.
* trans-array.c (gfc_trans_allocate_array_storage): Use
build_call_expr.
(gfc_grow_array): Likewise.
(gfc_trans_array_ctor_element): Likewise.
(gfc_trans_array_constructor_value): Likewise.
(gfc_array_allocate): Likewise.
(gfc_array_deallocate): Likewise.
(gfc_trans_auto_array_allocation): Likewise.
(gfc_trans_dummy_array_bias): Likewise.
(gfc_conv_array_parameter): Likewise.
(gfc_trans_dealloc_allocated): Likewise.
(gfc_duplicate_allocatable): Likewise.
* trans-openmp.c (gfc_trans_omp_barrier): Use build_call_expr.
(gfc_trans_omp_flush): Likewise.
* trans-stmt.c (gfc_conv_elementel_dependencies): Use build_call_expr.
(gfc_trans_pause): Likewise.
(gfc_trans_stop): Likewise.
(gfc_trans_character_select): Likewise.
(gfc_do_allocate): Likewise.
(gfc_trans_assign_need_temp): Likewise.
(gfc_trans_pointer_assign_need_temp): Likewise.
(gfc_trans_forall_1): Likewise.
(gfc_trans_where_2): Likewise.
(gfc_trans_allocate): Likewise.
(gfc_trans_deallocate): Likewise.
* trans.c (gfc_trans_runtime_check): Use build_call_expr.
* trans-io.c (gfc_trans_open): Use build_call_expr.
(gfc_trans_close): Likewise.
(build_filepos): Likewise.
(gfc_trans_inquire): Likewise.
(NML_FIRST_ARG): Delete.
(NML_ADD_ARG): Delete.
(transfer_namelist_element): Use build_call_expr.
(build_dt): Likewise.
(gfc_trans_dt_end): Likewise.
(transfer_expr): Likewise.
(transfer_array-desc): Likewise.
* trans-decl.c (gfc_generate_function_code): Use build_call_expr.
(gfc_generate_constructors): Likewise.
* trans-intrinsic.c (gfc_conv_intrinsic_ctime): Use build_call_expr.
(gfc_conv_intrinsic_fdate): Likewise.
(gfc_conv_intrinsic_ttynam): Likewise.
(gfc_conv_intrinsic_array_transfer): Likewise.
(gfc_conv_associated): Likewise.
(gfc_conv_intrinsic_si_kind): Likewise.
(gfc_conv_intrinsic_trim): Likewise.
(gfc_conv_intrinsic_repeat: Likewise.
(gfc_conv_intrinsic_iargc): Likewise.
Co-Authored-By: Brooks Moses <brooks.moses@codesourcery.com>
Co-Authored-By: Lee Millward <lee.millward@codesourcery.com>
From-SVN: r122018
2007-02-16 00:50:49 +01:00
|
|
|
@code{CALL_EXPR}s also have a @code{CALL_EXPR_STATIC_CHAIN} operand that
|
|
|
|
is used to implement nested functions. This operand is otherwise null.
|
|
|
|
|
1999-09-19 17:50:40 +02:00
|
|
|
@item STMT_EXPR
|
2000-09-24 23:47:45 +02:00
|
|
|
These nodes are used to represent GCC's statement-expression extension.
|
1999-09-19 17:50:40 +02:00
|
|
|
The statement-expression extension allows code like this:
|
c-tree.texi, [...]: Use @smallexample instead of @example.
* doc/c-tree.texi, doc/compat.texi, doc/cpp.texi,
doc/cppopts.texi, doc/extend.texi, doc/install.texi,
doc/interface.texi, doc/invoke.texi, doc/libgcc.texi, doc/md.texi,
doc/objc.texi, doc/rtl.texi, doc/tm.texi, doc/trouble.texi: Use
@smallexample instead of @example.
From-SVN: r76075
2004-01-18 02:20:48 +01:00
|
|
|
@smallexample
|
1999-09-23 15:55:27 +02:00
|
|
|
int f() @{ return (@{ int j; j = 3; j + 7; @}); @}
|
c-tree.texi, [...]: Use @smallexample instead of @example.
* doc/c-tree.texi, doc/compat.texi, doc/cpp.texi,
doc/cppopts.texi, doc/extend.texi, doc/install.texi,
doc/interface.texi, doc/invoke.texi, doc/libgcc.texi, doc/md.texi,
doc/objc.texi, doc/rtl.texi, doc/tm.texi, doc/trouble.texi: Use
@smallexample instead of @example.
From-SVN: r76075
2004-01-18 02:20:48 +01:00
|
|
|
@end smallexample
|
1999-09-19 17:50:40 +02:00
|
|
|
In other words, an sequence of statements may occur where a single
|
|
|
|
expression would normally appear. The @code{STMT_EXPR} node represents
|
|
|
|
such an expression. The @code{STMT_EXPR_STMT} gives the statement
|
2004-06-17 03:24:06 +02:00
|
|
|
contained in the expression. The value of the expression is the value
|
|
|
|
of the last sub-statement in the body. More precisely, the value is the
|
|
|
|
value computed by the last statement nested inside @code{BIND_EXPR},
|
|
|
|
@code{TRY_FINALLY_EXPR}, or @code{TRY_CATCH_EXPR}. For example, in:
|
c-tree.texi, [...]: Use @smallexample instead of @example.
* doc/c-tree.texi, doc/compat.texi, doc/cpp.texi,
doc/cppopts.texi, doc/extend.texi, doc/install.texi,
doc/interface.texi, doc/invoke.texi, doc/libgcc.texi, doc/md.texi,
doc/objc.texi, doc/rtl.texi, doc/tm.texi, doc/trouble.texi: Use
@smallexample instead of @example.
From-SVN: r76075
2004-01-18 02:20:48 +01:00
|
|
|
@smallexample
|
1999-10-08 07:42:36 +02:00
|
|
|
(@{ 3; @})
|
c-tree.texi, [...]: Use @smallexample instead of @example.
* doc/c-tree.texi, doc/compat.texi, doc/cpp.texi,
doc/cppopts.texi, doc/extend.texi, doc/install.texi,
doc/interface.texi, doc/invoke.texi, doc/libgcc.texi, doc/md.texi,
doc/objc.texi, doc/rtl.texi, doc/tm.texi, doc/trouble.texi: Use
@smallexample instead of @example.
From-SVN: r76075
2004-01-18 02:20:48 +01:00
|
|
|
@end smallexample
|
1999-10-08 07:42:36 +02:00
|
|
|
the value is @code{3} while in:
|
c-tree.texi, [...]: Use @smallexample instead of @example.
* doc/c-tree.texi, doc/compat.texi, doc/cpp.texi,
doc/cppopts.texi, doc/extend.texi, doc/install.texi,
doc/interface.texi, doc/invoke.texi, doc/libgcc.texi, doc/md.texi,
doc/objc.texi, doc/rtl.texi, doc/tm.texi, doc/trouble.texi: Use
@smallexample instead of @example.
From-SVN: r76075
2004-01-18 02:20:48 +01:00
|
|
|
@smallexample
|
2000-05-04 00:25:21 +02:00
|
|
|
(@{ if (x) @{ 3; @} @})
|
c-tree.texi, [...]: Use @smallexample instead of @example.
* doc/c-tree.texi, doc/compat.texi, doc/cpp.texi,
doc/cppopts.texi, doc/extend.texi, doc/install.texi,
doc/interface.texi, doc/invoke.texi, doc/libgcc.texi, doc/md.texi,
doc/objc.texi, doc/rtl.texi, doc/tm.texi, doc/trouble.texi: Use
@smallexample instead of @example.
From-SVN: r76075
2004-01-18 02:20:48 +01:00
|
|
|
@end smallexample
|
2004-06-17 03:24:06 +02:00
|
|
|
there is no value. If the @code{STMT_EXPR} does not yield a value,
|
|
|
|
it's type will be @code{void}.
|
1999-09-19 17:50:40 +02:00
|
|
|
|
1999-10-06 01:59:27 +02:00
|
|
|
@item BIND_EXPR
|
|
|
|
These nodes represent local blocks. The first operand is a list of
|
2004-05-13 08:41:07 +02:00
|
|
|
variables, connected via their @code{TREE_CHAIN} field. These will
|
|
|
|
never require cleanups. The scope of these variables is just the body
|
|
|
|
of the @code{BIND_EXPR}. The body of the @code{BIND_EXPR} is the
|
1999-10-06 01:59:27 +02:00
|
|
|
second operand.
|
|
|
|
|
1999-10-06 01:40:00 +02:00
|
|
|
@item LOOP_EXPR
|
|
|
|
These nodes represent ``infinite'' loops. The @code{LOOP_EXPR_BODY}
|
|
|
|
represents the body of the loop. It should be executed forever, unless
|
|
|
|
an @code{EXIT_EXPR} is encountered.
|
|
|
|
|
|
|
|
@item EXIT_EXPR
|
|
|
|
These nodes represent conditional exits from the nearest enclosing
|
|
|
|
@code{LOOP_EXPR}. The single operand is the condition; if it is
|
2001-10-10 01:11:55 +02:00
|
|
|
nonzero, then the loop should be exited. An @code{EXIT_EXPR} will only
|
1999-10-06 01:40:00 +02:00
|
|
|
appear within a @code{LOOP_EXPR}.
|
|
|
|
|
1999-10-08 07:42:36 +02:00
|
|
|
@item CLEANUP_POINT_EXPR
|
2000-11-10 06:56:47 +01:00
|
|
|
These nodes represent full-expressions. The single operand is an
|
1999-10-08 07:42:36 +02:00
|
|
|
expression to evaluate. Any destructor calls engendered by the creation
|
|
|
|
of temporaries during the evaluation of that expression should be
|
|
|
|
performed immediately after the expression is evaluated.
|
|
|
|
|
1999-09-19 17:50:40 +02:00
|
|
|
@item CONSTRUCTOR
|
|
|
|
These nodes represent the brace-enclosed initializers for a structure or
|
2001-06-21 02:03:48 +02:00
|
|
|
array. The first operand is reserved for use by the back end. The
|
1999-09-19 17:50:40 +02:00
|
|
|
second operand is a @code{TREE_LIST}. If the @code{TREE_TYPE} of the
|
|
|
|
@code{CONSTRUCTOR} is a @code{RECORD_TYPE} or @code{UNION_TYPE}, then
|
|
|
|
the @code{TREE_PURPOSE} of each node in the @code{TREE_LIST} will be a
|
|
|
|
@code{FIELD_DECL} and the @code{TREE_VALUE} of each node will be the
|
2003-12-02 02:32:39 +01:00
|
|
|
expression used to initialize that field.
|
1999-09-19 17:50:40 +02:00
|
|
|
|
|
|
|
If the @code{TREE_TYPE} of the @code{CONSTRUCTOR} is an
|
|
|
|
@code{ARRAY_TYPE}, then the @code{TREE_PURPOSE} of each element in the
|
2004-12-16 15:17:24 +01:00
|
|
|
@code{TREE_LIST} will be an @code{INTEGER_CST} or a @code{RANGE_EXPR} of
|
|
|
|
two @code{INTEGER_CST}s. A single @code{INTEGER_CST} indicates which
|
|
|
|
element of the array (indexed from zero) is being assigned to. A
|
|
|
|
@code{RANGE_EXPR} indicates an inclusive range of elements to
|
|
|
|
initialize. In both cases the @code{TREE_VALUE} is the corresponding
|
|
|
|
initializer. It is re-evaluated for each element of a
|
|
|
|
@code{RANGE_EXPR}. If the @code{TREE_PURPOSE} is @code{NULL_TREE}, then
|
|
|
|
the initializer is for the next available array element.
|
1999-09-19 17:50:40 +02:00
|
|
|
|
2003-12-02 02:32:39 +01:00
|
|
|
In the front end, you should not depend on the fields appearing in any
|
|
|
|
particular order. However, in the middle end, fields must appear in
|
|
|
|
declaration order. You should not assume that all fields will be
|
|
|
|
represented. Unrepresented fields will be set to zero.
|
1999-09-19 17:50:40 +02:00
|
|
|
|
2001-12-04 23:55:40 +01:00
|
|
|
@item COMPOUND_LITERAL_EXPR
|
2001-12-17 02:18:41 +01:00
|
|
|
@findex COMPOUND_LITERAL_EXPR_DECL_STMT
|
2001-12-04 23:55:40 +01:00
|
|
|
@findex COMPOUND_LITERAL_EXPR_DECL
|
|
|
|
These nodes represent ISO C99 compound literals. The
|
2001-12-17 02:18:41 +01:00
|
|
|
@code{COMPOUND_LITERAL_EXPR_DECL_STMT} is a @code{DECL_STMT}
|
|
|
|
containing an anonymous @code{VAR_DECL} for
|
2001-12-04 23:55:40 +01:00
|
|
|
the unnamed object represented by the compound literal; the
|
|
|
|
@code{DECL_INITIAL} of that @code{VAR_DECL} is a @code{CONSTRUCTOR}
|
|
|
|
representing the brace-enclosed list of initializers in the compound
|
2001-12-17 02:18:41 +01:00
|
|
|
literal. That anonymous @code{VAR_DECL} can also be accessed directly
|
|
|
|
by the @code{COMPOUND_LITERAL_EXPR_DECL} macro.
|
2001-12-04 23:55:40 +01:00
|
|
|
|
1999-09-19 17:50:40 +02:00
|
|
|
@item SAVE_EXPR
|
|
|
|
|
1999-10-27 20:19:17 +02:00
|
|
|
A @code{SAVE_EXPR} represents an expression (possibly involving
|
|
|
|
side-effects) that is used more than once. The side-effects should
|
|
|
|
occur only the first time the expression is evaluated. Subsequent uses
|
2000-11-10 06:56:47 +01:00
|
|
|
should just reuse the computed value. The first operand to the
|
1999-10-27 20:19:17 +02:00
|
|
|
@code{SAVE_EXPR} is the expression to evaluate. The side-effects should
|
|
|
|
be executed where the @code{SAVE_EXPR} is first encountered in a
|
|
|
|
depth-first preorder traversal of the expression tree.
|
1999-09-19 17:50:40 +02:00
|
|
|
|
|
|
|
@item TARGET_EXPR
|
|
|
|
A @code{TARGET_EXPR} represents a temporary object. The first operand
|
|
|
|
is a @code{VAR_DECL} for the temporary variable. The second operand is
|
2004-06-18 00:35:55 +02:00
|
|
|
the initializer for the temporary. The initializer is evaluated and,
|
|
|
|
if non-void, copied (bitwise) into the temporary. If the initializer
|
|
|
|
is void, that means that it will perform the initialization itself.
|
1999-09-19 17:50:40 +02:00
|
|
|
|
1999-09-28 09:40:15 +02:00
|
|
|
Often, a @code{TARGET_EXPR} occurs on the right-hand side of an
|
|
|
|
assignment, or as the second operand to a comma-expression which is
|
|
|
|
itself the right-hand side of an assignment, etc. In this case, we say
|
|
|
|
that the @code{TARGET_EXPR} is ``normal''; otherwise, we say it is
|
|
|
|
``orphaned''. For a normal @code{TARGET_EXPR} the temporary variable
|
|
|
|
should be treated as an alias for the left-hand side of the assignment,
|
|
|
|
rather than as a new temporary variable.
|
|
|
|
|
1999-09-24 03:43:49 +02:00
|
|
|
The third operand to the @code{TARGET_EXPR}, if present, is a
|
|
|
|
cleanup-expression (i.e., destructor call) for the temporary. If this
|
1999-09-28 09:40:15 +02:00
|
|
|
expression is orphaned, then this expression must be executed when the
|
|
|
|
statement containing this expression is complete. These cleanups must
|
|
|
|
always be executed in the order opposite to that in which they were
|
|
|
|
encountered. Note that if a temporary is created on one branch of a
|
|
|
|
conditional operator (i.e., in the second or third operand to a
|
|
|
|
@code{COND_EXPR}), the cleanup must be run only if that branch is
|
|
|
|
actually executed.
|
1999-09-24 03:43:49 +02:00
|
|
|
|
|
|
|
See @code{STMT_IS_FULL_EXPR_P} for more information about running these
|
|
|
|
cleanups.
|
1999-09-19 17:50:40 +02:00
|
|
|
|
|
|
|
@item AGGR_INIT_EXPR
|
|
|
|
An @code{AGGR_INIT_EXPR} represents the initialization as the return
|
|
|
|
value of a function call, or as the result of a constructor. An
|
2004-06-18 00:35:55 +02:00
|
|
|
@code{AGGR_INIT_EXPR} will only appear as a full-expression, or as the
|
tree.h (enum tree_code_class): Add tcc_vl_exp.
2007-02-15 Sandra Loosemore <sandra@codesourcery.com>
Brooks Moses <brooks.moses@codesourcery.com>
Lee Millward <lee.millward@codesourcery.com>
* tree.h (enum tree_code_class): Add tcc_vl_exp.
(VL_EXP_CLASS_P): New.
(TREE_OPERAND_CHECK): Use TREE_OPERAND_LENGTH instead of
TREE_CODE_LENGTH.
(TREE_OPERAND_CHECK_CODE): Likewise.
(GIMPLE_STMT_OPERAND_CHECK): Likewise.
(TREE_RTL_OPERAND_CHECK): Likewise.
(tree_operand_check_failed): Make second parameter the whole tree
instead of its code. Fixed callers.
(VL_EXP_CHECK): New.
(TREE_OPERAND_LENGTH): New.
(VL_EXP_OPERAND_LENGTH): New.
(CALL_EXPR_FN): New.
(CALL_EXPR_STATIC_CHAIN): New.
(CALL_EXPR_ARGS): New.
(CALL_EXPR_ARG): New.
(call_expr_nargs): New.
(CALL_EXPR_ARGP): New.
(build_nt_call_list): Declare.
(build_vl_exp_stat): Declare.
(build_vl_exp): New.
(build_call_list): Declare.
(build_call_nary): Declare.
(build_call_valist): Declare.
(build_call_array): Declare.
(call_expr_arg): Declare.
(call_expr_argp): Declare.
(call_expr_arglist): Declare.
(fold_build_call_list): Declare.
(fold_build_call_list_initializer): Declare.
(fold_call_expr): Declare to replace fold_builtin.
(fold_builtin_fputs): Update to agree with modified definition.
(fold_builtin_strcpy): Likewise.
(fold_builtin_strncpy): Likewise.
(fold_builtin_memory_chk): Likewise.
(fold_builtin_stxcpy_chk): Likewise.
(fold_builtin_strncpy_chk): Likewise.
(fold_builtin_next_arg): Likewise.
(fold_build_call_expr): Declare.
(fold_builtin_call_list): Declare.
(fold_builtin_call_valist): Declare.
(build_call_expr): Declare.
(validate_arglist): Update to agree with modified definition.
(tree_operand_length): New.
(call_expr_arg_iterator): New.
(init_call_expr_arg_iterator): New.
(next_call_expr_arg): New.
(first_call_expr_arg): New.
(more_call_expr_args_p): New.
(FOR_EACH_CALL_EXPR_ARG): New.
* tree.c (tree_code_class_string): Add entries for tcc_vl_exp
and tcc_gimple_stmt.
(tree_code_size): Update documentation. Use sizeof (tree) rather
than sizeof (char *).
(tree_size): Likewise. Add case for tcc_vl_exp.
(tree_node_structure): Add case for tcc_vl_exp.
(contains_placeholder_p): Likewise.
(substitute_in_expr): Likewise.
(substitute_placeholder_in_expr): Likewise.
(stabilize_reference_1): Likewise.
(build3_stat): Remove logic for CALL_EXPRs. Replace with assertion
to diagnose breakage of this interface for constructing CALL_EXPRs.
(build_nt): Add similar assertion here.
(build_nt_call_list): New.
(simple_cst_equal) <CALL_EXPR>: Rewrite to use new accessors.
(iterative_hash_expr): Use TREE_OPERAND_LENGTH instead of
TREE_CODE_LENGTH.
(get_callee_fndecl): Use new CALL_EXPR accessors.
(tree_operand_check_failed): Change parameters to pass entire node
instead of its code, so that we can call TREE_OPERAND_LENGTH on it.
(process_call_operands): New.
(build_vl_exp_stat): New.
(build_call_list): New.
(build_call_nary): New.
(build_call_valist): New.
(build_call_array): New.
(walk_tree): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH.
(call_expr_arglist): New.
* tree.def (CALL_EXPR): Change representation of CALL_EXPRs to use
tcc_vl_exp instead of a fixed-size tcc_expression.
* doc/c-tree.texi (CALL_EXPR): Document new representation and
accessors for CALL_EXPRs.
(AGGR_INIT_EXPR): Likewise.
2007-02-15 Sandra Loosemore <sandra@codesourcery.com>
Brooks Moses <brooks.moses@codesourcery.com>
Lee Millward <lee.millward@codesourcery.com>
* builtins.c (c_strlen): Return NULL_TREE instead of 0.
(expand_builtin_nonlocal_goto): Change parameter to be entire
CALL_EXPR instead of an arglist. Use new CALL_EXPR accessors.
(expand_builtin_prefetch): Likewise.
(expand_builtin_classify_type): Likewise.
(mathfn_built_in): Return NULL_TREE instead of 0.
(expand_errno_check): Use new CALL_EXPR accessors.
(expand_builtin_mathfn): Use new CALL_EXPR accessors and constructors.
Return NULL_RTX instead of 0.
(expand_builtin_mathfn_2): Likewise.
(expand_builtin_mathfn_3): Likewise.
(expand_builtin_interclass_mathfn): Likewise.
(expand_builtin_sincos): Likewise.
(expand_builtin_cexpi): Likewise.
(expand_builtin_int_roundingfn): Likewise.
(expand_builtin_int_roundingfn_2): Likewise.
(expand_builtin_pow): Likewise.
(expand_builtin_powi): Likewise.
(expand_builtin_strlen): Pass entire CALL_EXPR as parameter instead
of arglist, fixing callers appropriately. Use new CALL_EXPR
accessors and constructors. Return NULL_RTX instead of 0.
(expand_builtin_strstr): Likewise.
(expand_builtin_strchr): Likewise.
(expand_builtin_strrchr): Likewise.
(expand_builtin_strpbrk): Likewise.
(expand_builtin_memcpy): Likewise.
(expand_builtin_mempcpy): Likewise.
(expand_builtin_mempcpy_args): New.
(expand_builtin_memmove): Similarly to expand_builtin_mempcpy.
(expand_builtin_memmove_args): New.
(expand_builtin_bcopy): Similarly to expand_builtin_mempcpy.
(expand_movstr): Likewise.
(expand_builtin_strcpy): Likewise.
(expand_builtin_strcpy_args): New.
(expand_builtin_stpcpy): Similarly to expand_builtin_strcpy.
(expand_builtin_strncpy): Likewise.
(expand_builtin_memset): Likewise.
(expand_builtin_memset_args): New.
(expand_builtin_bzero): Similarly to expand_builtin_memset.
(expand_builtin_memcmp): Likewise.
(expand_builtin_strcmp): Likewise.
(expand_builtin_strncmp): Likewise.
(expand_builtin_strcat): Likewise.
(expand_builtin_strncat): Likewise.
(expand_builtin_strspn): Likewise.
(expand_builtin_strcspn): Likewise.
(expand_builtin_args_info): Likewise.
(expand_builtin_va_start): Likewise.
(gimplify_va_arg_expr): Likewise.
(expand_builtin_va_end): Likewise.
(expand_builtin_va_copy): Likewise.
(expand_builtin_frame_address): Likewise.
(expand_builtin_alloca): Likewise.
(expand_builtin_bswap): Likewise.
(expand_builtin_unop): Likewise.
(expand_builtin_fputs): Likewise.
(expand_builtin_expect): Likewise.
(expand_builtin_fabs): Likewise.
(expand_builtin_copysign): Likewise.
(expand_builtin_printf): Likewise.
(expand_builtin_fprintf): Likewise.
(expand_builtin_sprintf): Likewise.
(expand_builtin_init_trampoline): Likewise.
(expand_builtin_signbit): Likewise.
(expand_builtin_fork_or_exec): Likewise.
(expand_builtin_sync_operation): Likewise.
(expand_builtin_compare_and_swap): Likewise.
(expand_builtin_lock_test_and_set): Likewise.
(expand_builtin_lock_release): Likewise.
(expand_builtin): Likewise.
(builtin_mathfn_code): Likewise.
(fold_builtin_constant_p): Pass call arguments individually instead
of as an arglist, fixing callers appropriately. Use new CALL_EXPR
accessors and constructors. Return NULL_TREE instead of 0.
(fold_builtin_expect): Likewise.
(fold_builtin_classify_type): Likewise.
(fold_builtin_strlen): Likewise.
(fold_builtin_nan): Likewise.
(integer_valued_real_p): Likewise.
(fold_trunc_transparent_mathfn): Likewise.
(fold_fixed_mathfn): Likewise.
(fold_builtin_cabs): Likewise.
(fold_builtin_sqrt): Likewise.
(fold_builtin_cbrt): Likewise.
(fold_builtin_cos): Likewise.
(fold_builtin_cosh): Likewise.
(fold_builtin_tan): Likewise.
(fold_builtin_sincos): Likewise.
(fold_builtin_cexp): Likewise.
(fold_builtin_trunc): Likewise.
(fold_builtin_floor): Likewise.
(fold_builtin_ceil): Likewise.
(fold_builtin_round): Likewise.
(fold_builtin_int_roundingfn): Likewise.
(fold_builtin_bitop): Likewise.
(fold_builtin_bswap): Likewise.
(fold_builtin_logarithm): Likewise.
(fold_builtin_hypot): Likewise.
(fold_builtin_pow): Likewise.
(fold_builtin_powi): Likewise.
(fold_builtin_exponent): Likewise.
(fold_builtin_memset): Likewise.
(fold_builtin_bzero): Likewise.
(fold_builtin_memory_op): Likewise.
(fold_builtin_bcopy): Deleted; call site changed to invoke
fold_builtin_memory_op directly.
(fold_builtin_strcpy): Similarly as for fold_builtin_memory_op.
(fold_builtin_strncpy): Likewise.
(fold_builtin_memcmp): Likewise.
(fold_builtin_strcmp): Likewise.
(fold_builtin_strncmp): Likewise.
(fold_builtin_signbit): Likewise.
(fold_builtin_copysign): Likewise.
(fold_builtin_isascii): Likewise.
(fold_builtin_toascii): Likewise.
(fold_builtin_isdigit): Likewise.
(fold_builtin_fabs): Likewise.
(fold_builtin_abs): Likewise.
(fold_builtin_fmin_fmax): Likewise.
(fold_builtin_carg): Likewise.
(fold_builtin_classify): Likewise.
(fold_builtin_unordered_cmp): Likewise.
(fold_builtin_0, fold_builtin_2, fold_builtin_3, fold_builtin_4):
New functions split out from fold_builtin_1.
(fold_builtin_n): New.
(fold_builtin_varargs): New.
(fold_builtin): Deleted. Most callers changed to use fold_call_expr
instead.
(fold_call_expr): New.
(build_function_call_expr): Rewrite to use new helper function.
(fold_builtin_call_list): New.
(build_call_expr): New.
(fold_builtin_call_valist): New.
(rewrite_call_expr): New.
(validate_arg): New.
(validate_arglist): Change parameter to be entire CALL_EXPR instead
of an arglist. Change return type to bool. Use new CALL_EXPR
accessors.
(fold_builtin_strstr): Pass call arguments individually instead
of as an arglist, fixing callers appropriately. Use new CALL_EXPR
accessors and constructors. Return NULL_TREE instead of 0.
(fold_builtin_strchr): Likewise.
(fold_builtin_strrchr): Likewise.
(fold_builtin_strpbrk): Likewise.
(fold_builtin_strcat): Likewise.
(fold_builtin_strncat): Likewise.
(fold_builtin_strspn): Likewise.
(fold_builtin_strcspn): Likewise.
(fold_builtin_fputs): Likewise.
(fold_builtin_next_arg): Likewise.
(fold_builtin_sprintf): Likewise.
(expand_builtin_object_size): Use new CALL_EXPR accessors. Use
NULL_RTX instead of 0.
(expand_builtin_memory_chk): Likewise.
(maybe_emit_chk_warning): Likewise.
(maybe_emit_sprintf_chk_warning): Likewise.
(fold_builtin_object_size): Pass call arguments individually instead
of as an arglist, fixing callers appropriately. Use new CALL_EXPR
accessors and constructors. Return NULL_TREE instead of 0.
(fold_builtin_memory_chk): Likewise.
(fold_builtin_stxcpy_chk): Likewise.
(fold_builtin_strncpy_chk): Likewise.
(fold_builtin_strcat_chk): Likewise.
(fold_builtin_strcat_chk): Likewise.
(fold_builtin_strncat_chk): Likewise.
(fold_builtin_sprintf_chk): Likewise.
(fold_builtin_snprintf_chk): Likewise.
(fold_builtin_printf): Likewise.
(fold_builtin_vprintf): Likewise.
* fold-const.c (negate_expr_p): Use new CALL_EXPR accessors and
constructors.
(operand_equal_p): Add separate tcc_vl_exp/CALL_EXPR case.
(make_range): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH.
(extract_muldiv_1): Add VL_EXP_CLASS_P case.
(fold_mathfn_compare): Use new CALL_EXPR accessors and constructors.
(fold_unary): Likewise.
(fold_binary): Likewise.
(fold_ternary): Remove CALL_EXPR case, since they are no longer
ternary expressions.
(fold): Add logic for tcc_vl_exp.
(fold_checksum_tree): Make it know about tcc_vl_exp. Use
TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH.
(fold_build3_stat): Add assertion to flag broken interface for
constructing CALL_EXPRs.
(fold_build_call_list): New.
(fold_build_call_list_initializer): New.
(tree_expr_nonnegative_p): Use new CALL_EXPR accessors and
constructors.
(fold_strip_sign_ops): Likewise.
2007-02-15 Sandra Loosemore <sandra@codesourcery.com>
Brooks Moses <brooks.moses@codesourcery.com>
Lee Millward <lee.millward@codesourcery.com>
* tree-dump.c (dequeue_and_dump) <CALL_EXPR>: Use new CALL_EXPR
accessors and dump arguments explicitly.
* tree-pretty-print.c (do_niy): Use TREE_OPERAND_LENGTH instead of
TREE_CODE_LENGTH.
(dump_generic_node): Use new CALL_EXPR accessors and walk arguments
explicitly.
(print_call_name): Use new CALL_EXPR accessors.
* print-tree.c (print_node): Add case tcc_vl_exp. Print
CALL_EXPR arguments explicitly instead of as a list. Use
TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH.
* tree-vrp.c (stmt_interesting_for_vrp): Use new CALL_EXPR accessors.
(vrp_visit_stmt): Likewise.
* tree-ssa-loop-im.c (outermost_invariant_loop_expr): Make it
know about tcc_vl_exp. Use TREE_OPERAND_LENGTH instead of
TREE_CODE_LENGTH.
(force_move_till_expr): Likewise.
* targhooks.c (default_external_stack_protect_fail): Use
build_call_expr instead of build_function_call_expr.
(default_hidden_stack_protect_fail): Likewise.
* tree-complex.c (expand_complex_libcall): Use build_call_expr to
build the call.
* cgraphbuild.c (build_cgraph_edges): Use new CALL_EXPR accessors
and walk arguments explicitly.
* tree-ssa-loop-niter.c (simplify_replace_tree): Use
TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH.
(expand_simple_operations): Likewise.
(infer_loop_bounds_from_array): Use new CALL_EXPR accessors.
* gengtype.c (adjust_field_tree_exp): Use TREE_OPERAND_LENGTH instead
of TREE_CODE_LENGTH.
(walk_type): Tweak walking of arrays not to blow up on CALL_EXPRs.
* optabs.c (expand_widen_pattern-expr): Use TREE_OPERAND_LENGTH
instead of TREE_CODE_LENGTH.
* value_prof.c (tree_ic): Use new CALL_EXPR accessors.
(tree_ic_transform): Likewise.
(interesting_stringop_to_profile_p): Pass entire CALL_EXPR as
parameter instead of arglist. Fix callers.
(tree_stringop_fixed_value): Use new CALL_EXPR accessors.
(tree_stringops_transform): Likewise.
(tree_indirect_call_to_profile): Likewise.
(tree_stringops_values_to_profile): Likewise.
* tree-tailcall.c (find_tail_calls): Use new CALL_EXPR iterator.
(eliminate_tail_call): Likewise.
* ipa-cp.c (ipcp_update_callgraph): Use new CALL_EXPR accessors.
* tree-scalar-evolution.c (chrec_contains_symbols_defined_in_loop):
Use TREE_OPERAND_LENGTH and generalize to handle any number of
operands.
(instantiate_parameters_1): Can't handle tcc_vl_exp here.
* omp-low.c (build_omp_barrier): Use build_call_expr.
(lower_rec_input_clauses): Likewise.
(lower_reduction_clauses): Likewise.
(expand_parallel_call): Likewise.
(maybe_catch_exception): Likewise.
(expand_omp_for_generic): Likewise.
(expand_omp_for_static_nochunk): Likewise.
(expand_omp_sections): Likewise.
(lower_omp_single_simple): Likewise.
(lower_omp_single_copy): Likewise.
(lower_omp_master): Likewise.
(lower_omp_ordered): Likewise.
(lower_omp_critical): Likewise.
* ipa-reference.c (check-call): Use new CALL_EXPR iterator.
(scan_for_static_refs): Create tcc_vl_exp case for CALL_EXPR.
* tree-gimple.c (is_gimple_call_addr): Fix doc.
(recalculate_side_effects): Use TREE_OPERAND_LENGTH instead of
TREE_CODE_LENGTH. Add tcc_vl_exp case.
* tree-chrec.c (chrec_contains_symbols): Use TREE_OPERAND_LENGTH
and generalize to handle any number of operands.
(chrec_contains_undetermined): Likewise.
(tree_contains_chrecs): Likewise.
(evolution_function_is_invariant_rec_p): Use TREE_OPERAND_LENGTH.
* cgraphunit.c (update_call_expr): Use new CALL_EXPR accessors.
* tree-ssa-ccp.c (ccp_fold): Use new CALL_EXPR accessors. Use
fold_call_expr instead of fold_builtin.
(ccp_fold_builtin): Likewise. Update calls into builtins.c to
match declarations there.
(fold_stmt): Use new CALL_EXPR constructor and accessors. Doc
updates.
* tree-ssa-loop-ivopts.c (expr_invariant_in_loop_p): Use
TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH.
* ipa-pure-const.c (check_call): Use new CALL_EXPR accessors.
(scan_function): Add case tcc_vl_exp for CALL_EXPR.
* tree-stdarg.c (execute_optimize_stdarg): Use new CALL_EXPR
accessors.
* tree-ssa-math-opts.c (execute_cse_sincos_1): Use build_call_expr.
(execute_cse_sincos): Use new CALL_EXPR accessors.
* tree-ssa-alias.c (find_used_portions): Use new CALL_EXPR iterator.
* gimple-low.c (lower_function_body): Use build_call_expr.
(lower_builtin_setjmp): Likewise.
* expr.c (emit_block_move_via_libcall): Use build_call_expr.
(set_storage_via_libcall): Likewise.
(safe_from_p): Add tcc_vl_exp case. Use TREE_OPERAND_LENGTH
instead of TREE_CODE_LENGTH.
(expand_expr_real_1): Use new CALL_EXPR accessors.
* tree-browser.c (store_child_info): Use TREE_OPERAND_LENGTH and
generalize to handle any number of operands.
(TB_parent_eq): Likewise.
* predict.c (expr_expected_value): Use new CALL_EXPR accessors.
(strip_builtin_expect): Likewise.
* function.c (gimplify_parameters): Use build_call_expr.
* tree-vectorizer.c (vect_is_simple_reduction): Use TREE_OPERAND_LENGTH
instead of TREE_CODE_LENGTH.
* ipa-type-escape.c (check_call): Use new CALL_EXPR iterators.
(scan_for_refs): Add case tcc_vl_exp for CALL_EXPR.
* tree-data-ref.c (get_references_in_stmt): Use new CALL_EXPR
iterators.
* gimplify.c (build_stack_save_restore): Use build_call_expr.
(gimplify_decl_expr): Likewise.
(gimplify_call_expr): Use fold_call_expr instead of fold_builtin.
Use new CALL_EXPR iterators.
(gimplify_modify_expr_to_memcpy): Use build_call_expr.
(gimplify_modify_expr_to_memset): Likewise.
(gimplify_variable_sized_compare): Likewise.
(gimplify_omp_atomic_fetch_op): Likewise.
(gimplify_omp_atomic_pipeline): Likewise.
(gimplify_omp_atomic_mutex): Likewise.
(gimplify_function_tree): Likewise.
* calls.c (alloca_call_p): Use new CALL_EXPR accessors.
(call_expr_flags): Likewise.
(expand_call): Likewise.
* except.c (expand_builtin_eh_return_data_regno): Pass entire
CALL_EXPR as parameter instead of arglist. Use new CALL_EXPR
accessors.
* coverage.c (create_coverage): Use build_call_expr.
* tree-ssa-pre.c (expression_node_pool, list_node_pool): Delete.
(temp_call_expr_obstack): New.
(pool_copy_list): Delete.
(temp_copy_call_expr): New.
(phi_translate): Add case tcc_vl_exp for CALL_EXPR. Use new
CALL_EXPR accessors. Get rid of special goo for copying argument
lists and use temp_copy_call_expr instead.
(valid_in_sets): Add case tcc_vl_exp for CALL_EXPR. Use new
CALL_EXPR accessors.
(create_expression_by_pieces): Likewise. Use build_call_array
to construct the result instead of fold_build3.
(create_value_expr_from): Add tcc_vl_exp. Delete special goo for
dealing with argument lists.
(init_pre): Remove references to expression_node_pool and
list_node_pool. Init temp_call_expr_obstack instead.
(fini_pre): Remove references to expression_node_pool and
list_node_pool.
* tree-sra.c (sra_walk_call_expr): Use new CALL_EXPR accessors
and walk arguments explicitly instead of as a list.
* tree-mudflap.c (mf_build_check_statement_for): Use build_call_expr.
(mx_register_decls): Likewise.
(mudflap_register_call): Likewise.
(mudflap_finish_file): Likewise.
* ipa-prop.c (ipa_callsite_compute_count): Use new CALL_EXPR accessors.
(ipa_callsite_compute_param): Likewise.
* tree-vect-patterns.c (vect_recog_pow_pattern): Use new CALL_EXPR
accessors and constructor.
* tree-nested.c (convert_nl_goto_reference): Use new CALL_EXPR
accessors and constructor.
(convert_tramp_reference): Likewise.
(convert_call_expr): Likewise.
(finalize_nesting_tree_1): Likewise.
* tree-ssa.c (tree_ssa_useless_type_conversion): Use new CALL_EXPR
accessors.
* tree-ssa-loop-prefetch.c (issue_prefetch_ref): Use build_call_expr.
* tree-inline.c (initialize_inlined_parameters): Pass entire
CALL_EXPR as parameter instead of arglist. Use new CALL_EXPR
accessors.
(estimate_num_insns_1): Use new CALL_EXPR accessors.
(expand_call_inline): Tidy up call to initialize_inlined_parameters.
* tree-vect-transform.c (vect_create_epilog_for_reduction): Use
TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH.
(vectorizable_reduction): Likewise.
(vectorizable_call): Use new CALL_EXPR iterators.
(vectorizable_conversion): Use build_call_expr.
(vectorizable_operation): Use TREE_OPERAND_LENGTH.
(vect_gen_widened_results_half): Use build_call_expr.
(vect_setup_realignment): Likewise.
(vectorizable_live_operation): Use TREE_OPERAND_LENGTH.
* tree-object-size.c (alloc_object_size): Use new CALL_EXPR accessors.
(pass_through_call): Likewise.
(compute_object_sizes): Likewise. Use fold_call_expr instead of
fold_builtin.
* tree-profile.c (tree_gen_interval_profiler): Use build_call_expr.
(tree_gen_pow2_profiler): Likewise.
(tree_gen_one_value_profiler): Likewise.
(tree_gen_ic_func_profiler): Likewise.
(tree_gen_average_profiler): Likewise.
(tree_gen_ior_profiler): Likewise.
* tree-ssa-structalias.c (get_constraint_for): Add case tcc_vl_exp.
(find_func_aliases): Use new CALL_EXPR accessors. Add case
tcc_vl_exp. Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH.
* tree-ssa-reassoc.c (get_rank): Use TREE_OPERAND_LENGTH instead
of TREE_CODE_LENGTH.
* stmt.c (warn_if_unused_value): Use TREE_OPERAND_LENGTH instead
of TREE_CODE_LENGTH.
* convert.c (convert_to_real): Use new CALL_EXPR accessors and
constructor.
(convert_to_integer): Likewise.
* tree-ssa-operands.c (get_call_expr_operands): Use new CALL_EXPR
accessors.
2007-02-15 Sandra Loosemore <sandra@codesourcery.com>
Brooks Moses <brooks.moses@codesourcery.com>
Lee Millward <lee.millward@codesourcery.com>
* config/alpha/alpha.c (alpha_expand_builtin): Use new CALL_EXPR
accessors.
* config/frv/frv.c (frv_expand_builtin): Likewise.
* config/s390/s390.c (s390_expand_builtin): Likewise.
* config/sparc/sparc.c (sparc_gimplify_va_arg): Use build_call_expr.
(sparc_expand_builtin): Use new CALL_EXPR accessors.
* config/i386/i386.c (ix86_function_ok_for_sibcall): Likewise.
(ix86_expand_binop_builtin): Pass entire CALL_EXPR as parameter
instead of arglist. Use new CALL_EXPR accessors on it. Fix callers.
(ix86_expand_store_builtin): Likewise.
(ix86_expand_unop_builtin): Likewise.
(ix86_expand_unop1_builtin): Likewise.
(ix86_expand_sse_compare): Likewise.
(ix86_expand_sse_comi): Likewise.
(ix86_expand_vec_init_builtin): Likewise.
(ix86_expand_vec_ext_builtin): Likewise.
(ix86_expand_vec_set_builtin): Likewise.
(ix86_expand_builtin): Use new CALL_EXPR accessors.
* config/sh/sh.c (sh_expand_builtin): Use new CALL_EXPR accessors.
* config/c4x/c4x.c (c4x_expand_builtin): Likewise.
* config/iq2000/iq2000.c (expand_one_builtin): Pass entire CALL_EXPR
instead of arglist. Use new CALL_EXPR accessors. Fix callers.
(iq2000_expand_builtin): Use new CALL_EXPR accessors.
* config/rs6000/rs6000-c.c (altivec_build_resolved_builtin): Use
build_call_expr.
* config/rs6000/rs6000.c (rs6000_gimplify_va_arg): Likewise.
(rs6000_expand_unop_builtin): Pass entire CALL_EXPR instead of
arglist. Use new CALL_EXPR accessors. Fix callers.
(altivec_expand_abs_builtin): Likewise.
(rs6000_expand_binop_builtin): Likewise.
(altivec_expand_predicate_builtin): Likewise.
(altivec_expand_lv_builtin): Likewise.
(spe_expand_stv_builtin): Likewise.
(altivec_expand_stv_builtin): Likewise.
(rs6000_expand_ternop_builtin): Likewise.
(altivec_expand_ld_builtin): Use new CALL_EXPR accessors.
(altivec_expand_st_builtin): Likewise.
(altivec_expand_dst_builtin): Likewise.
(altivec_expand_vec_init_builtin): Pass entire CALL_EXPR instead of
arglist. Use new CALL_EXPR accessors. Fix callers.
(altivec_expand_vec_set_builtin): Likewise.
(altivec_expand_vec_ext_builtin): Likewise.
(altivec_expand_builtin): Use new CALL_EXPR accessors.
(spe_expand_builtin): Likewise.
(spe_expand_predicate_builtin): Pass entire CALL_EXPR instead of
arglist. Use new CALL_EXPR accessors. Fix callers.
(spe_expand_evsel_builtin): Likewise.
(rs6000_expand_builtin): Use new CALL_EXPR accessors. VCFUX and
FCFSX cases must construct whole new CALL_EXPR, not just arglist.
* config/arm/arm.c (arm_expand_binop_builtin): Pass entire CALL_EXPR
instead of arglist. Use new CALL_EXPR accessors. Fix callers.
(arm_expand_unop_builtin): Likewise.
(arm_expand_builtin): Use new CALL_EXPR accessors.
* config/mips/mips.c (mips_expand_builtin): Use new CALL_EXPR
accessors.
* config/bfin/bfin.c (bfin_expand_binop_builtin): Pass entire CALL_EXPR
instead of arglist. Use new CALL_EXPR accessors. Fix callers.
(bfin_expand_unop_builtin): Likewise.
(bfin_expand_builtin): Use new CALL_EXPR accessors.
2007-02-15 Sandra Loosemore <sandra@codesourcery.com>
Brooks Moses <brooks.moses@codesourcery.com>
Lee Millward <lee.millward@codesourcery.com>
* c-semantics.c (build_stmt): Add internal diagnostic check.
* c-pretty-print.c (pp_c_postfix_expression): Use new CALL_EXPR
accessors. Print arguments explicitly instead of as a list.
* c-typeck.c (build_function_call): Use new CALL_EXPR constructors.
* c-omp.c (c_finish_omp_barrier): Use build_call_expr.
(c_finish_omp_flish): Likewise.
* c-common.c (verify_tree): Use new CALL_EXPR accessors. Traverse
arguments explicitly instead of as a list. Use TREE_OPERAND_LENGTH
instead of TREE_CODE_LENGTH.
(check_function_arguments_recurse): Use new CALL_EXPR accessors.
(c_warn_unused_result): Likewise.
2007-02-15 Sandra Loosemore <sandra@codesourcery.com>
Brooks Moses <brooks.moses@codesourcery.com>
Lee Millward <lee.millward@codesourcery.com>
* cp-tree.def (AGGR_INIT_EXPR): Adjust documentation.
Change class to tcc_vl_exp.
* call.c (build_call): Use build_call_list instead
of build3.
(build_over_call): Likewise.
(build_new_method_call): Use build_min_non_dep_call_list
instead of build_min_non_dep.
* error.c (dump_call_expr_args): New function.
(dump_aggr_init_expr_args): New function.
(dump_expr) <AGGR_INIT_EXPR, CALL_EXPR, INDIRECT_REF>: Use them.
Update to use new CALL_EXPR and AGGR_INIT_EXPR accessor macros.
* cvt.c (convert_to_void): Use build_call_array instead
of build3; use new AGGR_INIT_EXPR accessor macros.
* mangle.c (write_expression): Use TREE_OPERAND_LENGTH
instead of TREE_CODE_LENGTH.
* dump.c (cp_dump_tree) <AGGR_INIT_EXPR>: Update to use new
AGGR_INIT_EXPR accessor macros.
* cp-gimplify.c (cp_gimplify_init_expr): Use
AGGR_INIT_EXPR_SLOT to set the slot operand.
* cp-tree.h (AGGR_INIT_EXPR_FN): New macro.
(AGGR_INIT_EXPR_SLOT): New macro.
(AGGR_INIT_EXPR_ARG): New macro.
(aggr_init_expr_nargs): New macro.
(AGGR_INIT_EXPR_ARGP): New macro.
(aggr_init_expr_arg_iterator): New.
(init_aggr_init_expr_arg_iterator): New.
(next_aggr_init_expr_arg): New.
(first_aggr_init_expr_arg): New.
(more_aggr_init_expr_args_p): New.
(FOR_EACH_AGGR_INIT_EXPR_ARG): New.
(stabilize_aggr_init): New declaration.
(build_min_non_dep_call_list): Likewise.
* tree.c (process_aggr_init_operands): New function.
(build_aggr_init_array) New function.
(build_cplus_new): Update to use new CALL_EXPR and
AGGR_INIT_EXPR accessor macros. Replace use of build3 with
build_aggr_init_array.
(build_min_non_dep_call_list) New function.
(build_min_nt): Assert input code parameter is not a variable
length expression class.
(build_min, build_min_non_dep): Likewise.
(cp_tree_equal) <CALL_EXPR>: Iterate through the arguments
to check for equality instead of recursing. Handle tcc_vl_exp
tree code classes.
(stabilize_call): Update to only handle CALL_EXPRs, not
AGGR_INIT_EXPRs; use new CALL_EXPR accessor macros.
(stabilize_aggr_init): New function.
(stabilize_init): Use it.
* cxx-pretty-print.c (pp_cxx_postfix_expression)
<AGGR_INIT_EXPR, CALL_EXPR>: Update to use new CALL_EXPR and
AGGR_INIT_EXPR accessor macros and argument iterators.
* pt.c (tsubst_copy) <CALL_EXPR>: Replace build_nt with
build_vl_exp. Iterate through the operands, recursively
processing each one.
(tsubst_copy_and_build) <CALL_EXPR>: Update to use new
CALL_EXPR accessor macros.
(value_dependent_expression_p) <default>: Handle tcc_vl_exp
tree code classes. Use TREE_OPERAND_LENGTH instead of
TREE_CODE_LENGTH.
* semantics.c (finish_call_expr): Use build_nt_call_list
instead of build_nt.
(simplify_aggr_init_expr): Update to use new AGGR_INIT_EXPR
accessor macros. Use build_call_array to construct the
CALL_EXPR node instead of build3
* decl2.c (build_offset_ref_call_from_tree): Use
build_nt_call_list and build_min_non_dep_call_list instead
of build_min_nt and build_min_non_dep.
* parser.c (cp_parser_postfix_expression) <CPP_OPEN_PAREN>:
Use build_nt_call_list instead of build_min_nt.
2007-02-15 Sandra Loosemore <sandra@codesourcery.com>
Brooks Moses <brooks.moses@codesourcery.com>
Lee Millward <lee.millward@codesourcery.com>
* java-tree.h (BUILD_MONITOR_ENTER): Use build_call_nary instead
of build3.
(BUILD_MONITOR_EXIT): Likewise.
* java-gimplify.c (java_gimplify_component_ref): Use build_call_expr.
(java_gimplify_modify_expr): Likewise.
* class.c (cache_this_class_ref): Use build_call_expr.
(build_static_field_ref): Likewise.
(emit_indirect_register_classes): Likewise.
(emit_register_classes): Likewise.
* resource.c (write_resource_constructor): Use build_call_expr.
* builtins.c (builtin_creator_function): Change interpretation of
the second parameter to be the whole CALL_EXPR instead of the arglist.
(max_builtin): Tweak parameter list. Use new CALL_EXPR accessors.
(min_builtin): Likewise.
(abs_builtin): Likewise.
(java_build_function_call_expr): Likewise.
(convert_real): Likewise.
(UNMARSHAL3): Likewise.
(UNMARSHAL4): Likewise.
(UNMARSHAL5): Likewise.
(build_arglist_for_builtin): Delete. Fix callers to use
build_call_expr instead.
(putObject_builtin): Tweak parameter list. Use new CALL_EXPR
accessors.
(compareAndSwapInt_builtin): Likewise.
(compareAndSwapLong_builtin): Likewise.
(compareAndSwapObject_builtin): Likewise.
(putVolatile_builtin): Likewise.
(getVolatile_builtin): Likewise.
(VMSupportsCS8_builtin): Likewise.
(check_for_builtin): Pass entire CALL_EXPR to builtin expander
instead of arglist.
* expr.c (build_java_athrow): Use build_call_nary instead of build3.
(build_java_throw_out_of_bounds_exception): Likewise.
(java_check_reference): Likewise.
(build_java_arraystore_check): Likewise.
(build_newarray): Likewise.
(build_anewarray): Likewise.
(expand_java_multinewarray): Use build_call_list instead of build3.
(build_java_monitor): Use build_call_nary instead of build3.
(java_create_object): Likewise.
(expand_java_NEW): Likewise.
(build_instanceof): Likewise.
(expand_java_CHECKCAST): Likewise.
(build_java_soft_divmod): Likewise.
(build_java_binop): Likewise.
(build_field_ref): Likewise.
(build_class_init): Likewise.
(rewrite_arglist_getcaller): Use build_call_expr.
(build_invokeinterface): Use build_call_nary instead of build3.
(expand_invoke): Use build_call_list instead of build3.
(build_jni_stub): Use build_call_nary, build_call_list, or
build_call_expr instead of build3.
(expand_java_field_op): Use build_call_expr instead of build3.
(force_evaluation_order): Use new CALL_EXPR accessors.
* lang.c (java_get_callee_fndecl): Use new CALL_EXPR accessors.
2007-02-15 Sandra Loosemore <sandra@codesourcery.com>
Brooks Moses <brooks.moses@codesourcery.com>
Lee Millward <lee.millward@codesourcery.com>
* objc-act.c (receiver_is_class_object): Use new CALL_EXPR accessors.
(objc_get_callee_fndecl): Likewise.
2007-02-15 Sandra Loosemore <sandra@codesourcery.com>
Brooks Moses <brooks.moses@codesourcery.com>
Lee Millward <lee.millward@codesourcery.com>
* trans-expr.c (gfc_conv_power_op): Use build_call_expr.
(gfc_conv_string_tmp): Likewise.
(gfc_conv_concat_op): Likewise.
(gfc_build_compare_string): Likewise.
(gfc_conv_function_call): Use build_call_list instead of build3.
* trans-array.c (gfc_trans_allocate_array_storage): Use
build_call_expr.
(gfc_grow_array): Likewise.
(gfc_trans_array_ctor_element): Likewise.
(gfc_trans_array_constructor_value): Likewise.
(gfc_array_allocate): Likewise.
(gfc_array_deallocate): Likewise.
(gfc_trans_auto_array_allocation): Likewise.
(gfc_trans_dummy_array_bias): Likewise.
(gfc_conv_array_parameter): Likewise.
(gfc_trans_dealloc_allocated): Likewise.
(gfc_duplicate_allocatable): Likewise.
* trans-openmp.c (gfc_trans_omp_barrier): Use build_call_expr.
(gfc_trans_omp_flush): Likewise.
* trans-stmt.c (gfc_conv_elementel_dependencies): Use build_call_expr.
(gfc_trans_pause): Likewise.
(gfc_trans_stop): Likewise.
(gfc_trans_character_select): Likewise.
(gfc_do_allocate): Likewise.
(gfc_trans_assign_need_temp): Likewise.
(gfc_trans_pointer_assign_need_temp): Likewise.
(gfc_trans_forall_1): Likewise.
(gfc_trans_where_2): Likewise.
(gfc_trans_allocate): Likewise.
(gfc_trans_deallocate): Likewise.
* trans.c (gfc_trans_runtime_check): Use build_call_expr.
* trans-io.c (gfc_trans_open): Use build_call_expr.
(gfc_trans_close): Likewise.
(build_filepos): Likewise.
(gfc_trans_inquire): Likewise.
(NML_FIRST_ARG): Delete.
(NML_ADD_ARG): Delete.
(transfer_namelist_element): Use build_call_expr.
(build_dt): Likewise.
(gfc_trans_dt_end): Likewise.
(transfer_expr): Likewise.
(transfer_array-desc): Likewise.
* trans-decl.c (gfc_generate_function_code): Use build_call_expr.
(gfc_generate_constructors): Likewise.
* trans-intrinsic.c (gfc_conv_intrinsic_ctime): Use build_call_expr.
(gfc_conv_intrinsic_fdate): Likewise.
(gfc_conv_intrinsic_ttynam): Likewise.
(gfc_conv_intrinsic_array_transfer): Likewise.
(gfc_conv_associated): Likewise.
(gfc_conv_intrinsic_si_kind): Likewise.
(gfc_conv_intrinsic_trim): Likewise.
(gfc_conv_intrinsic_repeat: Likewise.
(gfc_conv_intrinsic_iargc): Likewise.
Co-Authored-By: Brooks Moses <brooks.moses@codesourcery.com>
Co-Authored-By: Lee Millward <lee.millward@codesourcery.com>
From-SVN: r122018
2007-02-16 00:50:49 +01:00
|
|
|
second operand of a @code{TARGET_EXPR}. @code{AGGR_INIT_EXPR}s have
|
|
|
|
a representation similar to that of @code{CALL_EXPR}s. You can use
|
|
|
|
the @code{AGGR_INIT_EXPR_FN} and @code{AGGR_INIT_EXPR_ARG} macros to access
|
|
|
|
the function to call and the arguments to pass.
|
1999-09-19 17:50:40 +02:00
|
|
|
|
|
|
|
If @code{AGGR_INIT_VIA_CTOR_P} holds of the @code{AGGR_INIT_EXPR}, then
|
tree.h (enum tree_code_class): Add tcc_vl_exp.
2007-02-15 Sandra Loosemore <sandra@codesourcery.com>
Brooks Moses <brooks.moses@codesourcery.com>
Lee Millward <lee.millward@codesourcery.com>
* tree.h (enum tree_code_class): Add tcc_vl_exp.
(VL_EXP_CLASS_P): New.
(TREE_OPERAND_CHECK): Use TREE_OPERAND_LENGTH instead of
TREE_CODE_LENGTH.
(TREE_OPERAND_CHECK_CODE): Likewise.
(GIMPLE_STMT_OPERAND_CHECK): Likewise.
(TREE_RTL_OPERAND_CHECK): Likewise.
(tree_operand_check_failed): Make second parameter the whole tree
instead of its code. Fixed callers.
(VL_EXP_CHECK): New.
(TREE_OPERAND_LENGTH): New.
(VL_EXP_OPERAND_LENGTH): New.
(CALL_EXPR_FN): New.
(CALL_EXPR_STATIC_CHAIN): New.
(CALL_EXPR_ARGS): New.
(CALL_EXPR_ARG): New.
(call_expr_nargs): New.
(CALL_EXPR_ARGP): New.
(build_nt_call_list): Declare.
(build_vl_exp_stat): Declare.
(build_vl_exp): New.
(build_call_list): Declare.
(build_call_nary): Declare.
(build_call_valist): Declare.
(build_call_array): Declare.
(call_expr_arg): Declare.
(call_expr_argp): Declare.
(call_expr_arglist): Declare.
(fold_build_call_list): Declare.
(fold_build_call_list_initializer): Declare.
(fold_call_expr): Declare to replace fold_builtin.
(fold_builtin_fputs): Update to agree with modified definition.
(fold_builtin_strcpy): Likewise.
(fold_builtin_strncpy): Likewise.
(fold_builtin_memory_chk): Likewise.
(fold_builtin_stxcpy_chk): Likewise.
(fold_builtin_strncpy_chk): Likewise.
(fold_builtin_next_arg): Likewise.
(fold_build_call_expr): Declare.
(fold_builtin_call_list): Declare.
(fold_builtin_call_valist): Declare.
(build_call_expr): Declare.
(validate_arglist): Update to agree with modified definition.
(tree_operand_length): New.
(call_expr_arg_iterator): New.
(init_call_expr_arg_iterator): New.
(next_call_expr_arg): New.
(first_call_expr_arg): New.
(more_call_expr_args_p): New.
(FOR_EACH_CALL_EXPR_ARG): New.
* tree.c (tree_code_class_string): Add entries for tcc_vl_exp
and tcc_gimple_stmt.
(tree_code_size): Update documentation. Use sizeof (tree) rather
than sizeof (char *).
(tree_size): Likewise. Add case for tcc_vl_exp.
(tree_node_structure): Add case for tcc_vl_exp.
(contains_placeholder_p): Likewise.
(substitute_in_expr): Likewise.
(substitute_placeholder_in_expr): Likewise.
(stabilize_reference_1): Likewise.
(build3_stat): Remove logic for CALL_EXPRs. Replace with assertion
to diagnose breakage of this interface for constructing CALL_EXPRs.
(build_nt): Add similar assertion here.
(build_nt_call_list): New.
(simple_cst_equal) <CALL_EXPR>: Rewrite to use new accessors.
(iterative_hash_expr): Use TREE_OPERAND_LENGTH instead of
TREE_CODE_LENGTH.
(get_callee_fndecl): Use new CALL_EXPR accessors.
(tree_operand_check_failed): Change parameters to pass entire node
instead of its code, so that we can call TREE_OPERAND_LENGTH on it.
(process_call_operands): New.
(build_vl_exp_stat): New.
(build_call_list): New.
(build_call_nary): New.
(build_call_valist): New.
(build_call_array): New.
(walk_tree): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH.
(call_expr_arglist): New.
* tree.def (CALL_EXPR): Change representation of CALL_EXPRs to use
tcc_vl_exp instead of a fixed-size tcc_expression.
* doc/c-tree.texi (CALL_EXPR): Document new representation and
accessors for CALL_EXPRs.
(AGGR_INIT_EXPR): Likewise.
2007-02-15 Sandra Loosemore <sandra@codesourcery.com>
Brooks Moses <brooks.moses@codesourcery.com>
Lee Millward <lee.millward@codesourcery.com>
* builtins.c (c_strlen): Return NULL_TREE instead of 0.
(expand_builtin_nonlocal_goto): Change parameter to be entire
CALL_EXPR instead of an arglist. Use new CALL_EXPR accessors.
(expand_builtin_prefetch): Likewise.
(expand_builtin_classify_type): Likewise.
(mathfn_built_in): Return NULL_TREE instead of 0.
(expand_errno_check): Use new CALL_EXPR accessors.
(expand_builtin_mathfn): Use new CALL_EXPR accessors and constructors.
Return NULL_RTX instead of 0.
(expand_builtin_mathfn_2): Likewise.
(expand_builtin_mathfn_3): Likewise.
(expand_builtin_interclass_mathfn): Likewise.
(expand_builtin_sincos): Likewise.
(expand_builtin_cexpi): Likewise.
(expand_builtin_int_roundingfn): Likewise.
(expand_builtin_int_roundingfn_2): Likewise.
(expand_builtin_pow): Likewise.
(expand_builtin_powi): Likewise.
(expand_builtin_strlen): Pass entire CALL_EXPR as parameter instead
of arglist, fixing callers appropriately. Use new CALL_EXPR
accessors and constructors. Return NULL_RTX instead of 0.
(expand_builtin_strstr): Likewise.
(expand_builtin_strchr): Likewise.
(expand_builtin_strrchr): Likewise.
(expand_builtin_strpbrk): Likewise.
(expand_builtin_memcpy): Likewise.
(expand_builtin_mempcpy): Likewise.
(expand_builtin_mempcpy_args): New.
(expand_builtin_memmove): Similarly to expand_builtin_mempcpy.
(expand_builtin_memmove_args): New.
(expand_builtin_bcopy): Similarly to expand_builtin_mempcpy.
(expand_movstr): Likewise.
(expand_builtin_strcpy): Likewise.
(expand_builtin_strcpy_args): New.
(expand_builtin_stpcpy): Similarly to expand_builtin_strcpy.
(expand_builtin_strncpy): Likewise.
(expand_builtin_memset): Likewise.
(expand_builtin_memset_args): New.
(expand_builtin_bzero): Similarly to expand_builtin_memset.
(expand_builtin_memcmp): Likewise.
(expand_builtin_strcmp): Likewise.
(expand_builtin_strncmp): Likewise.
(expand_builtin_strcat): Likewise.
(expand_builtin_strncat): Likewise.
(expand_builtin_strspn): Likewise.
(expand_builtin_strcspn): Likewise.
(expand_builtin_args_info): Likewise.
(expand_builtin_va_start): Likewise.
(gimplify_va_arg_expr): Likewise.
(expand_builtin_va_end): Likewise.
(expand_builtin_va_copy): Likewise.
(expand_builtin_frame_address): Likewise.
(expand_builtin_alloca): Likewise.
(expand_builtin_bswap): Likewise.
(expand_builtin_unop): Likewise.
(expand_builtin_fputs): Likewise.
(expand_builtin_expect): Likewise.
(expand_builtin_fabs): Likewise.
(expand_builtin_copysign): Likewise.
(expand_builtin_printf): Likewise.
(expand_builtin_fprintf): Likewise.
(expand_builtin_sprintf): Likewise.
(expand_builtin_init_trampoline): Likewise.
(expand_builtin_signbit): Likewise.
(expand_builtin_fork_or_exec): Likewise.
(expand_builtin_sync_operation): Likewise.
(expand_builtin_compare_and_swap): Likewise.
(expand_builtin_lock_test_and_set): Likewise.
(expand_builtin_lock_release): Likewise.
(expand_builtin): Likewise.
(builtin_mathfn_code): Likewise.
(fold_builtin_constant_p): Pass call arguments individually instead
of as an arglist, fixing callers appropriately. Use new CALL_EXPR
accessors and constructors. Return NULL_TREE instead of 0.
(fold_builtin_expect): Likewise.
(fold_builtin_classify_type): Likewise.
(fold_builtin_strlen): Likewise.
(fold_builtin_nan): Likewise.
(integer_valued_real_p): Likewise.
(fold_trunc_transparent_mathfn): Likewise.
(fold_fixed_mathfn): Likewise.
(fold_builtin_cabs): Likewise.
(fold_builtin_sqrt): Likewise.
(fold_builtin_cbrt): Likewise.
(fold_builtin_cos): Likewise.
(fold_builtin_cosh): Likewise.
(fold_builtin_tan): Likewise.
(fold_builtin_sincos): Likewise.
(fold_builtin_cexp): Likewise.
(fold_builtin_trunc): Likewise.
(fold_builtin_floor): Likewise.
(fold_builtin_ceil): Likewise.
(fold_builtin_round): Likewise.
(fold_builtin_int_roundingfn): Likewise.
(fold_builtin_bitop): Likewise.
(fold_builtin_bswap): Likewise.
(fold_builtin_logarithm): Likewise.
(fold_builtin_hypot): Likewise.
(fold_builtin_pow): Likewise.
(fold_builtin_powi): Likewise.
(fold_builtin_exponent): Likewise.
(fold_builtin_memset): Likewise.
(fold_builtin_bzero): Likewise.
(fold_builtin_memory_op): Likewise.
(fold_builtin_bcopy): Deleted; call site changed to invoke
fold_builtin_memory_op directly.
(fold_builtin_strcpy): Similarly as for fold_builtin_memory_op.
(fold_builtin_strncpy): Likewise.
(fold_builtin_memcmp): Likewise.
(fold_builtin_strcmp): Likewise.
(fold_builtin_strncmp): Likewise.
(fold_builtin_signbit): Likewise.
(fold_builtin_copysign): Likewise.
(fold_builtin_isascii): Likewise.
(fold_builtin_toascii): Likewise.
(fold_builtin_isdigit): Likewise.
(fold_builtin_fabs): Likewise.
(fold_builtin_abs): Likewise.
(fold_builtin_fmin_fmax): Likewise.
(fold_builtin_carg): Likewise.
(fold_builtin_classify): Likewise.
(fold_builtin_unordered_cmp): Likewise.
(fold_builtin_0, fold_builtin_2, fold_builtin_3, fold_builtin_4):
New functions split out from fold_builtin_1.
(fold_builtin_n): New.
(fold_builtin_varargs): New.
(fold_builtin): Deleted. Most callers changed to use fold_call_expr
instead.
(fold_call_expr): New.
(build_function_call_expr): Rewrite to use new helper function.
(fold_builtin_call_list): New.
(build_call_expr): New.
(fold_builtin_call_valist): New.
(rewrite_call_expr): New.
(validate_arg): New.
(validate_arglist): Change parameter to be entire CALL_EXPR instead
of an arglist. Change return type to bool. Use new CALL_EXPR
accessors.
(fold_builtin_strstr): Pass call arguments individually instead
of as an arglist, fixing callers appropriately. Use new CALL_EXPR
accessors and constructors. Return NULL_TREE instead of 0.
(fold_builtin_strchr): Likewise.
(fold_builtin_strrchr): Likewise.
(fold_builtin_strpbrk): Likewise.
(fold_builtin_strcat): Likewise.
(fold_builtin_strncat): Likewise.
(fold_builtin_strspn): Likewise.
(fold_builtin_strcspn): Likewise.
(fold_builtin_fputs): Likewise.
(fold_builtin_next_arg): Likewise.
(fold_builtin_sprintf): Likewise.
(expand_builtin_object_size): Use new CALL_EXPR accessors. Use
NULL_RTX instead of 0.
(expand_builtin_memory_chk): Likewise.
(maybe_emit_chk_warning): Likewise.
(maybe_emit_sprintf_chk_warning): Likewise.
(fold_builtin_object_size): Pass call arguments individually instead
of as an arglist, fixing callers appropriately. Use new CALL_EXPR
accessors and constructors. Return NULL_TREE instead of 0.
(fold_builtin_memory_chk): Likewise.
(fold_builtin_stxcpy_chk): Likewise.
(fold_builtin_strncpy_chk): Likewise.
(fold_builtin_strcat_chk): Likewise.
(fold_builtin_strcat_chk): Likewise.
(fold_builtin_strncat_chk): Likewise.
(fold_builtin_sprintf_chk): Likewise.
(fold_builtin_snprintf_chk): Likewise.
(fold_builtin_printf): Likewise.
(fold_builtin_vprintf): Likewise.
* fold-const.c (negate_expr_p): Use new CALL_EXPR accessors and
constructors.
(operand_equal_p): Add separate tcc_vl_exp/CALL_EXPR case.
(make_range): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH.
(extract_muldiv_1): Add VL_EXP_CLASS_P case.
(fold_mathfn_compare): Use new CALL_EXPR accessors and constructors.
(fold_unary): Likewise.
(fold_binary): Likewise.
(fold_ternary): Remove CALL_EXPR case, since they are no longer
ternary expressions.
(fold): Add logic for tcc_vl_exp.
(fold_checksum_tree): Make it know about tcc_vl_exp. Use
TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH.
(fold_build3_stat): Add assertion to flag broken interface for
constructing CALL_EXPRs.
(fold_build_call_list): New.
(fold_build_call_list_initializer): New.
(tree_expr_nonnegative_p): Use new CALL_EXPR accessors and
constructors.
(fold_strip_sign_ops): Likewise.
2007-02-15 Sandra Loosemore <sandra@codesourcery.com>
Brooks Moses <brooks.moses@codesourcery.com>
Lee Millward <lee.millward@codesourcery.com>
* tree-dump.c (dequeue_and_dump) <CALL_EXPR>: Use new CALL_EXPR
accessors and dump arguments explicitly.
* tree-pretty-print.c (do_niy): Use TREE_OPERAND_LENGTH instead of
TREE_CODE_LENGTH.
(dump_generic_node): Use new CALL_EXPR accessors and walk arguments
explicitly.
(print_call_name): Use new CALL_EXPR accessors.
* print-tree.c (print_node): Add case tcc_vl_exp. Print
CALL_EXPR arguments explicitly instead of as a list. Use
TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH.
* tree-vrp.c (stmt_interesting_for_vrp): Use new CALL_EXPR accessors.
(vrp_visit_stmt): Likewise.
* tree-ssa-loop-im.c (outermost_invariant_loop_expr): Make it
know about tcc_vl_exp. Use TREE_OPERAND_LENGTH instead of
TREE_CODE_LENGTH.
(force_move_till_expr): Likewise.
* targhooks.c (default_external_stack_protect_fail): Use
build_call_expr instead of build_function_call_expr.
(default_hidden_stack_protect_fail): Likewise.
* tree-complex.c (expand_complex_libcall): Use build_call_expr to
build the call.
* cgraphbuild.c (build_cgraph_edges): Use new CALL_EXPR accessors
and walk arguments explicitly.
* tree-ssa-loop-niter.c (simplify_replace_tree): Use
TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH.
(expand_simple_operations): Likewise.
(infer_loop_bounds_from_array): Use new CALL_EXPR accessors.
* gengtype.c (adjust_field_tree_exp): Use TREE_OPERAND_LENGTH instead
of TREE_CODE_LENGTH.
(walk_type): Tweak walking of arrays not to blow up on CALL_EXPRs.
* optabs.c (expand_widen_pattern-expr): Use TREE_OPERAND_LENGTH
instead of TREE_CODE_LENGTH.
* value_prof.c (tree_ic): Use new CALL_EXPR accessors.
(tree_ic_transform): Likewise.
(interesting_stringop_to_profile_p): Pass entire CALL_EXPR as
parameter instead of arglist. Fix callers.
(tree_stringop_fixed_value): Use new CALL_EXPR accessors.
(tree_stringops_transform): Likewise.
(tree_indirect_call_to_profile): Likewise.
(tree_stringops_values_to_profile): Likewise.
* tree-tailcall.c (find_tail_calls): Use new CALL_EXPR iterator.
(eliminate_tail_call): Likewise.
* ipa-cp.c (ipcp_update_callgraph): Use new CALL_EXPR accessors.
* tree-scalar-evolution.c (chrec_contains_symbols_defined_in_loop):
Use TREE_OPERAND_LENGTH and generalize to handle any number of
operands.
(instantiate_parameters_1): Can't handle tcc_vl_exp here.
* omp-low.c (build_omp_barrier): Use build_call_expr.
(lower_rec_input_clauses): Likewise.
(lower_reduction_clauses): Likewise.
(expand_parallel_call): Likewise.
(maybe_catch_exception): Likewise.
(expand_omp_for_generic): Likewise.
(expand_omp_for_static_nochunk): Likewise.
(expand_omp_sections): Likewise.
(lower_omp_single_simple): Likewise.
(lower_omp_single_copy): Likewise.
(lower_omp_master): Likewise.
(lower_omp_ordered): Likewise.
(lower_omp_critical): Likewise.
* ipa-reference.c (check-call): Use new CALL_EXPR iterator.
(scan_for_static_refs): Create tcc_vl_exp case for CALL_EXPR.
* tree-gimple.c (is_gimple_call_addr): Fix doc.
(recalculate_side_effects): Use TREE_OPERAND_LENGTH instead of
TREE_CODE_LENGTH. Add tcc_vl_exp case.
* tree-chrec.c (chrec_contains_symbols): Use TREE_OPERAND_LENGTH
and generalize to handle any number of operands.
(chrec_contains_undetermined): Likewise.
(tree_contains_chrecs): Likewise.
(evolution_function_is_invariant_rec_p): Use TREE_OPERAND_LENGTH.
* cgraphunit.c (update_call_expr): Use new CALL_EXPR accessors.
* tree-ssa-ccp.c (ccp_fold): Use new CALL_EXPR accessors. Use
fold_call_expr instead of fold_builtin.
(ccp_fold_builtin): Likewise. Update calls into builtins.c to
match declarations there.
(fold_stmt): Use new CALL_EXPR constructor and accessors. Doc
updates.
* tree-ssa-loop-ivopts.c (expr_invariant_in_loop_p): Use
TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH.
* ipa-pure-const.c (check_call): Use new CALL_EXPR accessors.
(scan_function): Add case tcc_vl_exp for CALL_EXPR.
* tree-stdarg.c (execute_optimize_stdarg): Use new CALL_EXPR
accessors.
* tree-ssa-math-opts.c (execute_cse_sincos_1): Use build_call_expr.
(execute_cse_sincos): Use new CALL_EXPR accessors.
* tree-ssa-alias.c (find_used_portions): Use new CALL_EXPR iterator.
* gimple-low.c (lower_function_body): Use build_call_expr.
(lower_builtin_setjmp): Likewise.
* expr.c (emit_block_move_via_libcall): Use build_call_expr.
(set_storage_via_libcall): Likewise.
(safe_from_p): Add tcc_vl_exp case. Use TREE_OPERAND_LENGTH
instead of TREE_CODE_LENGTH.
(expand_expr_real_1): Use new CALL_EXPR accessors.
* tree-browser.c (store_child_info): Use TREE_OPERAND_LENGTH and
generalize to handle any number of operands.
(TB_parent_eq): Likewise.
* predict.c (expr_expected_value): Use new CALL_EXPR accessors.
(strip_builtin_expect): Likewise.
* function.c (gimplify_parameters): Use build_call_expr.
* tree-vectorizer.c (vect_is_simple_reduction): Use TREE_OPERAND_LENGTH
instead of TREE_CODE_LENGTH.
* ipa-type-escape.c (check_call): Use new CALL_EXPR iterators.
(scan_for_refs): Add case tcc_vl_exp for CALL_EXPR.
* tree-data-ref.c (get_references_in_stmt): Use new CALL_EXPR
iterators.
* gimplify.c (build_stack_save_restore): Use build_call_expr.
(gimplify_decl_expr): Likewise.
(gimplify_call_expr): Use fold_call_expr instead of fold_builtin.
Use new CALL_EXPR iterators.
(gimplify_modify_expr_to_memcpy): Use build_call_expr.
(gimplify_modify_expr_to_memset): Likewise.
(gimplify_variable_sized_compare): Likewise.
(gimplify_omp_atomic_fetch_op): Likewise.
(gimplify_omp_atomic_pipeline): Likewise.
(gimplify_omp_atomic_mutex): Likewise.
(gimplify_function_tree): Likewise.
* calls.c (alloca_call_p): Use new CALL_EXPR accessors.
(call_expr_flags): Likewise.
(expand_call): Likewise.
* except.c (expand_builtin_eh_return_data_regno): Pass entire
CALL_EXPR as parameter instead of arglist. Use new CALL_EXPR
accessors.
* coverage.c (create_coverage): Use build_call_expr.
* tree-ssa-pre.c (expression_node_pool, list_node_pool): Delete.
(temp_call_expr_obstack): New.
(pool_copy_list): Delete.
(temp_copy_call_expr): New.
(phi_translate): Add case tcc_vl_exp for CALL_EXPR. Use new
CALL_EXPR accessors. Get rid of special goo for copying argument
lists and use temp_copy_call_expr instead.
(valid_in_sets): Add case tcc_vl_exp for CALL_EXPR. Use new
CALL_EXPR accessors.
(create_expression_by_pieces): Likewise. Use build_call_array
to construct the result instead of fold_build3.
(create_value_expr_from): Add tcc_vl_exp. Delete special goo for
dealing with argument lists.
(init_pre): Remove references to expression_node_pool and
list_node_pool. Init temp_call_expr_obstack instead.
(fini_pre): Remove references to expression_node_pool and
list_node_pool.
* tree-sra.c (sra_walk_call_expr): Use new CALL_EXPR accessors
and walk arguments explicitly instead of as a list.
* tree-mudflap.c (mf_build_check_statement_for): Use build_call_expr.
(mx_register_decls): Likewise.
(mudflap_register_call): Likewise.
(mudflap_finish_file): Likewise.
* ipa-prop.c (ipa_callsite_compute_count): Use new CALL_EXPR accessors.
(ipa_callsite_compute_param): Likewise.
* tree-vect-patterns.c (vect_recog_pow_pattern): Use new CALL_EXPR
accessors and constructor.
* tree-nested.c (convert_nl_goto_reference): Use new CALL_EXPR
accessors and constructor.
(convert_tramp_reference): Likewise.
(convert_call_expr): Likewise.
(finalize_nesting_tree_1): Likewise.
* tree-ssa.c (tree_ssa_useless_type_conversion): Use new CALL_EXPR
accessors.
* tree-ssa-loop-prefetch.c (issue_prefetch_ref): Use build_call_expr.
* tree-inline.c (initialize_inlined_parameters): Pass entire
CALL_EXPR as parameter instead of arglist. Use new CALL_EXPR
accessors.
(estimate_num_insns_1): Use new CALL_EXPR accessors.
(expand_call_inline): Tidy up call to initialize_inlined_parameters.
* tree-vect-transform.c (vect_create_epilog_for_reduction): Use
TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH.
(vectorizable_reduction): Likewise.
(vectorizable_call): Use new CALL_EXPR iterators.
(vectorizable_conversion): Use build_call_expr.
(vectorizable_operation): Use TREE_OPERAND_LENGTH.
(vect_gen_widened_results_half): Use build_call_expr.
(vect_setup_realignment): Likewise.
(vectorizable_live_operation): Use TREE_OPERAND_LENGTH.
* tree-object-size.c (alloc_object_size): Use new CALL_EXPR accessors.
(pass_through_call): Likewise.
(compute_object_sizes): Likewise. Use fold_call_expr instead of
fold_builtin.
* tree-profile.c (tree_gen_interval_profiler): Use build_call_expr.
(tree_gen_pow2_profiler): Likewise.
(tree_gen_one_value_profiler): Likewise.
(tree_gen_ic_func_profiler): Likewise.
(tree_gen_average_profiler): Likewise.
(tree_gen_ior_profiler): Likewise.
* tree-ssa-structalias.c (get_constraint_for): Add case tcc_vl_exp.
(find_func_aliases): Use new CALL_EXPR accessors. Add case
tcc_vl_exp. Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH.
* tree-ssa-reassoc.c (get_rank): Use TREE_OPERAND_LENGTH instead
of TREE_CODE_LENGTH.
* stmt.c (warn_if_unused_value): Use TREE_OPERAND_LENGTH instead
of TREE_CODE_LENGTH.
* convert.c (convert_to_real): Use new CALL_EXPR accessors and
constructor.
(convert_to_integer): Likewise.
* tree-ssa-operands.c (get_call_expr_operands): Use new CALL_EXPR
accessors.
2007-02-15 Sandra Loosemore <sandra@codesourcery.com>
Brooks Moses <brooks.moses@codesourcery.com>
Lee Millward <lee.millward@codesourcery.com>
* config/alpha/alpha.c (alpha_expand_builtin): Use new CALL_EXPR
accessors.
* config/frv/frv.c (frv_expand_builtin): Likewise.
* config/s390/s390.c (s390_expand_builtin): Likewise.
* config/sparc/sparc.c (sparc_gimplify_va_arg): Use build_call_expr.
(sparc_expand_builtin): Use new CALL_EXPR accessors.
* config/i386/i386.c (ix86_function_ok_for_sibcall): Likewise.
(ix86_expand_binop_builtin): Pass entire CALL_EXPR as parameter
instead of arglist. Use new CALL_EXPR accessors on it. Fix callers.
(ix86_expand_store_builtin): Likewise.
(ix86_expand_unop_builtin): Likewise.
(ix86_expand_unop1_builtin): Likewise.
(ix86_expand_sse_compare): Likewise.
(ix86_expand_sse_comi): Likewise.
(ix86_expand_vec_init_builtin): Likewise.
(ix86_expand_vec_ext_builtin): Likewise.
(ix86_expand_vec_set_builtin): Likewise.
(ix86_expand_builtin): Use new CALL_EXPR accessors.
* config/sh/sh.c (sh_expand_builtin): Use new CALL_EXPR accessors.
* config/c4x/c4x.c (c4x_expand_builtin): Likewise.
* config/iq2000/iq2000.c (expand_one_builtin): Pass entire CALL_EXPR
instead of arglist. Use new CALL_EXPR accessors. Fix callers.
(iq2000_expand_builtin): Use new CALL_EXPR accessors.
* config/rs6000/rs6000-c.c (altivec_build_resolved_builtin): Use
build_call_expr.
* config/rs6000/rs6000.c (rs6000_gimplify_va_arg): Likewise.
(rs6000_expand_unop_builtin): Pass entire CALL_EXPR instead of
arglist. Use new CALL_EXPR accessors. Fix callers.
(altivec_expand_abs_builtin): Likewise.
(rs6000_expand_binop_builtin): Likewise.
(altivec_expand_predicate_builtin): Likewise.
(altivec_expand_lv_builtin): Likewise.
(spe_expand_stv_builtin): Likewise.
(altivec_expand_stv_builtin): Likewise.
(rs6000_expand_ternop_builtin): Likewise.
(altivec_expand_ld_builtin): Use new CALL_EXPR accessors.
(altivec_expand_st_builtin): Likewise.
(altivec_expand_dst_builtin): Likewise.
(altivec_expand_vec_init_builtin): Pass entire CALL_EXPR instead of
arglist. Use new CALL_EXPR accessors. Fix callers.
(altivec_expand_vec_set_builtin): Likewise.
(altivec_expand_vec_ext_builtin): Likewise.
(altivec_expand_builtin): Use new CALL_EXPR accessors.
(spe_expand_builtin): Likewise.
(spe_expand_predicate_builtin): Pass entire CALL_EXPR instead of
arglist. Use new CALL_EXPR accessors. Fix callers.
(spe_expand_evsel_builtin): Likewise.
(rs6000_expand_builtin): Use new CALL_EXPR accessors. VCFUX and
FCFSX cases must construct whole new CALL_EXPR, not just arglist.
* config/arm/arm.c (arm_expand_binop_builtin): Pass entire CALL_EXPR
instead of arglist. Use new CALL_EXPR accessors. Fix callers.
(arm_expand_unop_builtin): Likewise.
(arm_expand_builtin): Use new CALL_EXPR accessors.
* config/mips/mips.c (mips_expand_builtin): Use new CALL_EXPR
accessors.
* config/bfin/bfin.c (bfin_expand_binop_builtin): Pass entire CALL_EXPR
instead of arglist. Use new CALL_EXPR accessors. Fix callers.
(bfin_expand_unop_builtin): Likewise.
(bfin_expand_builtin): Use new CALL_EXPR accessors.
2007-02-15 Sandra Loosemore <sandra@codesourcery.com>
Brooks Moses <brooks.moses@codesourcery.com>
Lee Millward <lee.millward@codesourcery.com>
* c-semantics.c (build_stmt): Add internal diagnostic check.
* c-pretty-print.c (pp_c_postfix_expression): Use new CALL_EXPR
accessors. Print arguments explicitly instead of as a list.
* c-typeck.c (build_function_call): Use new CALL_EXPR constructors.
* c-omp.c (c_finish_omp_barrier): Use build_call_expr.
(c_finish_omp_flish): Likewise.
* c-common.c (verify_tree): Use new CALL_EXPR accessors. Traverse
arguments explicitly instead of as a list. Use TREE_OPERAND_LENGTH
instead of TREE_CODE_LENGTH.
(check_function_arguments_recurse): Use new CALL_EXPR accessors.
(c_warn_unused_result): Likewise.
2007-02-15 Sandra Loosemore <sandra@codesourcery.com>
Brooks Moses <brooks.moses@codesourcery.com>
Lee Millward <lee.millward@codesourcery.com>
* cp-tree.def (AGGR_INIT_EXPR): Adjust documentation.
Change class to tcc_vl_exp.
* call.c (build_call): Use build_call_list instead
of build3.
(build_over_call): Likewise.
(build_new_method_call): Use build_min_non_dep_call_list
instead of build_min_non_dep.
* error.c (dump_call_expr_args): New function.
(dump_aggr_init_expr_args): New function.
(dump_expr) <AGGR_INIT_EXPR, CALL_EXPR, INDIRECT_REF>: Use them.
Update to use new CALL_EXPR and AGGR_INIT_EXPR accessor macros.
* cvt.c (convert_to_void): Use build_call_array instead
of build3; use new AGGR_INIT_EXPR accessor macros.
* mangle.c (write_expression): Use TREE_OPERAND_LENGTH
instead of TREE_CODE_LENGTH.
* dump.c (cp_dump_tree) <AGGR_INIT_EXPR>: Update to use new
AGGR_INIT_EXPR accessor macros.
* cp-gimplify.c (cp_gimplify_init_expr): Use
AGGR_INIT_EXPR_SLOT to set the slot operand.
* cp-tree.h (AGGR_INIT_EXPR_FN): New macro.
(AGGR_INIT_EXPR_SLOT): New macro.
(AGGR_INIT_EXPR_ARG): New macro.
(aggr_init_expr_nargs): New macro.
(AGGR_INIT_EXPR_ARGP): New macro.
(aggr_init_expr_arg_iterator): New.
(init_aggr_init_expr_arg_iterator): New.
(next_aggr_init_expr_arg): New.
(first_aggr_init_expr_arg): New.
(more_aggr_init_expr_args_p): New.
(FOR_EACH_AGGR_INIT_EXPR_ARG): New.
(stabilize_aggr_init): New declaration.
(build_min_non_dep_call_list): Likewise.
* tree.c (process_aggr_init_operands): New function.
(build_aggr_init_array) New function.
(build_cplus_new): Update to use new CALL_EXPR and
AGGR_INIT_EXPR accessor macros. Replace use of build3 with
build_aggr_init_array.
(build_min_non_dep_call_list) New function.
(build_min_nt): Assert input code parameter is not a variable
length expression class.
(build_min, build_min_non_dep): Likewise.
(cp_tree_equal) <CALL_EXPR>: Iterate through the arguments
to check for equality instead of recursing. Handle tcc_vl_exp
tree code classes.
(stabilize_call): Update to only handle CALL_EXPRs, not
AGGR_INIT_EXPRs; use new CALL_EXPR accessor macros.
(stabilize_aggr_init): New function.
(stabilize_init): Use it.
* cxx-pretty-print.c (pp_cxx_postfix_expression)
<AGGR_INIT_EXPR, CALL_EXPR>: Update to use new CALL_EXPR and
AGGR_INIT_EXPR accessor macros and argument iterators.
* pt.c (tsubst_copy) <CALL_EXPR>: Replace build_nt with
build_vl_exp. Iterate through the operands, recursively
processing each one.
(tsubst_copy_and_build) <CALL_EXPR>: Update to use new
CALL_EXPR accessor macros.
(value_dependent_expression_p) <default>: Handle tcc_vl_exp
tree code classes. Use TREE_OPERAND_LENGTH instead of
TREE_CODE_LENGTH.
* semantics.c (finish_call_expr): Use build_nt_call_list
instead of build_nt.
(simplify_aggr_init_expr): Update to use new AGGR_INIT_EXPR
accessor macros. Use build_call_array to construct the
CALL_EXPR node instead of build3
* decl2.c (build_offset_ref_call_from_tree): Use
build_nt_call_list and build_min_non_dep_call_list instead
of build_min_nt and build_min_non_dep.
* parser.c (cp_parser_postfix_expression) <CPP_OPEN_PAREN>:
Use build_nt_call_list instead of build_min_nt.
2007-02-15 Sandra Loosemore <sandra@codesourcery.com>
Brooks Moses <brooks.moses@codesourcery.com>
Lee Millward <lee.millward@codesourcery.com>
* java-tree.h (BUILD_MONITOR_ENTER): Use build_call_nary instead
of build3.
(BUILD_MONITOR_EXIT): Likewise.
* java-gimplify.c (java_gimplify_component_ref): Use build_call_expr.
(java_gimplify_modify_expr): Likewise.
* class.c (cache_this_class_ref): Use build_call_expr.
(build_static_field_ref): Likewise.
(emit_indirect_register_classes): Likewise.
(emit_register_classes): Likewise.
* resource.c (write_resource_constructor): Use build_call_expr.
* builtins.c (builtin_creator_function): Change interpretation of
the second parameter to be the whole CALL_EXPR instead of the arglist.
(max_builtin): Tweak parameter list. Use new CALL_EXPR accessors.
(min_builtin): Likewise.
(abs_builtin): Likewise.
(java_build_function_call_expr): Likewise.
(convert_real): Likewise.
(UNMARSHAL3): Likewise.
(UNMARSHAL4): Likewise.
(UNMARSHAL5): Likewise.
(build_arglist_for_builtin): Delete. Fix callers to use
build_call_expr instead.
(putObject_builtin): Tweak parameter list. Use new CALL_EXPR
accessors.
(compareAndSwapInt_builtin): Likewise.
(compareAndSwapLong_builtin): Likewise.
(compareAndSwapObject_builtin): Likewise.
(putVolatile_builtin): Likewise.
(getVolatile_builtin): Likewise.
(VMSupportsCS8_builtin): Likewise.
(check_for_builtin): Pass entire CALL_EXPR to builtin expander
instead of arglist.
* expr.c (build_java_athrow): Use build_call_nary instead of build3.
(build_java_throw_out_of_bounds_exception): Likewise.
(java_check_reference): Likewise.
(build_java_arraystore_check): Likewise.
(build_newarray): Likewise.
(build_anewarray): Likewise.
(expand_java_multinewarray): Use build_call_list instead of build3.
(build_java_monitor): Use build_call_nary instead of build3.
(java_create_object): Likewise.
(expand_java_NEW): Likewise.
(build_instanceof): Likewise.
(expand_java_CHECKCAST): Likewise.
(build_java_soft_divmod): Likewise.
(build_java_binop): Likewise.
(build_field_ref): Likewise.
(build_class_init): Likewise.
(rewrite_arglist_getcaller): Use build_call_expr.
(build_invokeinterface): Use build_call_nary instead of build3.
(expand_invoke): Use build_call_list instead of build3.
(build_jni_stub): Use build_call_nary, build_call_list, or
build_call_expr instead of build3.
(expand_java_field_op): Use build_call_expr instead of build3.
(force_evaluation_order): Use new CALL_EXPR accessors.
* lang.c (java_get_callee_fndecl): Use new CALL_EXPR accessors.
2007-02-15 Sandra Loosemore <sandra@codesourcery.com>
Brooks Moses <brooks.moses@codesourcery.com>
Lee Millward <lee.millward@codesourcery.com>
* objc-act.c (receiver_is_class_object): Use new CALL_EXPR accessors.
(objc_get_callee_fndecl): Likewise.
2007-02-15 Sandra Loosemore <sandra@codesourcery.com>
Brooks Moses <brooks.moses@codesourcery.com>
Lee Millward <lee.millward@codesourcery.com>
* trans-expr.c (gfc_conv_power_op): Use build_call_expr.
(gfc_conv_string_tmp): Likewise.
(gfc_conv_concat_op): Likewise.
(gfc_build_compare_string): Likewise.
(gfc_conv_function_call): Use build_call_list instead of build3.
* trans-array.c (gfc_trans_allocate_array_storage): Use
build_call_expr.
(gfc_grow_array): Likewise.
(gfc_trans_array_ctor_element): Likewise.
(gfc_trans_array_constructor_value): Likewise.
(gfc_array_allocate): Likewise.
(gfc_array_deallocate): Likewise.
(gfc_trans_auto_array_allocation): Likewise.
(gfc_trans_dummy_array_bias): Likewise.
(gfc_conv_array_parameter): Likewise.
(gfc_trans_dealloc_allocated): Likewise.
(gfc_duplicate_allocatable): Likewise.
* trans-openmp.c (gfc_trans_omp_barrier): Use build_call_expr.
(gfc_trans_omp_flush): Likewise.
* trans-stmt.c (gfc_conv_elementel_dependencies): Use build_call_expr.
(gfc_trans_pause): Likewise.
(gfc_trans_stop): Likewise.
(gfc_trans_character_select): Likewise.
(gfc_do_allocate): Likewise.
(gfc_trans_assign_need_temp): Likewise.
(gfc_trans_pointer_assign_need_temp): Likewise.
(gfc_trans_forall_1): Likewise.
(gfc_trans_where_2): Likewise.
(gfc_trans_allocate): Likewise.
(gfc_trans_deallocate): Likewise.
* trans.c (gfc_trans_runtime_check): Use build_call_expr.
* trans-io.c (gfc_trans_open): Use build_call_expr.
(gfc_trans_close): Likewise.
(build_filepos): Likewise.
(gfc_trans_inquire): Likewise.
(NML_FIRST_ARG): Delete.
(NML_ADD_ARG): Delete.
(transfer_namelist_element): Use build_call_expr.
(build_dt): Likewise.
(gfc_trans_dt_end): Likewise.
(transfer_expr): Likewise.
(transfer_array-desc): Likewise.
* trans-decl.c (gfc_generate_function_code): Use build_call_expr.
(gfc_generate_constructors): Likewise.
* trans-intrinsic.c (gfc_conv_intrinsic_ctime): Use build_call_expr.
(gfc_conv_intrinsic_fdate): Likewise.
(gfc_conv_intrinsic_ttynam): Likewise.
(gfc_conv_intrinsic_array_transfer): Likewise.
(gfc_conv_associated): Likewise.
(gfc_conv_intrinsic_si_kind): Likewise.
(gfc_conv_intrinsic_trim): Likewise.
(gfc_conv_intrinsic_repeat: Likewise.
(gfc_conv_intrinsic_iargc): Likewise.
Co-Authored-By: Brooks Moses <brooks.moses@codesourcery.com>
Co-Authored-By: Lee Millward <lee.millward@codesourcery.com>
From-SVN: r122018
2007-02-16 00:50:49 +01:00
|
|
|
the initialization is via a constructor call. The address of the
|
|
|
|
@code{AGGR_INIT_EXPR_SLOT} operand, which is always a @code{VAR_DECL},
|
1999-09-19 17:50:40 +02:00
|
|
|
is taken, and this value replaces the first argument in the argument
|
2004-06-18 00:35:55 +02:00
|
|
|
list.
|
|
|
|
|
|
|
|
In either case, the expression is void.
|
1999-09-19 17:50:40 +02:00
|
|
|
|
2002-08-05 17:50:10 +02:00
|
|
|
@item VA_ARG_EXPR
|
|
|
|
This node is used to implement support for the C/C++ variable argument-list
|
|
|
|
mechanism. It represents expressions like @code{va_arg (ap, type)}.
|
|
|
|
Its @code{TREE_TYPE} yields the tree representation for @code{type} and
|
|
|
|
its sole argument yields the representation for @code{ap}.
|
|
|
|
|
2007-06-12 19:47:37 +02:00
|
|
|
@item CHANGE_DYNAMIC_TYPE_EXPR
|
|
|
|
Indicates the special aliasing required by C++ placement new. It has
|
|
|
|
two operands: a type and a location. It means that the dynamic type
|
|
|
|
of the location is changing to be the specified type. The alias
|
|
|
|
analysis code takes this into account when doing type based alias
|
|
|
|
analysis.
|
|
|
|
|
2006-05-29 17:52:51 +02:00
|
|
|
@item OMP_PARALLEL
|
|
|
|
|
|
|
|
Represents @code{#pragma omp parallel [clause1 ... clauseN]}. It
|
|
|
|
has four operands:
|
|
|
|
|
|
|
|
Operand @code{OMP_PARALLEL_BODY} is valid while in GENERIC and
|
|
|
|
High GIMPLE forms. It contains the body of code to be executed
|
|
|
|
by all the threads. During GIMPLE lowering, this operand becomes
|
|
|
|
@code{NULL} and the body is emitted linearly after
|
|
|
|
@code{OMP_PARALLEL}.
|
|
|
|
|
|
|
|
Operand @code{OMP_PARALLEL_CLAUSES} is the list of clauses
|
|
|
|
associated with the directive.
|
|
|
|
|
|
|
|
Operand @code{OMP_PARALLEL_FN} is created by
|
|
|
|
@code{pass_lower_omp}, it contains the @code{FUNCTION_DECL}
|
|
|
|
for the function that will contain the body of the parallel
|
|
|
|
region.
|
|
|
|
|
|
|
|
Operand @code{OMP_PARALLEL_DATA_ARG} is also created by
|
|
|
|
@code{pass_lower_omp}. If there are shared variables to be
|
|
|
|
communicated to the children threads, this operand will contain
|
|
|
|
the @code{VAR_DECL} that contains all the shared values and
|
|
|
|
variables.
|
|
|
|
|
|
|
|
@item OMP_FOR
|
|
|
|
|
|
|
|
Represents @code{#pragma omp for [clause1 ... clauseN]}. It
|
|
|
|
has 5 operands:
|
|
|
|
|
|
|
|
Operand @code{OMP_FOR_BODY} contains the loop body.
|
|
|
|
|
|
|
|
Operand @code{OMP_FOR_CLAUSES} is the list of clauses
|
|
|
|
associated with the directive.
|
|
|
|
|
|
|
|
Operand @code{OMP_FOR_INIT} is the loop initialization code of
|
|
|
|
the form @code{VAR = N1}.
|
|
|
|
|
|
|
|
Operand @code{OMP_FOR_COND} is the loop conditional expression
|
|
|
|
of the form @code{VAR @{<,>,<=,>=@} N2}.
|
|
|
|
|
|
|
|
Operand @code{OMP_FOR_INCR} is the loop index increment of the
|
|
|
|
form @code{VAR @{+=,-=@} INCR}.
|
|
|
|
|
|
|
|
Operand @code{OMP_FOR_PRE_BODY} contains side-effect code from
|
|
|
|
operands @code{OMP_FOR_INIT}, @code{OMP_FOR_COND} and
|
|
|
|
@code{OMP_FOR_INC}. These side-effects are part of the
|
|
|
|
@code{OMP_FOR} block but must be evaluated before the start of
|
|
|
|
loop body.
|
|
|
|
|
|
|
|
The loop index variable @code{VAR} must be a signed integer variable,
|
|
|
|
which is implicitly private to each thread. Bounds
|
|
|
|
@code{N1} and @code{N2} and the increment expression
|
|
|
|
@code{INCR} are required to be loop invariant integer
|
|
|
|
expressions that are evaluated without any synchronization. The
|
|
|
|
evaluation order, frequency of evaluation and side-effects are
|
|
|
|
unspecified by the standard.
|
|
|
|
|
|
|
|
@item OMP_SECTIONS
|
|
|
|
|
|
|
|
Represents @code{#pragma omp sections [clause1 ... clauseN]}.
|
|
|
|
|
|
|
|
Operand @code{OMP_SECTIONS_BODY} contains the sections body,
|
|
|
|
which in turn contains a set of @code{OMP_SECTION} nodes for
|
|
|
|
each of the concurrent sections delimited by @code{#pragma omp
|
|
|
|
section}.
|
|
|
|
|
|
|
|
Operand @code{OMP_SECTIONS_CLAUSES} is the list of clauses
|
|
|
|
associated with the directive.
|
|
|
|
|
|
|
|
@item OMP_SECTION
|
|
|
|
|
|
|
|
Section delimiter for @code{OMP_SECTIONS}.
|
|
|
|
|
|
|
|
@item OMP_SINGLE
|
|
|
|
|
|
|
|
Represents @code{#pragma omp single}.
|
|
|
|
|
|
|
|
Operand @code{OMP_SINGLE_BODY} contains the body of code to be
|
|
|
|
executed by a single thread.
|
|
|
|
|
|
|
|
Operand @code{OMP_SINGLE_CLAUSES} is the list of clauses
|
|
|
|
associated with the directive.
|
|
|
|
|
|
|
|
@item OMP_MASTER
|
|
|
|
|
|
|
|
Represents @code{#pragma omp master}.
|
|
|
|
|
|
|
|
Operand @code{OMP_MASTER_BODY} contains the body of code to be
|
|
|
|
executed by the master thread.
|
|
|
|
|
|
|
|
@item OMP_ORDERED
|
|
|
|
|
|
|
|
Represents @code{#pragma omp ordered}.
|
|
|
|
|
|
|
|
Operand @code{OMP_ORDERED_BODY} contains the body of code to be
|
|
|
|
executed in the sequential order dictated by the loop index
|
|
|
|
variable.
|
|
|
|
|
|
|
|
@item OMP_CRITICAL
|
|
|
|
|
|
|
|
Represents @code{#pragma omp critical [name]}.
|
|
|
|
|
|
|
|
Operand @code{OMP_CRITICAL_BODY} is the critical section.
|
|
|
|
|
|
|
|
Operand @code{OMP_CRITICAL_NAME} is an optional identifier to
|
|
|
|
label the critical section.
|
|
|
|
|
|
|
|
@item OMP_RETURN
|
|
|
|
|
|
|
|
This does not represent any OpenMP directive, it is an artificial
|
|
|
|
marker to indicate the end of the body of an OpenMP. It is used
|
|
|
|
by the flow graph (@code{tree-cfg.c}) and OpenMP region
|
|
|
|
building code (@code{omp-low.c}).
|
|
|
|
|
|
|
|
@item OMP_CONTINUE
|
|
|
|
|
|
|
|
Similarly, this instruction does not represent an OpenMP
|
|
|
|
directive, it is used by @code{OMP_FOR} and
|
|
|
|
@code{OMP_SECTIONS} to mark the place where the code needs to
|
|
|
|
loop to the next iteration (in the case of @code{OMP_FOR}) or
|
|
|
|
the next section (in the case of @code{OMP_SECTIONS}).
|
|
|
|
|
|
|
|
In some cases, @code{OMP_CONTINUE} is placed right before
|
|
|
|
@code{OMP_RETURN}. But if there are cleanups that need to
|
|
|
|
occur right after the looping body, it will be emitted between
|
|
|
|
@code{OMP_CONTINUE} and @code{OMP_RETURN}.
|
|
|
|
|
|
|
|
@item OMP_ATOMIC
|
|
|
|
|
|
|
|
Represents @code{#pragma omp atomic}.
|
|
|
|
|
|
|
|
Operand 0 is the address at which the atomic operation is to be
|
|
|
|
performed.
|
|
|
|
|
|
|
|
Operand 1 is the expression to evaluate. The gimplifier tries
|
|
|
|
three alternative code generation strategies. Whenever possible,
|
|
|
|
an atomic update built-in is used. If that fails, a
|
|
|
|
compare-and-swap loop is attempted. If that also fails, a
|
|
|
|
regular critical section around the expression is used.
|
|
|
|
|
|
|
|
@item OMP_CLAUSE
|
|
|
|
|
|
|
|
Represents clauses associated with one of the @code{OMP_} directives.
|
|
|
|
Clauses are represented by separate sub-codes defined in
|
|
|
|
@file{tree.h}. Clauses codes can be one of:
|
|
|
|
@code{OMP_CLAUSE_PRIVATE}, @code{OMP_CLAUSE_SHARED},
|
|
|
|
@code{OMP_CLAUSE_FIRSTPRIVATE},
|
|
|
|
@code{OMP_CLAUSE_LASTPRIVATE}, @code{OMP_CLAUSE_COPYIN},
|
|
|
|
@code{OMP_CLAUSE_COPYPRIVATE}, @code{OMP_CLAUSE_IF},
|
|
|
|
@code{OMP_CLAUSE_NUM_THREADS}, @code{OMP_CLAUSE_SCHEDULE},
|
|
|
|
@code{OMP_CLAUSE_NOWAIT}, @code{OMP_CLAUSE_ORDERED},
|
|
|
|
@code{OMP_CLAUSE_DEFAULT}, and @code{OMP_CLAUSE_REDUCTION}. Each code
|
|
|
|
represents the corresponding OpenMP clause.
|
|
|
|
|
|
|
|
Clauses associated with the same directive are chained together
|
|
|
|
via @code{OMP_CLAUSE_CHAIN}. Those clauses that accept a list
|
|
|
|
of variables are restricted to exactly one, accessed with
|
|
|
|
@code{OMP_CLAUSE_VAR}. Therefore, multiple variables under the
|
|
|
|
same clause @code{C} need to be represented as multiple @code{C} clauses
|
|
|
|
chained together. This facilitates adding new clauses during
|
|
|
|
compilation.
|
|
|
|
|
[multiple changes]
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-analyze.c (vect_mark_relevant, vect_stmt_relevant_p): Take
enum argument instead of bool.
(vect_analyze_operations): Call vectorizable_type_promotion.
* tree-vectorizer.h (type_promotion_vec_info_type): New enum
stmt_vec_info_type value.
(supportable_widening_operation, vectorizable_type_promotion): New
function declarations.
* tree-vect-transform.c (vect_gen_widened_results_half): New function.
(vectorizable_type_promotion): New function.
(vect_transform_stmt): Call vectorizable_type_promotion.
* tree-vect-analyze.c (supportable_widening_operation): New function.
* tree-vect-patterns.c (vect_recog_dot_prod_pattern):
Add implementation.
* tree-vect-generic.c (expand_vector_operations_1): Consider correct
mode.
* tree.def (VEC_WIDEN_MULT_HI_EXPR, VEC_WIDEN_MULT_LO_EXPR):
(VEC_UNPACK_HI_EXPR, VEC_UNPACK_LO_EXPR): New tree-codes.
* tree-inline.c (estimate_num_insns_1): Add cases for above new
tree-codes.
* tree-pretty-print.c (dump_generic_node, op_prio): Likewise.
* expr.c (expand_expr_real_1): Likewise.
* optabs.c (optab_for_tree_code): Likewise.
(init_optabs): Initialize new optabs.
* genopinit.c (vec_widen_umult_hi_optab, vec_widen_smult_hi_optab,
vec_widen_smult_hi_optab, vec_widen_smult_lo_optab,
vec_unpacks_hi_optab, vec_unpacks_lo_optab, vec_unpacku_hi_optab,
vec_unpacku_lo_optab): Initialize new optabs.
* optabs.h (OTI_vec_widen_umult_hi, OTI_vec_widen_umult_lo):
(OTI_vec_widen_smult_h, OTI_vec_widen_smult_lo, OTI_vec_unpacks_hi,
OTI_vec_unpacks_lo, OTI_vec_unpacku_hi, OTI_vec_unpacku_lo): New
optab indices.
(vec_widen_umult_hi_optab, vec_widen_umult_lo_optab):
(vec_widen_smult_hi_optab, vec_widen_smult_lo_optab):
(vec_unpacks_hi_optab, vec_unpacku_hi_optab, vec_unpacks_lo_optab):
(vec_unpacku_lo_optab): New optabs.
* doc/md.texi (vec_unpacks_hi, vec_unpacks_lo, vec_unpacku_hi):
(vec_unpacku_lo, vec_widen_umult_hi, vec_widen_umult_lo):
(vec_widen_smult_hi, vec_widen_smult_lo): New.
* doc/c-tree.texi (VEC_LSHIFT_EXPR, VEC_RSHIFT_EXPR):
(VEC_WIDEN_MULT_HI_EXPR, VEC_WIDEN_MULT_LO_EXPR, VEC_UNPACK_HI_EXPR):
(VEC_UNPACK_LO_EXPR, VEC_PACK_MOD_EXPR, VEC_PACK_SAT_EXPR): New.
* config/rs6000/altivec.md (UNSPEC_VMULWHUB, UNSPEC_VMULWLUB):
(UNSPEC_VMULWHSB, UNSPEC_VMULWLSB, UNSPEC_VMULWHUH, UNSPEC_VMULWLUH):
(UNSPEC_VMULWHSH, UNSPEC_VMULWLSH): New.
(UNSPEC_VPERMSI, UNSPEC_VPERMHI): New.
(vec_vperm_v8hiv4si, vec_vperm_v16qiv8hi): New patterns used to
implement the unsigned unpacking patterns.
(vec_unpacks_hi_v16qi, vec_unpacks_hi_v8hi, vec_unpacks_lo_v16qi):
(vec_unpacks_lo_v8hi): New signed unpacking patterns.
(vec_unpacku_hi_v16qi, vec_unpacku_hi_v8hi, vec_unpacku_lo_v16qi):
(vec_unpacku_lo_v8hi): New unsigned unpacking patterns.
(vec_widen_umult_hi_v16qi, vec_widen_umult_lo_v16qi):
(vec_widen_smult_hi_v16qi, vec_widen_smult_lo_v16qi):
(vec_widen_umult_hi_v8hi, vec_widen_umult_lo_v8hi):
(vec_widen_smult_hi_v8hi, vec_widen_smult_lo_v8hi): New widening
multiplication patterns.
* target.h (builtin_mul_widen_even, builtin_mul_widen_odd): New.
* target-def.h (TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_EVEN):
(TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_ODD): New.
* config/rs6000/rs6000.c (rs6000_builtin_mul_widen_even): New.
(rs6000_builtin_mul_widen_odd): New.
(TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_EVEN): Defined.
(TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_ODD): Defined.
* tree-vectorizer.h (enum vect_relevant): New enum type.
(_stmt_vec_info): Field relevant chaned from bool to enum
vect_relevant.
(STMT_VINFO_RELEVANT_P): Updated.
(STMT_VINFO_RELEVANT): New.
* tree-vectorizer.c (new_stmt_vec_info): Use STMT_VINFO_RELEVANT
instead of STMT_VINFO_RELEVANT_P.
* tree-vect-analyze.c (vect_mark_relevant, vect_stmt_relevant_p):
Replace calls to STMT_VINFO_RELEVANT_P with STMT_VINFO_RELEVANT,
and boolean variable with enum vect_relevant.
(vect_mark_stmts_to_be_vectorized): Likewise + update documentation.
* doc/tm.texi (TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_EVEN): New.
(TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_ODD): New.
2006-11-08 Richard Henderson <rth@redhat.com>
* config/i386/sse.md (vec_widen_umult_hi_v8hi,
vec_widen_umult_lo_v8hi): New.
(vec_widen_smult_hi_v4si, vec_widen_smult_lo_v4si,
vec_widen_umult_hi_v4si, vec_widen_umult_lo_v4si): New.
* config/i386/i386.c (ix86_expand_sse_unpack): New.
* config/i386/i386-protos.h (ix86_expand_sse_unpack): New.
* config/i386/sse.md (vec_unpacku_hi_v16qi, vec_unpacks_hi_v16qi,
vec_unpacku_lo_v16qi, vec_unpacks_lo_v16qi, vec_unpacku_hi_v8hi,
vec_unpacks_hi_v8hi, vec_unpacku_lo_v8hi, vec_unpacks_lo_v8hi,
vec_unpacku_hi_v4si, vec_unpacks_hi_v4si, vec_unpacku_lo_v4si,
vec_unpacks_lo_v4si): New.
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-transform.c (vectorizable_type_demotion): New function.
(vect_transform_stmt): Add case for type_demotion_vec_info_type.
(vect_analyze_operations): Call vectorizable_type_demotion.
* tree-vectorizer.h (type_demotion_vec_info_type): New enum
stmt_vec_info_type value.
(vectorizable_type_demotion): New function declaration.
* tree-vect-generic.c (expand_vector_operations_1): Consider correct
mode.
* tree.def (VEC_PACK_MOD_EXPR, VEC_PACK_SAT_EXPR): New tree-codes.
* expr.c (expand_expr_real_1): Add case for VEC_PACK_MOD_EXPR and
VEC_PACK_SAT_EXPR.
* tree-iniline.c (estimate_num_insns_1): Likewise.
* tree-pretty-print.c (dump_generic_node, op_prio): Likewise.
* optabs.c (optab_for_tree_code): Likewise.
* optabs.c (expand_binop): In case of vec_pack_*_optabs the mode
compared against the predicate of the result is not 'mode' (the input
to the function) but a mode with half the size of 'mode'.
(init_optab): Initialize new optabs.
* optabs.h (OTI_vec_pack_mod, OTI_vec_pack_ssat, OTI_vec_pack_usat):
New optab indices.
(vec_pack_mod_optab, vec_pack_ssat_optab, vec_pack_usat_optab): New
optabs.
* genopinit.c (vec_pack_mod_optab, vec_pack_ssat_optab):
(vec_pack_usat_optab): Initialize new optabs.
* doc/md.texi (vec_pack_mod, vec_pack_ssat, vec_pack_usat): New.
* config/rs6000/altivec.md (vec_pack_mod_v8hi, vec_pack_mod_v4si): New.
2006-11-08 Richard Henderson <rth@redehat.com>
* config/i386/sse.md (vec_pack_mod_v8hi, vec_pack_mod_v4si):
(vec_pack_mod_v2di, vec_interleave_highv16qi, vec_interleave_lowv16qi):
(vec_interleave_highv8hi, vec_interleave_lowv8hi):
(vec_interleave_highv4si, vec_interleave_lowv4si):
(vec_interleave_highv2di, vec_interleave_lowv2di): New.
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-transform.c (vectorizable_reduction): Support multiple
datatypes.
(vect_transform_stmt): Removed redundant code.
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-transform.c (vectorizable_operation): Support multiple
datatypes.
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-transform.c (vect_align_data_ref): Removed.
(vect_create_data_ref_ptr): Added additional argument - ptr_incr.
Updated function documentation. Return the increment stmt in ptr_incr.
(bump_vector_ptr): New function.
(vect_get_vec_def_for_stmt_copy): New function.
(vect_finish_stmt_generation): Create a stmt_info to newly created
vector stmts.
(vect_setup_realignment): Call vect_create_data_ref_ptr with additional
argument.
(vectorizable_reduction, vectorizable_assignment): Not supported yet if
VF is greater than the number of elements that can fit in one vector
word.
(vectorizable_operation, vectorizable_condition): Likewise.
(vectorizable_store, vectorizable_load): Support the case that the VF
is greater than the number of elements that can fit in one vector word.
(vect_transform_loop): Don't fail in case of multiple data-types.
* tree-vect-analyze.c (vect_determine_vectorization_factor): Don't fail
in case of multiple data-types; the smallest type determines the VF.
(vect_analyze_data_ref_dependence): Don't record datarefs as same_align
if they are of different sizes.
(vect_update_misalignment_for_peel): Compare misalignments in terms of
number of elements rather than number of bytes.
(vect_enhance_data_refs_alignment): Fix/Add dump printouts.
(vect_can_advance_ivs_p): Fix a dump printout
From-SVN: r118577
2006-11-08 08:32:44 +01:00
|
|
|
@item VEC_LSHIFT_EXPR
|
|
|
|
@item VEC_RSHIFT_EXPR
|
|
|
|
These nodes represent whole vector left and right shifts, respectively.
|
|
|
|
The first operand is the vector to shift; it will always be of vector type.
|
|
|
|
The second operand is an expression for the number of bits by which to
|
|
|
|
shift. Note that the result is undefined if the second operand is larger
|
|
|
|
than or equal to the first operand's type size.
|
|
|
|
|
|
|
|
@item VEC_WIDEN_MULT_HI_EXPR
|
|
|
|
@item VEC_WIDEN_MULT_LO_EXPR
|
|
|
|
These nodes represent widening vector multiplication of the high and low
|
|
|
|
parts of the two input vectors, respectively. Their operands are vectors
|
|
|
|
that contain the same number of elements (@code{N}) of the same integral type.
|
|
|
|
The result is a vector that contains half as many elements, of an integral type
|
|
|
|
whose size is twice as wide. In the case of @code{VEC_WIDEN_MULT_HI_EXPR} the
|
|
|
|
high @code{N/2} elements of the two vector are multiplied to produce the
|
|
|
|
vector of @code{N/2} products. In the case of @code{VEC_WIDEN_MULT_LO_EXPR} the
|
|
|
|
low @code{N/2} elements of the two vector are multiplied to produce the
|
|
|
|
vector of @code{N/2} products.
|
|
|
|
|
|
|
|
@item VEC_UNPACK_HI_EXPR
|
|
|
|
@item VEC_UNPACK_LO_EXPR
|
2007-04-22 20:45:06 +02:00
|
|
|
These nodes represent unpacking of the high and low parts of the input vector,
|
[multiple changes]
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-analyze.c (vect_mark_relevant, vect_stmt_relevant_p): Take
enum argument instead of bool.
(vect_analyze_operations): Call vectorizable_type_promotion.
* tree-vectorizer.h (type_promotion_vec_info_type): New enum
stmt_vec_info_type value.
(supportable_widening_operation, vectorizable_type_promotion): New
function declarations.
* tree-vect-transform.c (vect_gen_widened_results_half): New function.
(vectorizable_type_promotion): New function.
(vect_transform_stmt): Call vectorizable_type_promotion.
* tree-vect-analyze.c (supportable_widening_operation): New function.
* tree-vect-patterns.c (vect_recog_dot_prod_pattern):
Add implementation.
* tree-vect-generic.c (expand_vector_operations_1): Consider correct
mode.
* tree.def (VEC_WIDEN_MULT_HI_EXPR, VEC_WIDEN_MULT_LO_EXPR):
(VEC_UNPACK_HI_EXPR, VEC_UNPACK_LO_EXPR): New tree-codes.
* tree-inline.c (estimate_num_insns_1): Add cases for above new
tree-codes.
* tree-pretty-print.c (dump_generic_node, op_prio): Likewise.
* expr.c (expand_expr_real_1): Likewise.
* optabs.c (optab_for_tree_code): Likewise.
(init_optabs): Initialize new optabs.
* genopinit.c (vec_widen_umult_hi_optab, vec_widen_smult_hi_optab,
vec_widen_smult_hi_optab, vec_widen_smult_lo_optab,
vec_unpacks_hi_optab, vec_unpacks_lo_optab, vec_unpacku_hi_optab,
vec_unpacku_lo_optab): Initialize new optabs.
* optabs.h (OTI_vec_widen_umult_hi, OTI_vec_widen_umult_lo):
(OTI_vec_widen_smult_h, OTI_vec_widen_smult_lo, OTI_vec_unpacks_hi,
OTI_vec_unpacks_lo, OTI_vec_unpacku_hi, OTI_vec_unpacku_lo): New
optab indices.
(vec_widen_umult_hi_optab, vec_widen_umult_lo_optab):
(vec_widen_smult_hi_optab, vec_widen_smult_lo_optab):
(vec_unpacks_hi_optab, vec_unpacku_hi_optab, vec_unpacks_lo_optab):
(vec_unpacku_lo_optab): New optabs.
* doc/md.texi (vec_unpacks_hi, vec_unpacks_lo, vec_unpacku_hi):
(vec_unpacku_lo, vec_widen_umult_hi, vec_widen_umult_lo):
(vec_widen_smult_hi, vec_widen_smult_lo): New.
* doc/c-tree.texi (VEC_LSHIFT_EXPR, VEC_RSHIFT_EXPR):
(VEC_WIDEN_MULT_HI_EXPR, VEC_WIDEN_MULT_LO_EXPR, VEC_UNPACK_HI_EXPR):
(VEC_UNPACK_LO_EXPR, VEC_PACK_MOD_EXPR, VEC_PACK_SAT_EXPR): New.
* config/rs6000/altivec.md (UNSPEC_VMULWHUB, UNSPEC_VMULWLUB):
(UNSPEC_VMULWHSB, UNSPEC_VMULWLSB, UNSPEC_VMULWHUH, UNSPEC_VMULWLUH):
(UNSPEC_VMULWHSH, UNSPEC_VMULWLSH): New.
(UNSPEC_VPERMSI, UNSPEC_VPERMHI): New.
(vec_vperm_v8hiv4si, vec_vperm_v16qiv8hi): New patterns used to
implement the unsigned unpacking patterns.
(vec_unpacks_hi_v16qi, vec_unpacks_hi_v8hi, vec_unpacks_lo_v16qi):
(vec_unpacks_lo_v8hi): New signed unpacking patterns.
(vec_unpacku_hi_v16qi, vec_unpacku_hi_v8hi, vec_unpacku_lo_v16qi):
(vec_unpacku_lo_v8hi): New unsigned unpacking patterns.
(vec_widen_umult_hi_v16qi, vec_widen_umult_lo_v16qi):
(vec_widen_smult_hi_v16qi, vec_widen_smult_lo_v16qi):
(vec_widen_umult_hi_v8hi, vec_widen_umult_lo_v8hi):
(vec_widen_smult_hi_v8hi, vec_widen_smult_lo_v8hi): New widening
multiplication patterns.
* target.h (builtin_mul_widen_even, builtin_mul_widen_odd): New.
* target-def.h (TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_EVEN):
(TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_ODD): New.
* config/rs6000/rs6000.c (rs6000_builtin_mul_widen_even): New.
(rs6000_builtin_mul_widen_odd): New.
(TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_EVEN): Defined.
(TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_ODD): Defined.
* tree-vectorizer.h (enum vect_relevant): New enum type.
(_stmt_vec_info): Field relevant chaned from bool to enum
vect_relevant.
(STMT_VINFO_RELEVANT_P): Updated.
(STMT_VINFO_RELEVANT): New.
* tree-vectorizer.c (new_stmt_vec_info): Use STMT_VINFO_RELEVANT
instead of STMT_VINFO_RELEVANT_P.
* tree-vect-analyze.c (vect_mark_relevant, vect_stmt_relevant_p):
Replace calls to STMT_VINFO_RELEVANT_P with STMT_VINFO_RELEVANT,
and boolean variable with enum vect_relevant.
(vect_mark_stmts_to_be_vectorized): Likewise + update documentation.
* doc/tm.texi (TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_EVEN): New.
(TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_ODD): New.
2006-11-08 Richard Henderson <rth@redhat.com>
* config/i386/sse.md (vec_widen_umult_hi_v8hi,
vec_widen_umult_lo_v8hi): New.
(vec_widen_smult_hi_v4si, vec_widen_smult_lo_v4si,
vec_widen_umult_hi_v4si, vec_widen_umult_lo_v4si): New.
* config/i386/i386.c (ix86_expand_sse_unpack): New.
* config/i386/i386-protos.h (ix86_expand_sse_unpack): New.
* config/i386/sse.md (vec_unpacku_hi_v16qi, vec_unpacks_hi_v16qi,
vec_unpacku_lo_v16qi, vec_unpacks_lo_v16qi, vec_unpacku_hi_v8hi,
vec_unpacks_hi_v8hi, vec_unpacku_lo_v8hi, vec_unpacks_lo_v8hi,
vec_unpacku_hi_v4si, vec_unpacks_hi_v4si, vec_unpacku_lo_v4si,
vec_unpacks_lo_v4si): New.
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-transform.c (vectorizable_type_demotion): New function.
(vect_transform_stmt): Add case for type_demotion_vec_info_type.
(vect_analyze_operations): Call vectorizable_type_demotion.
* tree-vectorizer.h (type_demotion_vec_info_type): New enum
stmt_vec_info_type value.
(vectorizable_type_demotion): New function declaration.
* tree-vect-generic.c (expand_vector_operations_1): Consider correct
mode.
* tree.def (VEC_PACK_MOD_EXPR, VEC_PACK_SAT_EXPR): New tree-codes.
* expr.c (expand_expr_real_1): Add case for VEC_PACK_MOD_EXPR and
VEC_PACK_SAT_EXPR.
* tree-iniline.c (estimate_num_insns_1): Likewise.
* tree-pretty-print.c (dump_generic_node, op_prio): Likewise.
* optabs.c (optab_for_tree_code): Likewise.
* optabs.c (expand_binop): In case of vec_pack_*_optabs the mode
compared against the predicate of the result is not 'mode' (the input
to the function) but a mode with half the size of 'mode'.
(init_optab): Initialize new optabs.
* optabs.h (OTI_vec_pack_mod, OTI_vec_pack_ssat, OTI_vec_pack_usat):
New optab indices.
(vec_pack_mod_optab, vec_pack_ssat_optab, vec_pack_usat_optab): New
optabs.
* genopinit.c (vec_pack_mod_optab, vec_pack_ssat_optab):
(vec_pack_usat_optab): Initialize new optabs.
* doc/md.texi (vec_pack_mod, vec_pack_ssat, vec_pack_usat): New.
* config/rs6000/altivec.md (vec_pack_mod_v8hi, vec_pack_mod_v4si): New.
2006-11-08 Richard Henderson <rth@redehat.com>
* config/i386/sse.md (vec_pack_mod_v8hi, vec_pack_mod_v4si):
(vec_pack_mod_v2di, vec_interleave_highv16qi, vec_interleave_lowv16qi):
(vec_interleave_highv8hi, vec_interleave_lowv8hi):
(vec_interleave_highv4si, vec_interleave_lowv4si):
(vec_interleave_highv2di, vec_interleave_lowv2di): New.
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-transform.c (vectorizable_reduction): Support multiple
datatypes.
(vect_transform_stmt): Removed redundant code.
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-transform.c (vectorizable_operation): Support multiple
datatypes.
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-transform.c (vect_align_data_ref): Removed.
(vect_create_data_ref_ptr): Added additional argument - ptr_incr.
Updated function documentation. Return the increment stmt in ptr_incr.
(bump_vector_ptr): New function.
(vect_get_vec_def_for_stmt_copy): New function.
(vect_finish_stmt_generation): Create a stmt_info to newly created
vector stmts.
(vect_setup_realignment): Call vect_create_data_ref_ptr with additional
argument.
(vectorizable_reduction, vectorizable_assignment): Not supported yet if
VF is greater than the number of elements that can fit in one vector
word.
(vectorizable_operation, vectorizable_condition): Likewise.
(vectorizable_store, vectorizable_load): Support the case that the VF
is greater than the number of elements that can fit in one vector word.
(vect_transform_loop): Don't fail in case of multiple data-types.
* tree-vect-analyze.c (vect_determine_vectorization_factor): Don't fail
in case of multiple data-types; the smallest type determines the VF.
(vect_analyze_data_ref_dependence): Don't record datarefs as same_align
if they are of different sizes.
(vect_update_misalignment_for_peel): Compare misalignments in terms of
number of elements rather than number of bytes.
(vect_enhance_data_refs_alignment): Fix/Add dump printouts.
(vect_can_advance_ivs_p): Fix a dump printout
From-SVN: r118577
2006-11-08 08:32:44 +01:00
|
|
|
respectively. The single operand is a vector that contains @code{N} elements
|
2007-04-22 20:45:06 +02:00
|
|
|
of the same integral or floating point type. The result is a vector
|
|
|
|
that contains half as many elements, of an integral or floating point type
|
|
|
|
whose size is twice as wide. In the case of @code{VEC_UNPACK_HI_EXPR} the
|
|
|
|
high @code{N/2} elements of the vector are extracted and widened (promoted).
|
|
|
|
In the case of @code{VEC_UNPACK_LO_EXPR} the low @code{N/2} elements of the
|
|
|
|
vector are extracted and widened (promoted).
|
|
|
|
|
re PR tree-optimization/24659 (Conversions are not vectorized)
PR tree-optimization/24659
* optabs.h (enum optab_index): Add OTI_vec_unpacks_float_hi,
OTI_vec_unpacks_float_lo, OTI_vec_unpacku_float_hi,
OTI_vec_unpacku_float_lo, OTI_vec_pack_sfix_trunc and
OTI_vec_pack_ufix_trunc.
(vec_unpacks_float_hi_optab): Define new macro.
(vec_unpacks_float_lo_optab): Ditto.
(vec_unpacku_float_hi_optab): Ditto.
(vec_unpacku_float_lo_optab): Ditto.
(vec_pack_sfix_trunc_optab): Ditto.
(vec_pack_ufix_trunc_optab): Ditto.
* genopinit.c (optabs): Implement vec_unpack[s|u]_[hi|lo]_optab
and vec_pack_[s|u]fix_trunc_optab using
vec_unpack[s|u]_[hi\lo]_* and vec_pack_[u|s]fix_trunc_* patterns
* tree-vectorizer.c (supportable_widening_operation): Handle
FLOAT_EXPR and CONVERT_EXPR. Update comment.
(supportable_narrowing_operation): New function.
* tree-vectorizer.h (supportable_narrowing_operation): Prototype.
* tree-vect-transform.c (vectorizable_conversion): Handle
(nunits_in == nunits_out / 2) and (nunits_out == nunits_in / 2) cases.
(vect_gen_widened_results_half): Move before vectorizable_conversion.
(vectorizable_type_demotion): Call supportable_narrowing_operation()
to check for target support.
* optabs.c (optab_for_tree_code) Return vec_unpack[s|u]_float_hi_optab
for VEC_UNPACK_FLOAT_HI_EXPR, vec_unpack[s|u]_float_lo_optab
for VEC_UNPACK_FLOAT_LO_EXPR and vec_pack_[u|s]fix_trunc_optab
for VEC_PACK_FIX_TRUNC_EXPR.
(expand_binop): Special case mode of the result for
vec_pack_[u|s]fix_trunc_optab.
(init_optabs): Initialize vec_unpack[s|u]_[hi|lo]_optab and
vec_pack_[u|s]fix_trunc_optab.
* tree.def (VEC_UNPACK_FLOAT_HI_EXPR, VEC_UNPACK_FLOAT_LO_EXPR,
VEC_PACK_FIX_TRUNC_EXPR): New tree codes.
* tree-pretty-print.c (dump_generic_node): Handle
VEC_UNPACK_FLOAT_HI_EXPR, VEC_UNPACK_FLOAT_LO_EXPR and
VEC_PACK_FIX_TRUNC_EXPR.
(op_prio): Ditto.
* expr.c (expand_expr_real_1): Ditto.
* tree-inline.c (estimate_num_insns_1): Ditto.
* tree-vect-generic.c (expand_vector_operations_1): Ditto.
* config/i386/sse.md (vec_unpacks_float_hi_v8hi): New expander.
(vec_unpacks_float_lo_v8hi): Ditto.
(vec_unpacku_float_hi_v8hi): Ditto.
(vec_unpacku_float_lo_v8hi): Ditto.
(vec_unpacks_float_hi_v4si): Ditto.
(vec_unpacks_float_lo_v4si): Ditto.
(vec_pack_sfix_trunc_v2df): Ditto.
* doc/c-tree.texi (Expression trees) [VEC_UNPACK_FLOAT_HI_EXPR]:
Document.
[VEC_UNPACK_FLOAT_LO_EXPR]: Ditto.
[VEC_PACK_FIX_TRUNC_EXPR]: Ditto.
* doc/md.texi (Standard Names) [vec_pack_sfix_trunc]: Document.
[vec_pack_ufix_trunc]: Ditto.
[vec_unpacks_float_hi]: Ditto.
[vec_unpacks_float_lo]: Ditto.
[vec_unpacku_float_hi]: Ditto.
[vec_unpacku_float_lo]: Ditto.
testsuite/ChangeLog:
PR tree-optimization/24659
* gcc.dg/vect/vect-floatint-conversion-2.c: New test.
* gcc.dg/vect/vect-intfloat-conversion-1.c: Require vect_float,
not vect_int target.
* gcc.dg/vect/vect-intfloat-conversion-2.c: Require vect_float,
not vect_int target. Loop is vectorized for vect_intfloat_cvt
targets.
* gcc.dg/vect/vect-intfloat-conversion-3.c: New test.
* gcc.dg/vect/vect-intfloat-conversion-4a.c: New test.
* gcc.dg/vect/vect-intfloat-conversion-4b.c: New test.
From-SVN: r124784
2007-05-17 08:31:05 +02:00
|
|
|
@item VEC_UNPACK_FLOAT_HI_EXPR
|
|
|
|
@item VEC_UNPACK_FLOAT_LO_EXPR
|
|
|
|
These nodes represent unpacking of the high and low parts of the input vector,
|
|
|
|
where the values are converted from fixed point to floating point. The
|
|
|
|
single operand is a vector that contains @code{N} elements of the same
|
|
|
|
integral type. The result is a vector that contains half as many elements
|
|
|
|
of a floating point type whose size is twice as wide. In the case of
|
|
|
|
@code{VEC_UNPACK_HI_EXPR} the high @code{N/2} elements of the vector are
|
|
|
|
extracted, converted and widened. In the case of @code{VEC_UNPACK_LO_EXPR}
|
|
|
|
the low @code{N/2} elements of the vector are extracted, converted and widened.
|
|
|
|
|
2007-04-22 20:45:06 +02:00
|
|
|
@item VEC_PACK_TRUNC_EXPR
|
|
|
|
This node represents packing of truncated elements of the two input vectors
|
|
|
|
into the output vector. Input operands are vectors that contain the same
|
|
|
|
number of elements of the same integral or floating point type. The result
|
|
|
|
is a vector that contains twice as many elements of an integral or floating
|
|
|
|
point type whose size is half as wide. The elements of the two vectors are
|
|
|
|
demoted and merged (concatenated) to form the output vector.
|
[multiple changes]
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-analyze.c (vect_mark_relevant, vect_stmt_relevant_p): Take
enum argument instead of bool.
(vect_analyze_operations): Call vectorizable_type_promotion.
* tree-vectorizer.h (type_promotion_vec_info_type): New enum
stmt_vec_info_type value.
(supportable_widening_operation, vectorizable_type_promotion): New
function declarations.
* tree-vect-transform.c (vect_gen_widened_results_half): New function.
(vectorizable_type_promotion): New function.
(vect_transform_stmt): Call vectorizable_type_promotion.
* tree-vect-analyze.c (supportable_widening_operation): New function.
* tree-vect-patterns.c (vect_recog_dot_prod_pattern):
Add implementation.
* tree-vect-generic.c (expand_vector_operations_1): Consider correct
mode.
* tree.def (VEC_WIDEN_MULT_HI_EXPR, VEC_WIDEN_MULT_LO_EXPR):
(VEC_UNPACK_HI_EXPR, VEC_UNPACK_LO_EXPR): New tree-codes.
* tree-inline.c (estimate_num_insns_1): Add cases for above new
tree-codes.
* tree-pretty-print.c (dump_generic_node, op_prio): Likewise.
* expr.c (expand_expr_real_1): Likewise.
* optabs.c (optab_for_tree_code): Likewise.
(init_optabs): Initialize new optabs.
* genopinit.c (vec_widen_umult_hi_optab, vec_widen_smult_hi_optab,
vec_widen_smult_hi_optab, vec_widen_smult_lo_optab,
vec_unpacks_hi_optab, vec_unpacks_lo_optab, vec_unpacku_hi_optab,
vec_unpacku_lo_optab): Initialize new optabs.
* optabs.h (OTI_vec_widen_umult_hi, OTI_vec_widen_umult_lo):
(OTI_vec_widen_smult_h, OTI_vec_widen_smult_lo, OTI_vec_unpacks_hi,
OTI_vec_unpacks_lo, OTI_vec_unpacku_hi, OTI_vec_unpacku_lo): New
optab indices.
(vec_widen_umult_hi_optab, vec_widen_umult_lo_optab):
(vec_widen_smult_hi_optab, vec_widen_smult_lo_optab):
(vec_unpacks_hi_optab, vec_unpacku_hi_optab, vec_unpacks_lo_optab):
(vec_unpacku_lo_optab): New optabs.
* doc/md.texi (vec_unpacks_hi, vec_unpacks_lo, vec_unpacku_hi):
(vec_unpacku_lo, vec_widen_umult_hi, vec_widen_umult_lo):
(vec_widen_smult_hi, vec_widen_smult_lo): New.
* doc/c-tree.texi (VEC_LSHIFT_EXPR, VEC_RSHIFT_EXPR):
(VEC_WIDEN_MULT_HI_EXPR, VEC_WIDEN_MULT_LO_EXPR, VEC_UNPACK_HI_EXPR):
(VEC_UNPACK_LO_EXPR, VEC_PACK_MOD_EXPR, VEC_PACK_SAT_EXPR): New.
* config/rs6000/altivec.md (UNSPEC_VMULWHUB, UNSPEC_VMULWLUB):
(UNSPEC_VMULWHSB, UNSPEC_VMULWLSB, UNSPEC_VMULWHUH, UNSPEC_VMULWLUH):
(UNSPEC_VMULWHSH, UNSPEC_VMULWLSH): New.
(UNSPEC_VPERMSI, UNSPEC_VPERMHI): New.
(vec_vperm_v8hiv4si, vec_vperm_v16qiv8hi): New patterns used to
implement the unsigned unpacking patterns.
(vec_unpacks_hi_v16qi, vec_unpacks_hi_v8hi, vec_unpacks_lo_v16qi):
(vec_unpacks_lo_v8hi): New signed unpacking patterns.
(vec_unpacku_hi_v16qi, vec_unpacku_hi_v8hi, vec_unpacku_lo_v16qi):
(vec_unpacku_lo_v8hi): New unsigned unpacking patterns.
(vec_widen_umult_hi_v16qi, vec_widen_umult_lo_v16qi):
(vec_widen_smult_hi_v16qi, vec_widen_smult_lo_v16qi):
(vec_widen_umult_hi_v8hi, vec_widen_umult_lo_v8hi):
(vec_widen_smult_hi_v8hi, vec_widen_smult_lo_v8hi): New widening
multiplication patterns.
* target.h (builtin_mul_widen_even, builtin_mul_widen_odd): New.
* target-def.h (TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_EVEN):
(TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_ODD): New.
* config/rs6000/rs6000.c (rs6000_builtin_mul_widen_even): New.
(rs6000_builtin_mul_widen_odd): New.
(TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_EVEN): Defined.
(TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_ODD): Defined.
* tree-vectorizer.h (enum vect_relevant): New enum type.
(_stmt_vec_info): Field relevant chaned from bool to enum
vect_relevant.
(STMT_VINFO_RELEVANT_P): Updated.
(STMT_VINFO_RELEVANT): New.
* tree-vectorizer.c (new_stmt_vec_info): Use STMT_VINFO_RELEVANT
instead of STMT_VINFO_RELEVANT_P.
* tree-vect-analyze.c (vect_mark_relevant, vect_stmt_relevant_p):
Replace calls to STMT_VINFO_RELEVANT_P with STMT_VINFO_RELEVANT,
and boolean variable with enum vect_relevant.
(vect_mark_stmts_to_be_vectorized): Likewise + update documentation.
* doc/tm.texi (TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_EVEN): New.
(TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_ODD): New.
2006-11-08 Richard Henderson <rth@redhat.com>
* config/i386/sse.md (vec_widen_umult_hi_v8hi,
vec_widen_umult_lo_v8hi): New.
(vec_widen_smult_hi_v4si, vec_widen_smult_lo_v4si,
vec_widen_umult_hi_v4si, vec_widen_umult_lo_v4si): New.
* config/i386/i386.c (ix86_expand_sse_unpack): New.
* config/i386/i386-protos.h (ix86_expand_sse_unpack): New.
* config/i386/sse.md (vec_unpacku_hi_v16qi, vec_unpacks_hi_v16qi,
vec_unpacku_lo_v16qi, vec_unpacks_lo_v16qi, vec_unpacku_hi_v8hi,
vec_unpacks_hi_v8hi, vec_unpacku_lo_v8hi, vec_unpacks_lo_v8hi,
vec_unpacku_hi_v4si, vec_unpacks_hi_v4si, vec_unpacku_lo_v4si,
vec_unpacks_lo_v4si): New.
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-transform.c (vectorizable_type_demotion): New function.
(vect_transform_stmt): Add case for type_demotion_vec_info_type.
(vect_analyze_operations): Call vectorizable_type_demotion.
* tree-vectorizer.h (type_demotion_vec_info_type): New enum
stmt_vec_info_type value.
(vectorizable_type_demotion): New function declaration.
* tree-vect-generic.c (expand_vector_operations_1): Consider correct
mode.
* tree.def (VEC_PACK_MOD_EXPR, VEC_PACK_SAT_EXPR): New tree-codes.
* expr.c (expand_expr_real_1): Add case for VEC_PACK_MOD_EXPR and
VEC_PACK_SAT_EXPR.
* tree-iniline.c (estimate_num_insns_1): Likewise.
* tree-pretty-print.c (dump_generic_node, op_prio): Likewise.
* optabs.c (optab_for_tree_code): Likewise.
* optabs.c (expand_binop): In case of vec_pack_*_optabs the mode
compared against the predicate of the result is not 'mode' (the input
to the function) but a mode with half the size of 'mode'.
(init_optab): Initialize new optabs.
* optabs.h (OTI_vec_pack_mod, OTI_vec_pack_ssat, OTI_vec_pack_usat):
New optab indices.
(vec_pack_mod_optab, vec_pack_ssat_optab, vec_pack_usat_optab): New
optabs.
* genopinit.c (vec_pack_mod_optab, vec_pack_ssat_optab):
(vec_pack_usat_optab): Initialize new optabs.
* doc/md.texi (vec_pack_mod, vec_pack_ssat, vec_pack_usat): New.
* config/rs6000/altivec.md (vec_pack_mod_v8hi, vec_pack_mod_v4si): New.
2006-11-08 Richard Henderson <rth@redehat.com>
* config/i386/sse.md (vec_pack_mod_v8hi, vec_pack_mod_v4si):
(vec_pack_mod_v2di, vec_interleave_highv16qi, vec_interleave_lowv16qi):
(vec_interleave_highv8hi, vec_interleave_lowv8hi):
(vec_interleave_highv4si, vec_interleave_lowv4si):
(vec_interleave_highv2di, vec_interleave_lowv2di): New.
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-transform.c (vectorizable_reduction): Support multiple
datatypes.
(vect_transform_stmt): Removed redundant code.
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-transform.c (vectorizable_operation): Support multiple
datatypes.
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-transform.c (vect_align_data_ref): Removed.
(vect_create_data_ref_ptr): Added additional argument - ptr_incr.
Updated function documentation. Return the increment stmt in ptr_incr.
(bump_vector_ptr): New function.
(vect_get_vec_def_for_stmt_copy): New function.
(vect_finish_stmt_generation): Create a stmt_info to newly created
vector stmts.
(vect_setup_realignment): Call vect_create_data_ref_ptr with additional
argument.
(vectorizable_reduction, vectorizable_assignment): Not supported yet if
VF is greater than the number of elements that can fit in one vector
word.
(vectorizable_operation, vectorizable_condition): Likewise.
(vectorizable_store, vectorizable_load): Support the case that the VF
is greater than the number of elements that can fit in one vector word.
(vect_transform_loop): Don't fail in case of multiple data-types.
* tree-vect-analyze.c (vect_determine_vectorization_factor): Don't fail
in case of multiple data-types; the smallest type determines the VF.
(vect_analyze_data_ref_dependence): Don't record datarefs as same_align
if they are of different sizes.
(vect_update_misalignment_for_peel): Compare misalignments in terms of
number of elements rather than number of bytes.
(vect_enhance_data_refs_alignment): Fix/Add dump printouts.
(vect_can_advance_ivs_p): Fix a dump printout
From-SVN: r118577
2006-11-08 08:32:44 +01:00
|
|
|
|
|
|
|
@item VEC_PACK_SAT_EXPR
|
2007-04-22 20:45:06 +02:00
|
|
|
This node represents packing of elements of the two input vectors into the
|
|
|
|
output vector using saturation. Input operands are vectors that contain
|
|
|
|
the same number of elements of the same integral type. The result is a
|
|
|
|
vector that contains twice as many elements of an integral type whose size
|
|
|
|
is half as wide. The elements of the two vectors are demoted and merged
|
|
|
|
(concatenated) to form the output vector.
|
[multiple changes]
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-analyze.c (vect_mark_relevant, vect_stmt_relevant_p): Take
enum argument instead of bool.
(vect_analyze_operations): Call vectorizable_type_promotion.
* tree-vectorizer.h (type_promotion_vec_info_type): New enum
stmt_vec_info_type value.
(supportable_widening_operation, vectorizable_type_promotion): New
function declarations.
* tree-vect-transform.c (vect_gen_widened_results_half): New function.
(vectorizable_type_promotion): New function.
(vect_transform_stmt): Call vectorizable_type_promotion.
* tree-vect-analyze.c (supportable_widening_operation): New function.
* tree-vect-patterns.c (vect_recog_dot_prod_pattern):
Add implementation.
* tree-vect-generic.c (expand_vector_operations_1): Consider correct
mode.
* tree.def (VEC_WIDEN_MULT_HI_EXPR, VEC_WIDEN_MULT_LO_EXPR):
(VEC_UNPACK_HI_EXPR, VEC_UNPACK_LO_EXPR): New tree-codes.
* tree-inline.c (estimate_num_insns_1): Add cases for above new
tree-codes.
* tree-pretty-print.c (dump_generic_node, op_prio): Likewise.
* expr.c (expand_expr_real_1): Likewise.
* optabs.c (optab_for_tree_code): Likewise.
(init_optabs): Initialize new optabs.
* genopinit.c (vec_widen_umult_hi_optab, vec_widen_smult_hi_optab,
vec_widen_smult_hi_optab, vec_widen_smult_lo_optab,
vec_unpacks_hi_optab, vec_unpacks_lo_optab, vec_unpacku_hi_optab,
vec_unpacku_lo_optab): Initialize new optabs.
* optabs.h (OTI_vec_widen_umult_hi, OTI_vec_widen_umult_lo):
(OTI_vec_widen_smult_h, OTI_vec_widen_smult_lo, OTI_vec_unpacks_hi,
OTI_vec_unpacks_lo, OTI_vec_unpacku_hi, OTI_vec_unpacku_lo): New
optab indices.
(vec_widen_umult_hi_optab, vec_widen_umult_lo_optab):
(vec_widen_smult_hi_optab, vec_widen_smult_lo_optab):
(vec_unpacks_hi_optab, vec_unpacku_hi_optab, vec_unpacks_lo_optab):
(vec_unpacku_lo_optab): New optabs.
* doc/md.texi (vec_unpacks_hi, vec_unpacks_lo, vec_unpacku_hi):
(vec_unpacku_lo, vec_widen_umult_hi, vec_widen_umult_lo):
(vec_widen_smult_hi, vec_widen_smult_lo): New.
* doc/c-tree.texi (VEC_LSHIFT_EXPR, VEC_RSHIFT_EXPR):
(VEC_WIDEN_MULT_HI_EXPR, VEC_WIDEN_MULT_LO_EXPR, VEC_UNPACK_HI_EXPR):
(VEC_UNPACK_LO_EXPR, VEC_PACK_MOD_EXPR, VEC_PACK_SAT_EXPR): New.
* config/rs6000/altivec.md (UNSPEC_VMULWHUB, UNSPEC_VMULWLUB):
(UNSPEC_VMULWHSB, UNSPEC_VMULWLSB, UNSPEC_VMULWHUH, UNSPEC_VMULWLUH):
(UNSPEC_VMULWHSH, UNSPEC_VMULWLSH): New.
(UNSPEC_VPERMSI, UNSPEC_VPERMHI): New.
(vec_vperm_v8hiv4si, vec_vperm_v16qiv8hi): New patterns used to
implement the unsigned unpacking patterns.
(vec_unpacks_hi_v16qi, vec_unpacks_hi_v8hi, vec_unpacks_lo_v16qi):
(vec_unpacks_lo_v8hi): New signed unpacking patterns.
(vec_unpacku_hi_v16qi, vec_unpacku_hi_v8hi, vec_unpacku_lo_v16qi):
(vec_unpacku_lo_v8hi): New unsigned unpacking patterns.
(vec_widen_umult_hi_v16qi, vec_widen_umult_lo_v16qi):
(vec_widen_smult_hi_v16qi, vec_widen_smult_lo_v16qi):
(vec_widen_umult_hi_v8hi, vec_widen_umult_lo_v8hi):
(vec_widen_smult_hi_v8hi, vec_widen_smult_lo_v8hi): New widening
multiplication patterns.
* target.h (builtin_mul_widen_even, builtin_mul_widen_odd): New.
* target-def.h (TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_EVEN):
(TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_ODD): New.
* config/rs6000/rs6000.c (rs6000_builtin_mul_widen_even): New.
(rs6000_builtin_mul_widen_odd): New.
(TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_EVEN): Defined.
(TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_ODD): Defined.
* tree-vectorizer.h (enum vect_relevant): New enum type.
(_stmt_vec_info): Field relevant chaned from bool to enum
vect_relevant.
(STMT_VINFO_RELEVANT_P): Updated.
(STMT_VINFO_RELEVANT): New.
* tree-vectorizer.c (new_stmt_vec_info): Use STMT_VINFO_RELEVANT
instead of STMT_VINFO_RELEVANT_P.
* tree-vect-analyze.c (vect_mark_relevant, vect_stmt_relevant_p):
Replace calls to STMT_VINFO_RELEVANT_P with STMT_VINFO_RELEVANT,
and boolean variable with enum vect_relevant.
(vect_mark_stmts_to_be_vectorized): Likewise + update documentation.
* doc/tm.texi (TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_EVEN): New.
(TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_ODD): New.
2006-11-08 Richard Henderson <rth@redhat.com>
* config/i386/sse.md (vec_widen_umult_hi_v8hi,
vec_widen_umult_lo_v8hi): New.
(vec_widen_smult_hi_v4si, vec_widen_smult_lo_v4si,
vec_widen_umult_hi_v4si, vec_widen_umult_lo_v4si): New.
* config/i386/i386.c (ix86_expand_sse_unpack): New.
* config/i386/i386-protos.h (ix86_expand_sse_unpack): New.
* config/i386/sse.md (vec_unpacku_hi_v16qi, vec_unpacks_hi_v16qi,
vec_unpacku_lo_v16qi, vec_unpacks_lo_v16qi, vec_unpacku_hi_v8hi,
vec_unpacks_hi_v8hi, vec_unpacku_lo_v8hi, vec_unpacks_lo_v8hi,
vec_unpacku_hi_v4si, vec_unpacks_hi_v4si, vec_unpacku_lo_v4si,
vec_unpacks_lo_v4si): New.
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-transform.c (vectorizable_type_demotion): New function.
(vect_transform_stmt): Add case for type_demotion_vec_info_type.
(vect_analyze_operations): Call vectorizable_type_demotion.
* tree-vectorizer.h (type_demotion_vec_info_type): New enum
stmt_vec_info_type value.
(vectorizable_type_demotion): New function declaration.
* tree-vect-generic.c (expand_vector_operations_1): Consider correct
mode.
* tree.def (VEC_PACK_MOD_EXPR, VEC_PACK_SAT_EXPR): New tree-codes.
* expr.c (expand_expr_real_1): Add case for VEC_PACK_MOD_EXPR and
VEC_PACK_SAT_EXPR.
* tree-iniline.c (estimate_num_insns_1): Likewise.
* tree-pretty-print.c (dump_generic_node, op_prio): Likewise.
* optabs.c (optab_for_tree_code): Likewise.
* optabs.c (expand_binop): In case of vec_pack_*_optabs the mode
compared against the predicate of the result is not 'mode' (the input
to the function) but a mode with half the size of 'mode'.
(init_optab): Initialize new optabs.
* optabs.h (OTI_vec_pack_mod, OTI_vec_pack_ssat, OTI_vec_pack_usat):
New optab indices.
(vec_pack_mod_optab, vec_pack_ssat_optab, vec_pack_usat_optab): New
optabs.
* genopinit.c (vec_pack_mod_optab, vec_pack_ssat_optab):
(vec_pack_usat_optab): Initialize new optabs.
* doc/md.texi (vec_pack_mod, vec_pack_ssat, vec_pack_usat): New.
* config/rs6000/altivec.md (vec_pack_mod_v8hi, vec_pack_mod_v4si): New.
2006-11-08 Richard Henderson <rth@redehat.com>
* config/i386/sse.md (vec_pack_mod_v8hi, vec_pack_mod_v4si):
(vec_pack_mod_v2di, vec_interleave_highv16qi, vec_interleave_lowv16qi):
(vec_interleave_highv8hi, vec_interleave_lowv8hi):
(vec_interleave_highv4si, vec_interleave_lowv4si):
(vec_interleave_highv2di, vec_interleave_lowv2di): New.
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-transform.c (vectorizable_reduction): Support multiple
datatypes.
(vect_transform_stmt): Removed redundant code.
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-transform.c (vectorizable_operation): Support multiple
datatypes.
2006-11-08 Dorit Nuzman <dorit@il.ibm.com>
* tree-vect-transform.c (vect_align_data_ref): Removed.
(vect_create_data_ref_ptr): Added additional argument - ptr_incr.
Updated function documentation. Return the increment stmt in ptr_incr.
(bump_vector_ptr): New function.
(vect_get_vec_def_for_stmt_copy): New function.
(vect_finish_stmt_generation): Create a stmt_info to newly created
vector stmts.
(vect_setup_realignment): Call vect_create_data_ref_ptr with additional
argument.
(vectorizable_reduction, vectorizable_assignment): Not supported yet if
VF is greater than the number of elements that can fit in one vector
word.
(vectorizable_operation, vectorizable_condition): Likewise.
(vectorizable_store, vectorizable_load): Support the case that the VF
is greater than the number of elements that can fit in one vector word.
(vect_transform_loop): Don't fail in case of multiple data-types.
* tree-vect-analyze.c (vect_determine_vectorization_factor): Don't fail
in case of multiple data-types; the smallest type determines the VF.
(vect_analyze_data_ref_dependence): Don't record datarefs as same_align
if they are of different sizes.
(vect_update_misalignment_for_peel): Compare misalignments in terms of
number of elements rather than number of bytes.
(vect_enhance_data_refs_alignment): Fix/Add dump printouts.
(vect_can_advance_ivs_p): Fix a dump printout
From-SVN: r118577
2006-11-08 08:32:44 +01:00
|
|
|
|
re PR tree-optimization/24659 (Conversions are not vectorized)
PR tree-optimization/24659
* optabs.h (enum optab_index): Add OTI_vec_unpacks_float_hi,
OTI_vec_unpacks_float_lo, OTI_vec_unpacku_float_hi,
OTI_vec_unpacku_float_lo, OTI_vec_pack_sfix_trunc and
OTI_vec_pack_ufix_trunc.
(vec_unpacks_float_hi_optab): Define new macro.
(vec_unpacks_float_lo_optab): Ditto.
(vec_unpacku_float_hi_optab): Ditto.
(vec_unpacku_float_lo_optab): Ditto.
(vec_pack_sfix_trunc_optab): Ditto.
(vec_pack_ufix_trunc_optab): Ditto.
* genopinit.c (optabs): Implement vec_unpack[s|u]_[hi|lo]_optab
and vec_pack_[s|u]fix_trunc_optab using
vec_unpack[s|u]_[hi\lo]_* and vec_pack_[u|s]fix_trunc_* patterns
* tree-vectorizer.c (supportable_widening_operation): Handle
FLOAT_EXPR and CONVERT_EXPR. Update comment.
(supportable_narrowing_operation): New function.
* tree-vectorizer.h (supportable_narrowing_operation): Prototype.
* tree-vect-transform.c (vectorizable_conversion): Handle
(nunits_in == nunits_out / 2) and (nunits_out == nunits_in / 2) cases.
(vect_gen_widened_results_half): Move before vectorizable_conversion.
(vectorizable_type_demotion): Call supportable_narrowing_operation()
to check for target support.
* optabs.c (optab_for_tree_code) Return vec_unpack[s|u]_float_hi_optab
for VEC_UNPACK_FLOAT_HI_EXPR, vec_unpack[s|u]_float_lo_optab
for VEC_UNPACK_FLOAT_LO_EXPR and vec_pack_[u|s]fix_trunc_optab
for VEC_PACK_FIX_TRUNC_EXPR.
(expand_binop): Special case mode of the result for
vec_pack_[u|s]fix_trunc_optab.
(init_optabs): Initialize vec_unpack[s|u]_[hi|lo]_optab and
vec_pack_[u|s]fix_trunc_optab.
* tree.def (VEC_UNPACK_FLOAT_HI_EXPR, VEC_UNPACK_FLOAT_LO_EXPR,
VEC_PACK_FIX_TRUNC_EXPR): New tree codes.
* tree-pretty-print.c (dump_generic_node): Handle
VEC_UNPACK_FLOAT_HI_EXPR, VEC_UNPACK_FLOAT_LO_EXPR and
VEC_PACK_FIX_TRUNC_EXPR.
(op_prio): Ditto.
* expr.c (expand_expr_real_1): Ditto.
* tree-inline.c (estimate_num_insns_1): Ditto.
* tree-vect-generic.c (expand_vector_operations_1): Ditto.
* config/i386/sse.md (vec_unpacks_float_hi_v8hi): New expander.
(vec_unpacks_float_lo_v8hi): Ditto.
(vec_unpacku_float_hi_v8hi): Ditto.
(vec_unpacku_float_lo_v8hi): Ditto.
(vec_unpacks_float_hi_v4si): Ditto.
(vec_unpacks_float_lo_v4si): Ditto.
(vec_pack_sfix_trunc_v2df): Ditto.
* doc/c-tree.texi (Expression trees) [VEC_UNPACK_FLOAT_HI_EXPR]:
Document.
[VEC_UNPACK_FLOAT_LO_EXPR]: Ditto.
[VEC_PACK_FIX_TRUNC_EXPR]: Ditto.
* doc/md.texi (Standard Names) [vec_pack_sfix_trunc]: Document.
[vec_pack_ufix_trunc]: Ditto.
[vec_unpacks_float_hi]: Ditto.
[vec_unpacks_float_lo]: Ditto.
[vec_unpacku_float_hi]: Ditto.
[vec_unpacku_float_lo]: Ditto.
testsuite/ChangeLog:
PR tree-optimization/24659
* gcc.dg/vect/vect-floatint-conversion-2.c: New test.
* gcc.dg/vect/vect-intfloat-conversion-1.c: Require vect_float,
not vect_int target.
* gcc.dg/vect/vect-intfloat-conversion-2.c: Require vect_float,
not vect_int target. Loop is vectorized for vect_intfloat_cvt
targets.
* gcc.dg/vect/vect-intfloat-conversion-3.c: New test.
* gcc.dg/vect/vect-intfloat-conversion-4a.c: New test.
* gcc.dg/vect/vect-intfloat-conversion-4b.c: New test.
From-SVN: r124784
2007-05-17 08:31:05 +02:00
|
|
|
@item VEC_PACK_FIX_TRUNC_EXPR
|
|
|
|
This node represents packing of elements of the two input vectors into the
|
|
|
|
output vector, where the values are converted from floating point
|
|
|
|
to fixed point. Input operands are vectors that contain the same number
|
|
|
|
of elements of a floating point type. The result is a vector that contains
|
|
|
|
twice as many elements of an integral type whose size is half as wide. The
|
|
|
|
elements of the two vectors are merged (concatenated) to form the output
|
|
|
|
vector.
|
|
|
|
|
c-tree.texi: Document new tree codes.
* doc/c-tree.texi: Document new tree codes.
* doc/md.texi: Document new optabs.
* tree-pretty-print.c (dump_generic_node): Handle print of new tree
codes.
* optabs.c (optab_for_tree_code, init_optabs): Handle new optabs.
* optabs.h (optab_index): Add new.
(vec_extract_even_optab, vec_extract_odd_optab,
vec_interleave_high_optab, vec_interleave_low_optab): New optabs.
* genopinit.c (vec_extract_even_optab, vec_extract_odd_optab,
vec_interleave_high_optab, vec_interleave_low_optab): Initialize
new optabs.
* expr.c (expand_expr_real_1): Add implementation for new tree codes.
* tree-vectorizer.c (new_stmt_vec_info): Initialize new fields.
* tree-vectorizer.h (stmt_vec_info): Add new fields for interleaving
along with macros for their access.
* tree-data-ref.h (first_location_in_loop, data_reference): Update
comment.
* tree-vect-analyze.c (toplev.h): Include.
(vect_determine_vectorization_factor): Fix indentation.
(vect_insert_into_interleaving_chain,
vect_update_interleaving_chain, vect_equal_offsets): New functions.
(vect_analyze_data_ref_dependence): Add argument for interleaving
check. Check for interleaving if it's true.
(vect_check_dependences): New function.
(vect_analyze_data_ref_dependences): Call vect_check_dependences for
every ddr. Call vect_analyze_data_ref_dependence with new argument.
(vect_update_misalignment_for_peel): Update for interleaving.
(vect_verify_datarefs_alignment): Check only first data-ref for
interleaving.
(vect_enhance_data_refs_alignment): Update for interleaving. Check
only first data-ref for interleaving.
(vect_analyze_data_ref_access): Check interleaving, update
interleaving data.
(vect_analyze_data_refs): Call compute_data_dependences_for_loop
with different parameters.
* tree.def (VEC_EXTRACT_EVEN_EXPR, VEC_EXTRACT_ODD_EXPR,
VEC_INTERLEAVE_HIGH_EXPR, VEC_INTERLEAVE_LOW_EXPR): New tree codes.
* tree-inline.c (estimate_num_insns_1): Add cases for new codes.
* tree-vect-transform.c (vect_create_addr_base_for_vector_ref):
Update step in case of interleaving.
(vect_strided_store_supported, vect_permute_store_chain): New
functions.
(vectorizable_store): Handle strided stores.
(vect_strided_load_supported, vect_permute_load_chain,
vect_transform_strided_load): New functions.
(vectorizable_load): Handle strided loads.
(vect_transform_stmt): Add argument. Handle strided stores. Check
that vectorized stmt exists for patterns.
(vect_gen_niters_for_prolog_loop): Update calculation for
interleaving.
(vect_transform_loop): Remove stmt_vec_info for strided stores after
whole chain vectorization.
* config/rs6000/altivec.md (UNSPEC_EXTEVEN, UNSPEC_EXTODD,
UNSPEC_INTERHI, UNSPEC_INTERLO): New constants.
(vpkuhum_nomode, vpkuwum_nomode, vec_extract_even<mode>,
vec_extract_odd<mode>, altivec_vmrghsf, altivec_vmrglsf,
vec_interleave_high<mode>, vec_interleave_low<mode>): Implement.
From-SVN: r119088
2006-11-22 09:46:03 +01:00
|
|
|
@item VEC_EXTRACT_EVEN_EXPR
|
|
|
|
@item VEC_EXTRACT_ODD_EXPR
|
|
|
|
These nodes represent extracting of the even/odd elements of the two input
|
|
|
|
vectors, respectively. Their operands and result are vectors that contain the
|
|
|
|
same number of elements of the same type.
|
|
|
|
|
|
|
|
@item VEC_INTERLEAVE_HIGH_EXPR
|
|
|
|
@item VEC_INTERLEAVE_LOW_EXPR
|
|
|
|
These nodes represent merging and interleaving of the high/low elements of the
|
|
|
|
two input vectors, respectively. The operands and the result are vectors that
|
|
|
|
contain the same number of elements (@code{N}) of the same type.
|
|
|
|
In the case of @code{VEC_INTERLEAVE_HIGH_EXPR}, the high @code{N/2} elements of
|
|
|
|
the first input vector are interleaved with the high @code{N/2} elements of the
|
|
|
|
second input vector. In the case of @code{VEC_INTERLEAVE_LOW_EXPR}, the low
|
|
|
|
@code{N/2} elements of the first input vector are interleaved with the low
|
|
|
|
@code{N/2} elements of the second input vector.
|
|
|
|
|
1999-09-19 17:50:40 +02:00
|
|
|
@end table
|