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


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

[Bug c/35634] [4.1/4.2/4.3/4.4 Regression] operand of pre-/postin-/decrement not promoted



------- 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


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