re PR middle-end/90194 (ICE in expand_debug_expr, at cfgexpand.c:5244)

2019-04-25  Richard Biener  <rguenther@suse.de>

	PR middle-end/90194
	* match.pd: Add pattern to simplify view-conversion of an
	empty constructor.

	* g++.dg/torture/pr90194.C: New testcase.

From-SVN: r270569
This commit is contained in:
Richard Biener 2019-04-25 11:15:35 +00:00 committed by Richard Biener
parent 9168f22057
commit f469220df6
4 changed files with 36 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2019-04-25 Richard Biener <rguenther@suse.de>
PR middle-end/90194
* match.pd: Add pattern to simplify view-conversion of an
empty constructor.
2019-04-24 Clement Chigot <clement.chigot@atos.net>
* config/rs6000/aix71.h (SUBTARGET_OVERRIDE_OPTIONS): Disable

View File

@ -2596,6 +2596,13 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
&& TYPE_UNSIGNED (TREE_TYPE (@1)))))
(view_convert @1)))
/* Simplify a view-converted empty constructor. */
(simplify
(view_convert CONSTRUCTOR@0)
(if (TREE_CODE (@0) != SSA_NAME
&& CONSTRUCTOR_NELTS (@0) == 0)
{ build_zero_cst (type); }))
/* Re-association barriers around constants and other re-association
barriers can be removed. */
(simplify

View File

@ -1,3 +1,8 @@
2019-04-25 Richard Biener <rguenther@suse.de>
PR middle-end/90194
* g++.dg/torture/pr90194.C: New testcase.
2019-04-24 Marek Polacek <polacek@redhat.com>
PR c++/90236

View File

@ -0,0 +1,18 @@
// { dg-do compile }
// { dg-additional-options "-g" }
struct cb {
int yr;
};
void *
operator new (__SIZE_TYPE__, void *nq)
{
return nq;
}
void
af (int xn)
{
new (&xn) cb { };
}