aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.4.3/gcc/config
diff options
context:
space:
mode:
authorDoug Kwan <dougkwan@google.com>2011-02-14 12:37:51 -0800
committerDoug Kwan <dougkwan@google.com>2011-02-14 12:37:51 -0800
commit80934e7f7db429984fb56756a4cc893ba412b7b5 (patch)
treed650e0601d3499f50a6e01a7f443bf6e6959cc9b /gcc-4.4.3/gcc/config
parent4a66e756636cb8364582ea503abd10d76f5b4aa3 (diff)
downloadtoolchain_gcc-80934e7f7db429984fb56756a4cc893ba412b7b5.tar.gz
toolchain_gcc-80934e7f7db429984fb56756a4cc893ba412b7b5.tar.bz2
toolchain_gcc-80934e7f7db429984fb56756a4cc893ba412b7b5.zip
Synchronize internal and external version. Merge the following patches:
-Added a more helpful error message when the profile is corrupted. -Added check for abnormal ssa names in the analysis phase of the vectorizer so that it prevents a potential ICE. -Replace floating-point calculations with fixed-point calculations when computing inlining priority to eliminate floating-point non-determinism on 32-bit x86. -Use .init_array/.fini_array sections instead of .ctor/.dtor when configured with --enable-initfini-array. Change-Id: I32f22dae5bcd4d229be321ee10dfeaa11a04cbac
Diffstat (limited to 'gcc-4.4.3/gcc/config')
-rw-r--r--gcc-4.4.3/gcc/config/avr/avr.c3
-rw-r--r--gcc-4.4.3/gcc/config/initfini-array.c78
-rw-r--r--gcc-4.4.3/gcc/config/initfini-array.h46
-rw-r--r--gcc-4.4.3/gcc/config/rs6000/rs6000.c4
-rw-r--r--gcc-4.4.3/gcc/config/stormy16/stormy16.c4
-rw-r--r--gcc-4.4.3/gcc/config/t-initfini-array23
-rw-r--r--gcc-4.4.3/gcc/config/v850/v850.c4
7 files changed, 162 insertions, 0 deletions
diff --git a/gcc-4.4.3/gcc/config/avr/avr.c b/gcc-4.4.3/gcc/config/avr/avr.c
index 79607c3d9..442613dd1 100644
--- a/gcc-4.4.3/gcc/config/avr/avr.c
+++ b/gcc-4.4.3/gcc/config/avr/avr.c
@@ -4915,6 +4915,9 @@ avr_asm_init_sections (void)
avr_output_progmem_section_asm_op,
NULL);
readonly_data_section = data_section;
+#ifdef NO_CTORS_DTORS_SECTIONS
+ elf_initfini_array_init_sections ();
+#endif
}
static unsigned int
diff --git a/gcc-4.4.3/gcc/config/initfini-array.c b/gcc-4.4.3/gcc/config/initfini-array.c
new file mode 100644
index 000000000..3a10365b4
--- /dev/null
+++ b/gcc-4.4.3/gcc/config/initfini-array.c
@@ -0,0 +1,78 @@
+/* Definitions for ELF systems with .init_array/.fini_array section
+ Copyright (C) 2010
+ Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 3, or (at your option) any later
+version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING3. If not see
+<http://www.gnu.org/licenses/>. */
+
+#include "config.h"
+#include "system.h"
+#include "coretypes.h"
+#include "output.h"
+#include "tree.h"
+#include "ggc.h"
+
+static GTY(()) section *init_array_section;
+static GTY(()) section *fini_array_section;
+
+void
+elf_initfini_array_init_sections (void)
+{
+ init_array_section = get_unnamed_section (0, output_section_asm_op,
+ "\t.section\t.init_array");
+ fini_array_section = get_unnamed_section (0, output_section_asm_op,
+ "\t.section\t.fini_array");
+}
+
+static section *
+get_elf_initfini_array_priority_section (int priority,
+ bool constructor_p)
+{
+ section *sec;
+ if (priority != DEFAULT_INIT_PRIORITY)
+ {
+ char buf[18];
+ sprintf (buf, "%s.%.5u",
+ constructor_p ? ".init_array" : ".fini_array",
+ priority);
+ sec = get_section (buf, SECTION_WRITE, NULL_TREE);
+ }
+ else
+ sec = constructor_p ? init_array_section : fini_array_section;
+ return sec;
+}
+
+/* Use .init_array section for constructors. */
+
+void
+elf_init_array_asm_out_constructor (rtx symbol, int priority)
+{
+ section *sec = get_elf_initfini_array_priority_section (priority,
+ true);
+ assemble_addr_to_section (symbol, sec);
+}
+
+/* Use .fini_array section for destructors. */
+
+void
+elf_fini_array_asm_out_destructor (rtx symbol, int priority)
+{
+ section *sec = get_elf_initfini_array_priority_section (priority,
+ false);
+ assemble_addr_to_section (symbol, sec);
+}
+
+#include "gt-initfini-array.h"
diff --git a/gcc-4.4.3/gcc/config/initfini-array.h b/gcc-4.4.3/gcc/config/initfini-array.h
new file mode 100644
index 000000000..b0b422a8a
--- /dev/null
+++ b/gcc-4.4.3/gcc/config/initfini-array.h
@@ -0,0 +1,46 @@
+/* Definitions for ELF systems with .init_array/.fini_array section
+ support.
+ Copyright (C) 2010
+ Free Software Foundation, Inc.
+
+ This file is part of GCC.
+
+ GCC is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published
+ by the Free Software Foundation; either version 3, or (at your
+ option) any later version.
+
+ GCC is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
+ License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with GCC; see the file COPYING3. If not see
+ <http://www.gnu.org/licenses/>. */
+
+/* No need for .ctors/.dtors section since linker can place them in
+ .init_array/.fini_array section. */
+#define NO_CTORS_DTORS_SECTIONS
+
+#undef INIT_SECTION_ASM_OP
+#undef FINI_SECTION_ASM_OP
+
+/* FIXME: INIT_ARRAY_SECTION_ASM_OP and FINI_ARRAY_SECTION_ASM_OP
+ aren't used in any assembly codes. But we have to define
+ them to something. */
+#define INIT_ARRAY_SECTION_ASM_OP Something
+#define FINI_ARRAY_SECTION_ASM_OP Something
+
+#ifndef TARGET_ASM_INIT_SECTIONS
+#define TARGET_ASM_INIT_SECTIONS elf_initfini_array_init_sections
+#endif
+extern void elf_initfini_array_init_sections (void);
+
+/* Use .init_array/.fini_array section for constructors and destructors. */
+#undef TARGET_ASM_CONSTRUCTOR
+#define TARGET_ASM_CONSTRUCTOR elf_init_array_asm_out_constructor
+#undef TARGET_ASM_DESTRUCTOR
+#define TARGET_ASM_DESTRUCTOR elf_fini_array_asm_out_destructor
+extern void elf_init_array_asm_out_constructor (rtx, int);
+extern void elf_fini_array_asm_out_destructor (rtx, int);
diff --git a/gcc-4.4.3/gcc/config/rs6000/rs6000.c b/gcc-4.4.3/gcc/config/rs6000/rs6000.c
index bac3ef385..9c52e8cf1 100644
--- a/gcc-4.4.3/gcc/config/rs6000/rs6000.c
+++ b/gcc-4.4.3/gcc/config/rs6000/rs6000.c
@@ -20838,6 +20838,10 @@ rs6000_elf_asm_init_sections (void)
sdata2_section
= get_unnamed_section (SECTION_WRITE, output_section_asm_op,
SDATA2_SECTION_ASM_OP);
+
+#ifdef NO_CTORS_DTORS_SECTIONS
+ elf_initfini_array_init_sections ();
+#endif
}
/* Implement TARGET_SELECT_RTX_SECTION. */
diff --git a/gcc-4.4.3/gcc/config/stormy16/stormy16.c b/gcc-4.4.3/gcc/config/stormy16/stormy16.c
index 343153d4a..4091d261b 100644
--- a/gcc-4.4.3/gcc/config/stormy16/stormy16.c
+++ b/gcc-4.4.3/gcc/config/stormy16/stormy16.c
@@ -1602,6 +1602,10 @@ xstormy16_asm_init_sections (void)
= get_unnamed_section (SECTION_WRITE | SECTION_BSS,
output_section_asm_op,
"\t.section \".bss_below100\",\"aw\",@nobits");
+
+#ifdef NO_CTORS_DTORS_SECTIONS
+ elf_initfini_array_init_sections ();
+#endif
}
/* Mark symbols with the "below100" attribute so that we can use the
diff --git a/gcc-4.4.3/gcc/config/t-initfini-array b/gcc-4.4.3/gcc/config/t-initfini-array
new file mode 100644
index 000000000..af810c72d
--- /dev/null
+++ b/gcc-4.4.3/gcc/config/t-initfini-array
@@ -0,0 +1,23 @@
+# Copyright (C) 2010
+# 2009 Free Software Foundation, Inc.
+#
+# This file is part of GCC.
+#
+# GCC is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3, or (at your option)
+# any later version.
+#
+# GCC is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GCC; see the file COPYING3. If not see
+# <http://www.gnu.org/licenses/>.
+
+initfini-array.o: $(srcdir)/config/initfini-array.c gt-initfini-array.h \
+ $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TARGET_H) output.h \
+ $(TREE_H) $(GGC_H)
+ $(CC) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $<
diff --git a/gcc-4.4.3/gcc/config/v850/v850.c b/gcc-4.4.3/gcc/config/v850/v850.c
index 51146e65d..944523b33 100644
--- a/gcc-4.4.3/gcc/config/v850/v850.c
+++ b/gcc-4.4.3/gcc/config/v850/v850.c
@@ -2889,6 +2889,10 @@ v850_asm_init_sections (void)
= get_unnamed_section (SECTION_WRITE | SECTION_BSS,
output_section_asm_op,
"\t.section .zbss,\"aw\"");
+
+#ifdef NO_CTORS_DTORS_SECTIONS
+ elf_initfini_array_init_sections ();
+#endif
}
static section *