diff options
author | CoprDistGit <infra@openeuler.org> | 2024-08-01 14:23:42 +0000 |
---|---|---|
committer | CoprDistGit <infra@openeuler.org> | 2024-08-01 14:23:42 +0000 |
commit | 82711f6567ef069eebb942e382e2c3fa61fbf538 (patch) | |
tree | 22200b7326b32ca672ffb6e4ce6d19a09dc476e5 /gcc48-pr68680.patch | |
parent | 5d624aa0d36abe76a344f0593eae5cf36d083b15 (diff) |
automatic import of compat-libgfortran-48openeuler24.03_LTSopeneuler23.09
Diffstat (limited to 'gcc48-pr68680.patch')
-rw-r--r-- | gcc48-pr68680.patch | 46 |
1 files changed, 46 insertions, 0 deletions
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 <jakub@redhat.com> + + 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" } } */ |