diff options
author | Ryan Hill <rhill@gentoo.org> | 2012-11-05 04:10:48 +0000 |
---|---|---|
committer | Ryan Hill <rhill@gentoo.org> | 2012-11-05 04:10:48 +0000 |
commit | 880bba4d08519f8e6d9a0c447609aa299a2dd6fb (patch) | |
tree | c6ec2c97bfb59ac263a11fc6d42dcc7a5fb5e9ef /4.7.2 | |
parent | fix from upstream for gfortran respecting sysroot settings #433435 by Andrew ... (diff) | |
download | gcc-patches-880bba4d08519f8e6d9a0c447609aa299a2dd6fb.tar.gz gcc-patches-880bba4d08519f8e6d9a0c447609aa299a2dd6fb.tar.bz2 gcc-patches-880bba4d08519f8e6d9a0c447609aa299a2dd6fb.zip |
Backport patches to ignore always_inline attribute on redefined extern inline functions (PR33763) and preserve user alignment on user defined sections (PR53708).
Diffstat (limited to '4.7.2')
-rw-r--r-- | 4.7.2/gentoo/93_all_pr33763_4.7.3_extern-inline.patch | 86 | ||||
-rw-r--r-- | 4.7.2/gentoo/94_all_pr53708_4.7.3_user-alignment.patch | 22 | ||||
-rw-r--r-- | 4.7.2/gentoo/README.history | 4 |
3 files changed, 112 insertions, 0 deletions
diff --git a/4.7.2/gentoo/93_all_pr33763_4.7.3_extern-inline.patch b/4.7.2/gentoo/93_all_pr33763_4.7.3_extern-inline.patch new file mode 100644 index 0000000..7d5b838 --- /dev/null +++ b/4.7.2/gentoo/93_all_pr33763_4.7.3_extern-inline.patch @@ -0,0 +1,86 @@ +Silently ignore always_inline attribute for redefined extern inline functions. + +https://bugs.gentoo.org/423945 + +http://gcc.gnu.org/PR33763 +http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=192121 + + +--- /dev/null ++++ b/gcc/testsuite/c-c++-common/pr33763.c +@@ -0,0 +1,60 @@ ++/* PR tree-optimization/33763 */ ++/* { dg-do compile } */ ++/* { dg-options "-O2" } */ ++ ++typedef struct ++{ ++ void *a; ++ void *b; ++} T; ++extern void *foo (const char *, const char *); ++extern void *bar (void *, const char *, T); ++extern int baz (const char *, int); ++ ++extern inline __attribute__ ((always_inline, gnu_inline)) int ++baz (const char *x, int y) ++{ ++ return 2; ++} ++ ++int ++baz (const char *x, int y) ++{ ++ return 1; ++} ++ ++int xa, xb; ++ ++static void * ++inl (const char *x, const char *y) ++{ ++ T t = { &xa, &xb }; ++ int *f = (int *) __builtin_malloc (sizeof (int)); ++ const char *z; ++ int o = 0; ++ void *r = 0; ++ ++ for (z = y; *z; z++) ++ { ++ if (*z == 'r') ++ o |= 1; ++ if (*z == 'w') ++ o |= 2; ++ } ++ if (o == 1) ++ *f = baz (x, 0); ++ if (o == 2) ++ *f = baz (x, 1); ++ if (o == 3) ++ *f = baz (x, 2); ++ ++ if (o && *f > 0) ++ r = bar (f, "w", t); ++ return r; ++} ++ ++void * ++foo (const char *x, const char *y) ++{ ++ return inl (x, y); ++} +--- a/gcc/tree-inline.c ++++ b/gcc/tree-inline.c +@@ -3836,6 +3836,12 @@ expand_call_inline (basic_block bb, gimple stmt, copy_body_data *id) + goto egress; + + if (lookup_attribute ("always_inline", DECL_ATTRIBUTES (fn)) ++ /* For extern inline functions that get redefined we always ++ silently ignored always_inline flag. Better behaviour would ++ be to be able to keep both bodies and use extern inline body ++ for inlining, but we can't do that because frontends overwrite ++ the body. */ ++ && !cg_edge->callee->local.redefined_extern_inline + /* Avoid warnings during early inline pass. */ + && cgraph_global_info_ready + /* PR 20090218-1_0.c. Body can be provided by another module. */ diff --git a/4.7.2/gentoo/94_all_pr53708_4.7.3_user-alignment.patch b/4.7.2/gentoo/94_all_pr53708_4.7.3_user-alignment.patch new file mode 100644 index 0000000..681c59b --- /dev/null +++ b/4.7.2/gentoo/94_all_pr53708_4.7.3_user-alignment.patch @@ -0,0 +1,22 @@ +Do not override explicit alignment on user-defined sections. + +http://gcc.gnu.org/PR53708 +http://gcc.gnu.org/viewcvs?view=revision&revision=193121 + + +--- a/gcc/tree-vect-data-refs.c ++++ b/gcc/tree-vect-data-refs.c +@@ -4574,6 +4574,13 @@ vect_can_force_dr_alignment_p (const_tree decl, unsigned int alignment) + if (TREE_ASM_WRITTEN (decl)) + return false; + ++ /* Do not override explicit alignment set by the user when an explicit ++ section name is also used. This is a common idiom used by many ++ software projects. */ ++ if (DECL_SECTION_NAME (decl) != NULL_TREE ++ && !DECL_HAS_IMPLICIT_SECTION_NAME_P (decl)) ++ return false; ++ + if (TREE_STATIC (decl)) + return (alignment <= MAX_OFILE_ALIGNMENT); + else diff --git a/4.7.2/gentoo/README.history b/4.7.2/gentoo/README.history index e8a45e8..8a42aef 100644 --- a/4.7.2/gentoo/README.history +++ b/4.7.2/gentoo/README.history @@ -1,3 +1,7 @@ +1.3 04 Nov 2012 + + 93_all_pr33763_4.7.3_extern-inline.patch + + 94_all_pr53708_4.7.3_user-alignment.patch + 1.2 21 Oct 2012 + 39_all_gfortran-sysroot-pr54725.patch |