From 64a686de340d611ef581268c43f77aa579d4232a Mon Sep 17 00:00:00 2001 From: Glen Nakamura Date: Fri, 21 Feb 2003 08:18:06 +0000 Subject: [PATCH] re PR rtl-optimization/8613 (-O2 optimization generates wrong code) PR optimization/8613 * builtins.c (expand_builtin): Emit postincrements before expanding builtin functions. From-SVN: r63211 --- gcc/ChangeLog | 6 ++++++ gcc/builtins.c | 3 +++ gcc/testsuite/ChangeLog | 4 ++++ 3 files changed, 13 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 13bcb1af571d..2eebd73d84d5 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2003-02-21 Glen Nakamura + + PR optimization/8613 + * builtins.c (expand_builtin): Emit postincrements before expanding + builtin functions. + 2003-02-20 Randolph Chung Eric Botcazou diff --git a/gcc/builtins.c b/gcc/builtins.c index d8874d6a1473..29dfa26e148c 100644 --- a/gcc/builtins.c +++ b/gcc/builtins.c @@ -3600,6 +3600,9 @@ expand_builtin (exp, target, subtarget, mode, ignore) tree arglist = TREE_OPERAND (exp, 1); enum built_in_function fcode = DECL_FUNCTION_CODE (fndecl); + /* Perform postincrements before expanding builtin functions.  */ + emit_queue (); + if (DECL_BUILT_IN_CLASS (fndecl) == BUILT_IN_MD) return (*targetm.expand_builtin) (exp, target, subtarget, mode, ignore); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index f82d3a37f650..0ddc4c38bf6b 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2003-02-21 Glen Nakamura + + * gcc.c-torture/execute/20030221-1.c: New test. + 2003-02-20 Randolph Chung * gcc.c-torture/compile/20030220-1.c: New test. -- 2.47.2