From a7b7e4a7981e56c8a7f015a6890a9bc70e77d277 Mon Sep 17 00:00:00 2001 From: CoprDistGit Date: Mon, 5 Aug 2024 01:49:16 +0000 Subject: automatic import of compat-libgfortran-48 --- gcc48-pr68680.patch | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 gcc48-pr68680.patch (limited to 'gcc48-pr68680.patch') diff --git a/gcc48-pr68680.patch b/gcc48-pr68680.patch new file mode 100644 index 0000000..59f6ffe --- /dev/null +++ b/gcc48-pr68680.patch @@ -0,0 +1,46 @@ +2015-12-04 Jakub Jelinek + + PR tree-optimization/68680 + * calls.c (special_function_p): Return ECF_MAY_BE_ALLOCA for + BUILT_IN_ALLOCA{,_WITH_ALIGN}. + + * gcc.target/i386/pr68680.c: New test. + +--- gcc/calls.c (revision 231278) ++++ gcc/calls.c (revision 231279) +@@ -564,6 +564,17 @@ special_function_p (const_tree fndecl, i + flags |= ECF_NORETURN; + } + ++ if (DECL_BUILT_IN_CLASS (fndecl) == BUILT_IN_NORMAL) ++ switch (DECL_FUNCTION_CODE (fndecl)) ++ { ++ case BUILT_IN_ALLOCA: ++ case BUILT_IN_ALLOCA_WITH_ALIGN: ++ flags |= ECF_MAY_BE_ALLOCA; ++ break; ++ default: ++ break; ++ } ++ + return flags; + } + +--- gcc/testsuite/gcc.target/i386/pr68680.c (revision 0) ++++ gcc/testsuite/gcc.target/i386/pr68680.c (revision 231279) +@@ -0,0 +1,15 @@ ++/* PR tree-optimization/68680 */ ++/* { dg-do compile } */ ++/* { dg-options "-O2 -fstack-protector-strong" } */ ++ ++int foo (char *); ++ ++int ++bar (unsigned long x) ++{ ++ char a[x]; ++ return foo (a); ++} ++ ++/* Verify that this function is stack protected. */ ++/* { dg-final { scan-assembler "stack_chk_fail" } } */ -- cgit v1.2.3