From: jamborm Date: Fri, 23 Apr 2010 14:43:10 +0000 (+0000) Subject: 2010-04-23 Martin Jambor X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8cef76a0a12225b2f4b8787b16c68f571745766c;p=thirdparty%2Fgcc.git 2010-04-23 Martin Jambor PR middle-end/43835 * tree-sra.c (ipa_sra_preliminary_function_checks): Check that the function does not have type attributes. * testsuite/gcc.c-torture/execute/pr43835.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@158667 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d81d2eb6b519..1d454224c959 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2010-04-23 Martin Jambor + + PR middle-end/43835 + * tree-sra.c (ipa_sra_preliminary_function_checks): Check that the + function does not have type attributes. + 2010-04-23 Richard Guenther PR lto/42653 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 5dfed4086094..555813437019 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2010-04-23 Martin Jambor + + PR middle-end/43835 + * gcc.c-torture/execute/pr43835.c: New test. + 2010-04-23 Richard Guenther PR lto/42653 diff --git a/gcc/testsuite/gcc.c-torture/execute/pr43835.c b/gcc/testsuite/gcc.c-torture/execute/pr43835.c new file mode 100644 index 000000000000..97237f625388 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/pr43835.c @@ -0,0 +1,51 @@ +struct PMC { + unsigned flags; +}; + +typedef struct Pcc_cell +{ + struct PMC *p; + long bla; + long type; +} Pcc_cell; + +extern void abort (); +extern void Parrot_gc_mark_PMC_alive_fun(int * interp, struct PMC *pmc) + __attribute__((noinline)); + +void Parrot_gc_mark_PMC_alive_fun (int * interp, struct PMC *pmc) +{ + abort (); +} + +static void mark_cell(int * interp, Pcc_cell *c) + __attribute__((__nonnull__(1))) + __attribute__((__nonnull__(2))) + __attribute__((noinline)); + +static void +mark_cell(int * interp, Pcc_cell *c) +{ + if (c->type == 4 && c->p + && !(c->p->flags & (1<<18))) + Parrot_gc_mark_PMC_alive_fun(interp, c->p); +} + +void foo(int * interp, Pcc_cell *c); + +void +foo(int * interp, Pcc_cell *c) +{ + mark_cell(interp, c); +} + +int main() +{ + int i; + Pcc_cell c; + c.p = 0; + c.bla = 42; + c.type = 4; + foo (&i, &c); + return 0; +} diff --git a/gcc/tree-sra.c b/gcc/tree-sra.c index 0635aa7f4a81..b31820186ab4 100644 --- a/gcc/tree-sra.c +++ b/gcc/tree-sra.c @@ -4162,6 +4162,9 @@ ipa_sra_preliminary_function_checks (struct cgraph_node *node) return false; } + if (TYPE_ATTRIBUTES (TREE_TYPE (node->decl))) + return false; + return true; }