diff options
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/expr.c | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/pr95052.c | 12 |
2 files changed, 17 insertions, 0 deletions
@@ -5779,6 +5779,11 @@ store_expr (tree exp, rtx target, int call_param_p, (call_param_p ? EXPAND_STACK_PARM : EXPAND_NORMAL), &alt_rtl, false); + if (shortened_string_cst) + { + gcc_assert (MEM_P (temp)); + temp = change_address (temp, BLKmode, NULL_RTX); + } } /* If TEMP is a VOIDmode constant and the mode of the type of EXP is not diff --git a/gcc/testsuite/gcc.dg/pr95052.c b/gcc/testsuite/gcc.dg/pr95052.c new file mode 100644 index 0000000..2ed1a03 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr95052.c @@ -0,0 +1,12 @@ +/* PR middle-end/95052 */ +/* { dg-do compile } */ +/* { dg-options "-O2 -fconserve-stack" } */ + +void bar (char *); + +void +foo (void) +{ + char buf[70] = ""; + bar (buf); +} |