Commit 5657d966 by Marc Glisse Committed by Marc Glisse

re PR c++/57175 (NRVO and alignment)

2013-05-20  Marc Glisse  <marc.glisse@inria.fr>

	PR c++/57175
gcc/cp/
	* typeck.c (check_return_expr): Reverse the alignment comparison.

gcc/testsuite/
	* g++.dg/pr57175.C: New testcase.

From-SVN: r199093
parent e82a3870
2013-05-20 Marc Glisse <marc.glisse@inria.fr>
PR c++/57175
* typeck.c (check_return_expr): Reverse the alignment comparison.
2013-05-17 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/18126
......
......@@ -8369,7 +8369,7 @@ check_return_expr (tree retval, bool *no_warning)
&& DECL_CONTEXT (retval) == current_function_decl
&& ! TREE_STATIC (retval)
&& ! DECL_ANON_UNION_VAR_P (retval)
&& (DECL_ALIGN (retval) >= DECL_ALIGN (result))
&& (DECL_ALIGN (retval) <= DECL_ALIGN (result))
/* The cv-unqualified type of the returned value must be the
same as the cv-unqualified return type of the
function. */
......
2013-05-20 Marc Glisse <marc.glisse@inria.fr>
PR c++/57175
* g++.dg/pr57175.C: New testcase.
2013-05-17 Easwaran Raman <eraman@google.com>
* gcc.dg/tree-ssa/reassoc-28.c: New testcase.
......
/* { dg-do compile } */
/* { dg-options "-std=c++11" } */
extern "C" void do_not_remove ();
struct A
{
A () { }
A (A const&) { do_not_remove (); }
};
A
f ()
{
alignas (2 * alignof (A)) A x;
return x;
}
/* { dg-final { scan-assembler "do_not_remove" } } */
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