This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[Testcases,committed] [Was Re: C++ PATCH: PR 11852]
- From: Andrew Pinski <pinskia at physics dot uc dot edu>
- To: mark at codesourcery dot com
- Cc: Andrew Pinski <pinskia at physics dot uc dot edu>, gcc-patches at gcc dot gnu dot org
- Date: Sun, 7 Sep 2003 20:07:20 -0700
- Subject: [Testcases,committed] [Was Re: C++ PATCH: PR 11852]
On Sunday, Sep 7, 2003, at 16:46 US/Pacific, Mark Mitchell wrote:
This PR demonstrated the presence of totally bogus code in
initializer_constant_valid_p; for a CONSTRUCTOR, only the last element
of the CONSTRUCTOR was being checked.
Bootstrapped and tested on i686-pc-linux-gnu, applied on the mainline
and on the branch.
--
Mark Mitchell
CodeSourcery, LLC
mark@codesourcery.com
2003-09-07 Mark Mitchell <mark@codesourcery.com>
PR c++/11852
* varasm.c (initializer_constant_valid_p): Correct logic for
CONSTRUCTORs.
2003-09-07 Mark Mitchell <mark@codesourcery.com>
PR c++/11852
* g++.dg/init/struct1.C: New test.
This patch also fixes PR middle-end/11665 so I committed the testcases
for them on both the mainline and the 3.3 branch:
ChangeLog:
2003-09-07 Andrew Pinski <pinskia@physics.uc.edu>
PR middle-end/11665
* gcc.c-torture/compile/20030907-1.c: New test.
* g++.dg/init/array11.C: New test.
gcc.c-torture/compile/20030907-1.c, g++.dg/init/array11.C
(yes they are both the same, but it should run though both front-ends):
/* PR 11665
Orgin: jwhite@cse.unl.edu
The problem was in initializer_constant_valid_p,
"for a CONSTRUCTOR, only the last element
of the CONSTRUCTOR was being checked"
(from the email of the patch which fixed this).
This used to ICE because GCC thought gdt_table was a
constant value when it is not. */
int x;
struct gdt
{
unsigned a,b,c,d,e,f;
};
void f()
{
struct gdt gdt_table[2]=
{
{
0,
( (((unsigned)(&x))<<(24))&(-1<<(8)) ),
},
};
}