summaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2006-07-13 20:49:34 +0000
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2006-07-13 20:49:34 +0000
commite3a1de9d9729f3bcef93c1483bffa9b2e6c5b6cd (patch)
treedf24029698d70c331756451ec077b8551bb844f7 /gcc
parent538a21978e1d2487ecbc588e1339ee77de2ba1c5 (diff)
downloadgcc-e3a1de9d9729f3bcef93c1483bffa9b2e6c5b6cd.tar.gz
* cgraphunit.c (cgraph_varpool_analyze_pending_decls): Call align_variable.
* output.h (align_variable): Declare. * varasm.c (align_variable): Export. * value-prof.c (tree_value_profile_transformations): Recompute iterator when basic block changed. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@115421 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog9
-rw-r--r--gcc/cgraphunit.c4
-rw-r--r--gcc/output.h4
-rw-r--r--gcc/testsuite/ChangeLog4
-rw-r--r--gcc/testsuite/gcc.target/i386/memcpy-1.c16
-rw-r--r--gcc/value-prof.c6
-rw-r--r--gcc/varasm.c2
7 files changed, 43 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index dd490fa8a05..72167faf510 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,12 @@
+2006-07-13 Jan Hubicka <jh@suse.cz>
+
+ * cgraphunit.c (cgraph_varpool_analyze_pending_decls): Call
+ align_variable.
+ * output.h (align_variable): Declare.
+ * varasm.c (align_variable): Export.
+ * value-prof.c (tree_value_profile_transformations): Recompute iterator
+ when basic block changed.
+
2006-07-13 Nick Clifton <nickc@redhat.com>
* config/sh/sh.c (sh_reorg): Ignore deleted insns whilst
diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c
index 33028b2f331..d02ead5fcff 100644
--- a/gcc/cgraphunit.c
+++ b/gcc/cgraphunit.c
@@ -281,6 +281,10 @@ cgraph_varpool_analyze_pending_decls (void)
cgraph_varpool_first_unanalyzed_node = cgraph_varpool_first_unanalyzed_node->next_needed;
+ /* Compute the alignment early so function body expanders are
+ already informed about increased alignment. */
+ align_variable (decl, 0);
+
if (DECL_INITIAL (decl))
{
visited_nodes = pointer_set_create ();
diff --git a/gcc/output.h b/gcc/output.h
index 69f8378a0bc..6d518c45803 100644
--- a/gcc/output.h
+++ b/gcc/output.h
@@ -200,6 +200,10 @@ extern void assemble_end_function (tree, const char *);
initial value (that will be done by the caller). */
extern void assemble_variable (tree, int, int, int);
+/* Compute the alignment of variable specified by DECL.
+ DONT_OUTPUT_DATA is from assemble_variable. */
+extern void align_variable (tree decl, bool dont_output_data);
+
/* Output something to declare an external symbol to the assembler.
(Most assemblers don't need this, so we normally output nothing.)
Do nothing if DECL is not external. */
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 15484111c2d..b133204f32c 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,7 @@
+2006-07-13 Jan Hubicka <jh@suse.cz>
+
+ * gcc.target/i386/memcpy-1.c: New.
+
2006-07-12 Geoffrey Keating <geoffk@apple.com>
* g++.dg/ext/visibility/fvisibility-inlines-hidden-2.C: New.
diff --git a/gcc/testsuite/gcc.target/i386/memcpy-1.c b/gcc/testsuite/gcc.target/i386/memcpy-1.c
new file mode 100644
index 00000000000..edd0c7b49aa
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/memcpy-1.c
@@ -0,0 +1,16 @@
+/* { dg-do compile { target i?86-*-* } } */
+/* { dg-options "-O2 -march=pentiumpro -minline-all-stringops" } */
+/* { dg-final { scan-assembler "rep" } } */
+/* { dg-final { scan-assembler "movs" } } */
+/* { dg-final { scan-assembler-not "test" } } */
+/* { dg-final { scan-assembler "\.L?:" } } */
+
+/* A and B are aligned, but we used to lose track of it.
+ Ensure that memcpy is inlined and alignment prologue is missing. */
+
+char a[900];
+char b[900];
+t()
+{
+ __builtin_memcpy (a,b,900);
+}
diff --git a/gcc/value-prof.c b/gcc/value-prof.c
index 59b0f351530..e273a40f9c9 100644
--- a/gcc/value-prof.c
+++ b/gcc/value-prof.c
@@ -147,7 +147,11 @@ tree_value_profile_transformations (void)
{
changed = true;
/* Original statement may no longer be in the same block. */
- bb = bb_for_stmt (stmt);
+ if (bb != bb_for_stmt (stmt))
+ {
+ bb = bb_for_stmt (stmt);
+ bsi = bsi_for_stmt (stmt);
+ }
}
/* Free extra storage from compute_value_histograms. */
diff --git a/gcc/varasm.c b/gcc/varasm.c
index a10d954d0c6..9dcc3b442cf 100644
--- a/gcc/varasm.c
+++ b/gcc/varasm.c
@@ -834,7 +834,7 @@ bss_initializer_p (tree decl)
/* Compute the alignment of variable specified by DECL.
DONT_OUTPUT_DATA is from assemble_variable. */
-static void
+void
align_variable (tree decl, bool dont_output_data)
{
unsigned int align = DECL_ALIGN (decl);