From f6721a1de39a98552f73a661ea339597c548d25d Mon Sep 17 00:00:00 2001 From: Uros Bizjak Date: Wed, 31 Mar 2010 22:14:10 +0200 Subject: [PATCH] backport: re PR tree-optimization/43528 (ICE: in tree_low_cst, at tree.c:6198 with -mms-bitfields at x86_64-linux) Backport from mainline: 2010-03-27 Uros Bizjak PR tree-optimization/43528 * stor-layout.c (place_field): Check that constant fits into unsigned HWI when skipping calculation of MS bitfield layout. 2010-03-26 Uros Bizjak PR target/43524 * config/i386/i386.c (ix86_expand_prologue) [TARGET_STACK_PROBE]: Remove invalid assert and wrong comment. testsuite/ChangeLog: Backport from mainline: 2010-03-27 Uros Bizjak PR tree-optimization/43528 * gcc.target/i386/pr43528.c: New test. 2010-03-26 Uros Bizjak PR target/43524 * gcc.target/i386/pr43524.c: New test. From-SVN: r157894 --- gcc/ChangeLog | 15 +++++++++++++++ gcc/config/i386/i386.c | 3 --- gcc/stor-layout.c | 9 +++++---- gcc/testsuite/ChangeLog | 17 +++++++++++++++-- gcc/testsuite/gcc.target/i386/pr43524.c | 9 +++++++++ gcc/testsuite/gcc.target/i386/pr43528.c | 5 +++++ 6 files changed, 49 insertions(+), 9 deletions(-) create mode 100644 gcc/testsuite/gcc.target/i386/pr43524.c create mode 100644 gcc/testsuite/gcc.target/i386/pr43528.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c68f8bf1983a..b23577921bf9 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,18 @@ +2010-03-31 Uros Bizjak + + Backport from mainline: + 2010-03-27 Uros Bizjak + + PR tree-optimization/43528 + * stor-layout.c (place_field): Check that constant fits into + unsigned HWI when skipping calculation of MS bitfield layout. + + 2010-03-26 Uros Bizjak + + PR target/43524 + * config/i386/i386.c (ix86_expand_prologue) [TARGET_STACK_PROBE]: + Remove invalid assert and wrong comment. + 2010-03-30 Andreas Krebbel * config/s390/s390.c (s390_emit_prologue): Omit issuing a dynamic diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 25336d95c901..fdabc1e9d504 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -6393,13 +6393,10 @@ ix86_expand_prologue (void) GEN_INT (-allocate), -1); else { - /* Only valid for Win32. */ rtx eax = gen_rtx_REG (Pmode, AX_REG); bool eax_live; rtx t; - gcc_assert (!TARGET_64BIT || TARGET_64BIT_MS_ABI); - if (TARGET_64BIT_MS_ABI) eax_live = false; else diff --git a/gcc/stor-layout.c b/gcc/stor-layout.c index 1ae2db5ca002..8e988f6e1846 100644 --- a/gcc/stor-layout.c +++ b/gcc/stor-layout.c @@ -1117,11 +1117,12 @@ place_field (record_layout_info rli, tree field) until we see a bitfield (and come by here again) we just skip calculating it. */ if (DECL_SIZE (field) != NULL - && host_integerp (TYPE_SIZE (TREE_TYPE (field)), 0) - && host_integerp (DECL_SIZE (field), 0)) + && host_integerp (TYPE_SIZE (TREE_TYPE (field)), 1) + && host_integerp (DECL_SIZE (field), 1)) { - HOST_WIDE_INT bitsize = tree_low_cst (DECL_SIZE (field), 1); - HOST_WIDE_INT typesize + unsigned HOST_WIDE_INT bitsize + = tree_low_cst (DECL_SIZE (field), 1); + unsigned HOST_WIDE_INT typesize = tree_low_cst (TYPE_SIZE (TREE_TYPE (field)), 1); if (typesize < bitsize) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 124ff8367577..38a3234ebf34 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,16 @@ +2010-03-31 Uros Bizjak + + Backport from mainline: + 2010-03-27 Uros Bizjak + + PR tree-optimization/43528 + * gcc.target/i386/pr43528.c: New test. + + 2010-03-26 Uros Bizjak + + PR target/43524 + * gcc.target/i386/pr43524.c: New test. + 2010-03-30 Andreas Krebbel * gcc.target/s390/stackcheck1.c: New testcase. @@ -41,7 +54,7 @@ Backport: 2009-10-15 Kaveh R. Ghazi * lib/target-supports.exp (add_options_for_bind_pic_locally): New. - + 2009-10-16 Kaveh R. Ghazi * g++.dg/other/first-global.C: Use dg-add-options bind_pic_locally. * g++.dg/parse/attr-externally-visible-1.C: Likewise. @@ -64,7 +77,7 @@ * gfortran.dg/namelist_59.f90: New test. * gcc/testsuite/gfortran.dg/namelist_47.f90: Update test. * gcc/testsuite/gfortran.dg/namelist_40.f90: Update test. - + 2010-02-04 Richard Guenther PR rtl-optimization/42952 diff --git a/gcc/testsuite/gcc.target/i386/pr43524.c b/gcc/testsuite/gcc.target/i386/pr43524.c new file mode 100644 index 000000000000..b2662702ac8d --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr43524.c @@ -0,0 +1,9 @@ +/* { dg-do compile } */ +/* { dg-options "-mstack-arg-probe" } */ + +extern void bar (void); + +void foo (int i) +{ + bar (); +} diff --git a/gcc/testsuite/gcc.target/i386/pr43528.c b/gcc/testsuite/gcc.target/i386/pr43528.c new file mode 100644 index 000000000000..f33d96b195cd --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr43528.c @@ -0,0 +1,5 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target lp64 } */ +/* { dg-options "-mms-bitfields" } */ + +struct S { int i[(1LL << 60) - 1]; }; -- 2.47.2