Commit 1faab08d by Martin Jambor Committed by Martin Jambor

re PR middle-end/45644 (450.soplex in SPEC CPU 2006 is miscompiled)

2010-09-15  Martin Jambor  <mjambor@suse.cz>

	PR middle-end/45644
	* tree-sra.c (create_access): Check for bit-fields directly.

	* testsuite/gcc.dg/ipa/pr45644.c: New test.

From-SVN: r164313
parent cc99c5fe
2010-09-15 Martin Jambor <mjambor@suse.cz>
PR middle-end/45644
* tree-sra.c (create_access): Check for bit-fields directly.
2010-09-15 Jakub Jelinek <jakub@redhat.com> 2010-09-15 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/45633 PR tree-optimization/45633
......
2010-09-15 Martin Jambor <mjambor@suse.cz>
PR middle-end/45644
* gcc.dg/ipa/pr45644.c: New test.
2010-09-15 Jakub Jelinek <jakub@redhat.com> 2010-09-15 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/45633 PR tree-optimization/45633
......
/* Verify that we do not IPA-SRA bitfields. */
/* { dg-do run } */
/* { dg-options "-O2" } */
extern void abort (void);
struct S
{
int j : 8;
int i : 24;
int l;
};
static int __attribute__((noinline)) foo (struct S *s)
{
int z = s->i;
if (z != 777)
abort ();
return 0;
}
int __attribute__((noinline)) bar (struct S *s)
{
return foo (s);
}
int main (int argc, char *argv[])
{
struct S s;
s.j = 5;
s.i = 777;
s.l = -1;
return bar (&s);
}
...@@ -774,12 +774,13 @@ create_access (tree expr, gimple stmt, bool write) ...@@ -774,12 +774,13 @@ create_access (tree expr, gimple stmt, bool write)
disqualify_candidate (base, "Encountered a variable sized access."); disqualify_candidate (base, "Encountered a variable sized access.");
return NULL; return NULL;
} }
if ((offset % BITS_PER_UNIT) != 0 || (size % BITS_PER_UNIT) != 0) if (TREE_CODE (expr) == COMPONENT_REF
&& DECL_BIT_FIELD (TREE_OPERAND (expr, 1)))
{ {
disqualify_candidate (base, disqualify_candidate (base, "Encountered a bit-field access.");
"Encountered an acces not aligned to a byte.");
return NULL; return NULL;
} }
gcc_checking_assert ((offset % BITS_PER_UNIT) == 0);
if (ptr) if (ptr)
mark_parm_dereference (base, offset + size, stmt); mark_parm_dereference (base, offset + size, stmt);
......
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