Commit 819f3b2c by Paolo Bonzini Committed by Paolo Bonzini

re PR tree-optimization/53336 (invalid types in nop conversion)

gcc:
2012-05-16  Paolo Bonzini  <bonzini@gnu.org>

	PR tree-optimization/53336
	* tree-cfg.c (verify_gimple_assign_unary): Allow conversion from
	non-integer integral types to offset type and vice versa.

gcc/testsuite:
2012-05-16  Paolo Bonzini  <bonzini@gnu.org>

	PR tree-optimization/53336
	* g++.dg/torture/pr53336.C: New testcase.

From-SVN: r187759
parent 7caf4b0c
2012-05-22 Paolo Bonzini <bonzini@gnu.org>
PR tree-optimization/53336
* tree-cfg.c (verify_gimple_assign_unary): Allow conversion from
non-integer integral types to offset type and vice versa.
2012-05-22 Alan Modra <amodra@gmail.com> 2012-05-22 Alan Modra <amodra@gmail.com>
* config/rs6000/aix.h (FP_SAVE_INLINE, GP_SAVE_INLINE): Delete. * config/rs6000/aix.h (FP_SAVE_INLINE, GP_SAVE_INLINE): Delete.
......
2012-05-22 Paolo Bonzini <bonzini@gnu.org>
PR tree-optimization/53336
* g++.dg/torture/pr53336.C: New testcase.
2012-05-22 Dodji Seketeli <dodji@redhat.com> 2012-05-22 Dodji Seketeli <dodji@redhat.com>
PR c++/53322 PR c++/53322
......
// { dg-do compile }
bool foo();
struct C
{
C()
{
if (foo())
foo();
}
};
struct S
{
struct dummy
{
int i_;
};
typedef int dummy::*bool_type;
operator bool_type() const
{
return foo() ? &dummy::i_ : 0;
}
};
int x;
struct adaptor
{
C c;
virtual void bar()
{
if (S())
x = 0;
}
};
int main()
{
adaptor a;
}
...@@ -3373,11 +3373,11 @@ verify_gimple_assign_unary (gimple stmt) ...@@ -3373,11 +3373,11 @@ verify_gimple_assign_unary (gimple stmt)
|| ptrofftype_p (sizetype)))) || ptrofftype_p (sizetype))))
return false; return false;
/* Allow conversion from integer to offset type and vice versa. */ /* Allow conversion from integral to offset type and vice versa. */
if ((TREE_CODE (lhs_type) == OFFSET_TYPE if ((TREE_CODE (lhs_type) == OFFSET_TYPE
&& TREE_CODE (rhs1_type) == INTEGER_TYPE) && INTEGRAL_TYPE_P (rhs1_type))
|| (TREE_CODE (lhs_type) == INTEGER_TYPE || (TREE_CODE (lhs_type) == INTEGER_TYPE
&& TREE_CODE (rhs1_type) == OFFSET_TYPE)) && INTEGRAL_TYPE_P (rhs1_type)))
return false; return false;
/* Otherwise assert we are converting between types of the /* Otherwise assert we are converting between types of the
......
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