Commit 79077aea by Jakub Jelinek Committed by Jakub Jelinek

re PR c/30762 (IMA messes up with inlining)

	PR c/30762
	* c-typeck.c (convert_for_assignment): Call comptypes for
	RECORD_TYPE or UNION_TYPE.

	* gcc.dg/pr30762-1.c: New test.
	* gcc.dg/pr30762-2.c: New test.

From-SVN: r123073
parent 5d8a5434
2007-03-20 Jakub Jelinek <jakub@redhat.com> 2007-03-20 Jakub Jelinek <jakub@redhat.com>
PR c/30762
* c-typeck.c (convert_for_assignment): Call comptypes for
RECORD_TYPE or UNION_TYPE.
PR inline-asm/30505 PR inline-asm/30505
* reload1.c (reload): Do invalid ASM checking after * reload1.c (reload): Do invalid ASM checking after
cleanup_subreg_operands. cleanup_subreg_operands.
......
...@@ -3896,10 +3896,16 @@ convert_for_assignment (tree type, tree rhs, enum impl_conv errtype, ...@@ -3896,10 +3896,16 @@ convert_for_assignment (tree type, tree rhs, enum impl_conv errtype,
|| coder == BOOLEAN_TYPE)) || coder == BOOLEAN_TYPE))
return convert_and_check (type, rhs); return convert_and_check (type, rhs);
/* Aggregates in different TUs might need conversion. */
if ((codel == RECORD_TYPE || codel == UNION_TYPE)
&& codel == coder
&& comptypes (type, rhstype))
return convert_and_check (type, rhs);
/* Conversion to a transparent union from its member types. /* Conversion to a transparent union from its member types.
This applies only to function arguments. */ This applies only to function arguments. */
else if (codel == UNION_TYPE && TYPE_TRANSPARENT_UNION (type) if (codel == UNION_TYPE && TYPE_TRANSPARENT_UNION (type)
&& (errtype == ic_argpass || errtype == ic_argpass_nonproto)) && (errtype == ic_argpass || errtype == ic_argpass_nonproto))
{ {
tree memb, marginal_memb = NULL_TREE; tree memb, marginal_memb = NULL_TREE;
......
2007-03-20 Jakub Jelinek <jakub@redhat.com> 2007-03-20 Jakub Jelinek <jakub@redhat.com>
PR c/30762
* gcc.dg/pr30762-1.c: New test.
* gcc.dg/pr30762-2.c: New test.
PR inline-asm/30505 PR inline-asm/30505
* gcc.target/i386/pr30505.c: New test. * gcc.target/i386/pr30505.c: New test.
/* PR c/30762 */
/* { dg-do compile } */
/* { dg-options "--combine -O3" } */
/* { dg-additional-sources pr30762-2.c } */
typedef struct { int i; } D;
extern void foo (D);
void
bar (void)
{
D d;
d.i = 1;
foo (d);
}
/* PR c/30762 */
/* { dg-do compile } */
typedef struct { int i; } D;
void
foo (D x)
{
}
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