Commit e8112eac by Zak Kipling Committed by Richard Henderson

re PR target/18300 (Infinite loop when passing object with 3+ base classes by value)

        PR target/18300
        * config/i386/i386.c (classify_argument): Fix infinite loop when
        passing object with 3 or more base classes by value.

From-SVN: r90600
parent 595163db
2004-11-13 Zak Kipling <zak@transversal.com>
PR target/18300
* config/i386/i386.c (classify_argument): Fix infinite loop when
passing object with 3 or more base classes by value.
2004-11-13 Eric Botcazou <ebotcazou@libertysurf.fr> 2004-11-13 Eric Botcazou <ebotcazou@libertysurf.fr>
* doc/md.texi (constraints) <% modifier>: Mention that it is * doc/md.texi (constraints) <% modifier>: Mention that it is
...@@ -79,7 +85,7 @@ ...@@ -79,7 +85,7 @@
* doc/rtl.texi (INSN_DEAD_CODE_P, REG_LOOP_TEST_P): Remove. * doc/rtl.texi (INSN_DEAD_CODE_P, REG_LOOP_TEST_P): Remove.
2004-11-13 James A. Morrison <phython@gcc.gnu.org> 2004-11-13 James A. Morrison <phython@gcc.gnu.org>
Eric Botcazou <ebotcazou@libertysurf.fr> Eric Botcazou <ebotcazou@libertysurf.fr>
PR target/18230 PR target/18230
* config/sparc/sparc.c (sparc_rtx_costs): Handle the NAND vector * config/sparc/sparc.c (sparc_rtx_costs): Handle the NAND vector
......
...@@ -2117,10 +2117,10 @@ classify_argument (enum machine_mode mode, tree type, ...@@ -2117,10 +2117,10 @@ classify_argument (enum machine_mode mode, tree type,
if (TYPE_BINFO (type)) if (TYPE_BINFO (type))
{ {
tree binfo, base_binfo; tree binfo, base_binfo;
int i; int basenum;
for (binfo = TYPE_BINFO (type), i = 0; for (binfo = TYPE_BINFO (type), basenum = 0;
BINFO_BASE_ITERATE (binfo, i, base_binfo); i++) BINFO_BASE_ITERATE (binfo, basenum, base_binfo); basenum++)
{ {
int num; int num;
int offset = tree_low_cst (BINFO_OFFSET (base_binfo), 0) * 8; int offset = tree_low_cst (BINFO_OFFSET (base_binfo), 0) * 8;
...@@ -2204,10 +2204,10 @@ classify_argument (enum machine_mode mode, tree type, ...@@ -2204,10 +2204,10 @@ classify_argument (enum machine_mode mode, tree type,
if (TYPE_BINFO (type)) if (TYPE_BINFO (type))
{ {
tree binfo, base_binfo; tree binfo, base_binfo;
int i; int basenum;
for (binfo = TYPE_BINFO (type), i = 0; for (binfo = TYPE_BINFO (type), basenum = 0;
BINFO_BASE_ITERATE (binfo, i, base_binfo); i++) BINFO_BASE_ITERATE (binfo, basenum, base_binfo); basenum++)
{ {
int num; int num;
int offset = tree_low_cst (BINFO_OFFSET (base_binfo), 0) * 8; int offset = tree_low_cst (BINFO_OFFSET (base_binfo), 0) * 8;
......
// PR 18300: This sends old compilers into an infinite loop on x86_64
// Testcase and patch contributed by Zak Kipling <zak@transversal.com>
struct base1 { };
struct base2 { };
struct base3 { };
struct derived : base1, base2, base3 { };
void foo(derived);
int main()
{
foo(derived());
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment