public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] gentoo commit in src/patchsets/gcc/4.7.2/gentoo: 93_all_pr33763_4.7.3_extern-inline.patch 94_all_pr53708_4.7.3_user-alignment.patch README.history
@ 2012-11-05  4:10 Ryan Hill (dirtyepic)
  0 siblings, 0 replies; only message in thread
From: Ryan Hill (dirtyepic) @ 2012-11-05  4:10 UTC (permalink / raw
  To: gentoo-commits

dirtyepic    12/11/05 04:10:48

  Modified:             README.history
  Added:                93_all_pr33763_4.7.3_extern-inline.patch
                        94_all_pr53708_4.7.3_user-alignment.patch
  Log:
  Backport patches to ignore always_inline attribute on redefined extern inline functions (PR33763) and preserve user alignment on user defined sections (PR53708).

Revision  Changes    Path
1.5                  src/patchsets/gcc/4.7.2/gentoo/README.history

file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.7.2/gentoo/README.history?rev=1.5&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.7.2/gentoo/README.history?rev=1.5&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.7.2/gentoo/README.history?r1=1.4&r2=1.5

Index: README.history
===================================================================
RCS file: /var/cvsroot/gentoo/src/patchsets/gcc/4.7.2/gentoo/README.history,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- README.history	21 Oct 2012 17:55:17 -0000	1.4
+++ README.history	5 Nov 2012 04:10:48 -0000	1.5
@@ -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
 



1.1                  src/patchsets/gcc/4.7.2/gentoo/93_all_pr33763_4.7.3_extern-inline.patch

file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.7.2/gentoo/93_all_pr33763_4.7.3_extern-inline.patch?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.7.2/gentoo/93_all_pr33763_4.7.3_extern-inline.patch?rev=1.1&content-type=text/plain

Index: 93_all_pr33763_4.7.3_extern-inline.patch
===================================================================
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. */



1.1                  src/patchsets/gcc/4.7.2/gentoo/94_all_pr53708_4.7.3_user-alignment.patch

file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.7.2/gentoo/94_all_pr53708_4.7.3_user-alignment.patch?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.7.2/gentoo/94_all_pr53708_4.7.3_user-alignment.patch?rev=1.1&content-type=text/plain

Index: 94_all_pr53708_4.7.3_user-alignment.patch
===================================================================
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





^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2012-11-05  4:11 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-05  4:10 [gentoo-commits] gentoo commit in src/patchsets/gcc/4.7.2/gentoo: 93_all_pr33763_4.7.3_extern-inline.patch 94_all_pr53708_4.7.3_user-alignment.patch README.history Ryan Hill (dirtyepic)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox