This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Fix PR c++/17368, asm expressions have cleanup
- From: Andrew Pinski <pinskia at physics dot uc dot edu>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 5 Oct 2004 10:09:52 -0400
- Subject: [PATCH] Fix PR c++/17368, asm expressions have cleanup
Looks like someone forgot that asm expressions can have cleanup as
you have sub expressions which needs cleanup. This patch fixes the
PR and fixes the problem.
OK? Bootstrapped and tested on powerpc-darwin with no regressions.
Thanks,
Andrew Pinski
Testcase:
struct A
{
~A();
};
int foo(A);
void bar()
{
A a;
asm("" : : "r"(foo(a)) );//<-- cleanup needed here.
};
ChangeLog:
* semantics.c (finish_asm_stmt): Asm expressions need cleanup
also.
Index: semantics.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/semantics.c,v
retrieving revision 1.441
diff -u -p -r1.441 semantics.c
--- semantics.c 1 Oct 2004 15:11:21 -0000 1.441
+++ semantics.c 5 Oct 2004 14:06:57 -0000
@@ -1178,6 +1178,7 @@ finish_asm_stmt (int volatile_p, tree st
output_operands, input_operands,
clobbers);
ASM_VOLATILE_P (r) = volatile_p;
+ r = maybe_cleanup_point_expr (r);
return add_stmt (r);
}