You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING. If not, write to the Free
-Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA. */
+Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301, USA. */
#include "config.h"
#include "system.h"
if (cond && !integer_nonzerop (cond))
{
t = build_bc_goto (bc_break);
- exit = build3 (COND_EXPR, void_type_node, cond, exit, t);
- exit = fold (exit);
+ exit = fold_build3 (COND_EXPR, void_type_node, cond, exit, t);
gimplify_stmt (&exit);
if (cond_is_first)
if (!IS_EMPTY_STMT (stmt)
&& !VOID_TYPE_P (TREE_TYPE (stmt))
&& !TREE_NO_WARNING (stmt))
- warning (0, "statement with no effect");
+ warning (OPT_Wextra, "statement with no effect");
}
else if (warn_unused_value)
warn_if_unused_value (stmt, input_location);
*expr_p = from;
/* The initialization is now a side-effect, so the container can
- become void. */
+ become void. */
if (from != sub)
TREE_TYPE (from) = void_type_node;
}
ret = GS_OK;
break;
+ /* We used to do this for MODIFY_EXPR as well, but that's unsafe; the
+ LHS of an assignment might also be involved in the RHS, as in bug
+ 25979. */
case INIT_EXPR:
- case MODIFY_EXPR:
cp_gimplify_init_expr (expr_p, pre_p, post_p);
ret = GS_OK;
break;
case EMPTY_CLASS_EXPR:
- /* We create an INTEGER_CST with RECORD_TYPE and value zero. */
- *expr_p = build_int_cst (TREE_TYPE (*expr_p), 0);
+ /* We create an empty CONSTRUCTOR with RECORD_TYPE. */
+ *expr_p = build_constructor (TREE_TYPE (*expr_p), NULL);
ret = GS_OK;
break;
tree stmt = *stmt_p;
struct pointer_set_t *p_set = (struct pointer_set_t*) data;
- if (is_invisiref_parm (stmt))
+ if (is_invisiref_parm (stmt)
+ /* Don't dereference parms in a thunk, pass the references through. */
+ && !(DECL_THUNK_P (current_function_decl)
+ && TREE_CODE (stmt) == PARM_DECL))
{
*stmt_p = convert_from_reference (stmt);
*walk_subtrees = 0;
CLEANUP_EXPR (stmt));
pointer_set_insert (p_set, *stmt_p);
-
+
return NULL;
}