This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/35634] [4.1/4.2/4.3/4.4 Regression] operand of pre-/postin-/decrement not promoted
- From: "rguenth at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 20 Mar 2008 17:56:01 -0000
- Subject: [Bug c/35634] [4.1/4.2/4.3/4.4 Regression] operand of pre-/postin-/decrement not promoted
- References: <bug-35634-6291@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #9 from rguenth at gcc dot gnu dot org 2008-03-20 17:56 -------
I did a quick scan and Ada, C++ and C ever build these operations. Also a few
backends do (mips, rs6000 and s390). So IMHO changing the semantics of
these to
/* Nodes for ++ and -- in C.
The second arg is how much to increment or decrement by.
For a pointer, it would be the size of the object pointed to.
The type of the expression specifies the type the increment
is performed on and the type of the result. This type does not
need to match the type of the first argument, instead that is
properly size-/zero-extended before the arithmetic operation. */
DEFTREECODE (PREDECREMENT_EXPR, "predecrement_expr", tcc_expression, 2)
DEFTREECODE (PREINCREMENT_EXPR, "preincrement_expr", tcc_expression, 2)
DEFTREECODE (POSTDECREMENT_EXPR, "postdecrement_expr", tcc_expression, 2)
DEFTREECODE (POSTINCREMENT_EXPR, "postincrement_expr", tcc_expression, 2)
is reasonable. Note that expansion no longer handles these tree codes,
they are expected to only survive until gimplification.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35634