Skip to content

Commit

Permalink
Avoid a segmentation fault when using -malign-int
Browse files Browse the repository at this point in the history
  • Loading branch information
th-otto committed Sep 4, 2023
1 parent 6c1c265 commit 4598322
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion gcc/expr.c
Expand Up @@ -4310,7 +4310,11 @@ emit_push_insn (rtx x, machine_mode mode, tree type, rtx size,
size = GEN_INT (GET_MODE_SIZE (mode));
if (!MEM_P (xinner))
{
temp = assign_temp (type, 1, 1);
tree atype = type;

if (atype == NULL)
atype = lang_hooks.types.type_for_mode (mode, 0);
temp = assign_temp (atype, 1, 1);
emit_move_insn (temp, xinner);
xinner = temp;
}
Expand Down

0 comments on commit 4598322

Please sign in to comment.