aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.4.3/gcc
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
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')
-rw-r--r--gcc-4.4.3/gcc/acinclude.m420
-rw-r--r--gcc-4.4.3/gcc/config.gcc15
-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
-rwxr-xr-xgcc-4.4.3/gcc/configure100
-rw-r--r--gcc-4.4.3/gcc/configure.ac110
-rw-r--r--gcc-4.4.3/gcc/crtstuff.c8
-rw-r--r--gcc-4.4.3/gcc/ipa-inline.c56
-rw-r--r--gcc-4.4.3/gcc/tree-vect-analyze.c6
-rw-r--r--gcc-4.4.3/gcc/value-prof.c10
15 files changed, 433 insertions, 54 deletions
diff --git a/gcc-4.4.3/gcc/acinclude.m4 b/gcc-4.4.3/gcc/acinclude.m4
index 9f865ee28..6ea4ccf8a 100644
--- a/gcc-4.4.3/gcc/acinclude.m4
+++ b/gcc-4.4.3/gcc/acinclude.m4
@@ -351,26 +351,6 @@ else
fi
fi])
-AC_DEFUN([gcc_AC_INITFINI_ARRAY],
-[AC_ARG_ENABLE(initfini-array,
- [ --enable-initfini-array use .init_array/.fini_array sections],
- [], [
-AC_CACHE_CHECK(for .preinit_array/.init_array/.fini_array support,
- gcc_cv_initfini_array, [dnl
- AC_RUN_IFELSE([AC_LANG_SOURCE([
-static int x = -1;
-int main (void) { return x; }
-int foo (void) { x = 0; }
-int (*fp) (void) __attribute__ ((section (".init_array"))) = foo;])],
- [gcc_cv_initfini_array=yes], [gcc_cv_initfini_array=no],
- [gcc_cv_initfini_array=no])])
- enable_initfini_array=$gcc_cv_initfini_array
-])
-if test $enable_initfini_array = yes; then
- AC_DEFINE(HAVE_INITFINI_ARRAY, 1,
- [Define .init_array/.fini_array sections are available and working.])
-fi])
-
dnl # _gcc_COMPUTE_GAS_VERSION
dnl # Used by gcc_GAS_VERSION_GTE_IFELSE
dnl #
diff --git a/gcc-4.4.3/gcc/config.gcc b/gcc-4.4.3/gcc/config.gcc
index 4aed6f30e..321cf5543 100644
--- a/gcc-4.4.3/gcc/config.gcc
+++ b/gcc-4.4.3/gcc/config.gcc
@@ -156,6 +156,9 @@
# Set to an initializer for configure_default_options
# in configargs.h, based on --with-cpu et cetera.
#
+# use_initfini_array If set to yes, .init_array/.fini_array sections
+# will be used if they work.
+#
# use_fixproto Set to "yes" if fixproto should be run normally,
# "no" if fixproto should never be run.
@@ -200,6 +203,8 @@ need_64bit_hwint=
# specifically set this to 'yes'.
use_fixproto=no
+use_initfini_array=yes
+
# Don't carry these over build->host->target. Please.
xm_file=
md_file=
@@ -2656,6 +2661,16 @@ if test x$with_schedule = x; then
esac
fi
+# Support --enable-initfini-array. Use initfini-array.h only if
+# use_initfini_array is also set to yes. Some platforms don't need it
+# even if enable_initfini_array is yes.
+if test x$enable_initfini_array$use_initfini_array = xyesyes; then
+ tm_file="${tm_file} initfini-array.h"
+ tmake_file="${tmake_file} t-initfini-array"
+ extra_objs="$extra_objs initfini-array.o"
+ target_gtfiles="$target_gtfiles \$(srcdir)/config/initfini-array.c"
+fi
+
# Validate and mark as valid any --with options supported
# by this target. In order to use a particular --with option
# you must list it in supported_defaults; validating the value
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 *
diff --git a/gcc-4.4.3/gcc/configure b/gcc-4.4.3/gcc/configure
index 51db4d2b8..8e79dc560 100755
--- a/gcc-4.4.3/gcc/configure
+++ b/gcc-4.4.3/gcc/configure
@@ -12968,6 +12968,7 @@ fi
# Restore CFLAGS from before the gcc_AC_NEED_DECLARATIONS tests.
CFLAGS="$saved_CFLAGS"
+# Check if .init_array can be used with .ctors.
# Check whether --enable-initfini-array or --disable-initfini-array was given.
if test "${enable_initfini_array+set}" = set; then
enableval="$enable_initfini_array"
@@ -12979,6 +12980,7 @@ echo $ECHO_N "checking for .preinit_array/.init_array/.fini_array support... $EC
if test "${gcc_cv_initfini_array+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
+ if test "x${build}" = "x${target}" ; then
if test "$cross_compiling" = yes; then
gcc_cv_initfini_array=no
else
@@ -12989,10 +12991,97 @@ cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-static int x = -1;
-int main (void) { return x; }
-int foo (void) { x = 0; }
-int (*fp) (void) __attribute__ ((section (".init_array"))) = foo;
+extern void abort ();
+static int count;
+
+static void
+init1005 ()
+{
+ if (count != 0)
+ abort ();
+ count = 1005;
+}
+void (*const init_array1005) ()
+ __attribute__ ((section (".init_array.01005"), aligned (sizeof (void *))))
+ = { init1005 };
+static void
+fini1005 ()
+{
+ if (count != 1005)
+ abort ();
+}
+void (*const fini_array1005) ()
+ __attribute__ ((section (".fini_array.01005"), aligned (sizeof (void *))))
+ = { fini1005 };
+
+static void
+ctor1007 ()
+{
+ if (count != 1005)
+ abort ();
+ count = 1007;
+}
+void (*const ctors1007) ()
+ __attribute__ ((section (".ctors.64528"), aligned (sizeof (void *))))
+ = { ctor1007 };
+static void
+dtor1007 ()
+{
+ if (count != 1007)
+ abort ();
+ count = 1005;
+}
+void (*const dtors1007) ()
+ __attribute__ ((section (".dtors.64528"), aligned (sizeof (void *))))
+ = { dtor1007 };
+
+static void
+init65530 ()
+{
+ if (count != 1007)
+ abort ();
+ count = 65530;
+}
+void (*const init_array65530) ()
+ __attribute__ ((section (".init_array.65530"), aligned (sizeof (void *))))
+ = { init65530 };
+static void
+fini65530 ()
+{
+ if (count != 65530)
+ abort ();
+ count = 1007;
+}
+void (*const fini_array65530) ()
+ __attribute__ ((section (".fini_array.65530"), aligned (sizeof (void *))))
+ = { fini65530 };
+
+static void
+ctor65535 ()
+{
+ if (count != 65530)
+ abort ();
+ count = 65535;
+}
+void (*const ctors65535) ()
+ __attribute__ ((section (".ctors"), aligned (sizeof (void *))))
+ = { ctor65535 };
+static void
+dtor65535 ()
+{
+ if (count != 65535)
+ abort ();
+ count = 65530;
+}
+void (*const dtors65535) ()
+ __attribute__ ((section (".dtors"), aligned (sizeof (void *))))
+ = { dtor65535 };
+
+int
+main ()
+{
+ return 0;
+}
_ACEOF
rm -f conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
@@ -13016,6 +13105,9 @@ gcc_cv_initfini_array=no
fi
rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
+ else
+ gcc_cv_initfini_array=no
+ fi
fi
echo "$as_me:$LINENO: result: $gcc_cv_initfini_array" >&5
echo "${ECHO_T}$gcc_cv_initfini_array" >&6
diff --git a/gcc-4.4.3/gcc/configure.ac b/gcc-4.4.3/gcc/configure.ac
index 1ee190a76..e83b6cad5 100644
--- a/gcc-4.4.3/gcc/configure.ac
+++ b/gcc-4.4.3/gcc/configure.ac
@@ -1184,7 +1184,115 @@ fi
# Restore CFLAGS from before the gcc_AC_NEED_DECLARATIONS tests.
CFLAGS="$saved_CFLAGS"
-gcc_AC_INITFINI_ARRAY
+# Check if .init_array can be used with .ctors.
+AC_ARG_ENABLE(initfini-array,
+ [ --enable-initfini-array use .init_array/.fini_array sections],
+ [], [
+AC_CACHE_CHECK(for .preinit_array/.init_array/.fini_array support,
+ gcc_cv_initfini_array, [dnl
+ if test "x${build}" = "x${target}" ; then
+ AC_RUN_IFELSE([AC_LANG_SOURCE([
+extern void abort ();
+static int count;
+
+static void
+init1005 ()
+{
+ if (count != 0)
+ abort ();
+ count = 1005;
+}
+void (*const init_array1005[]) ()
+ __attribute__ ((section (".init_array.01005"), aligned (sizeof (void *))))
+ = { init1005 };
+static void
+fini1005 ()
+{
+ if (count != 1005)
+ abort ();
+}
+void (*const fini_array1005[]) ()
+ __attribute__ ((section (".fini_array.01005"), aligned (sizeof (void *))))
+ = { fini1005 };
+
+static void
+ctor1007 ()
+{
+ if (count != 1005)
+ abort ();
+ count = 1007;
+}
+void (*const ctors1007[]) ()
+ __attribute__ ((section (".ctors.64528"), aligned (sizeof (void *))))
+ = { ctor1007 };
+static void
+dtor1007 ()
+{
+ if (count != 1007)
+ abort ();
+ count = 1005;
+}
+void (*const dtors1007[]) ()
+ __attribute__ ((section (".dtors.64528"), aligned (sizeof (void *))))
+ = { dtor1007 };
+
+static void
+init65530 ()
+{
+ if (count != 1007)
+ abort ();
+ count = 65530;
+}
+void (*const init_array65530[]) ()
+ __attribute__ ((section (".init_array.65530"), aligned (sizeof (void *))))
+ = { init65530 };
+static void
+fini65530 ()
+{
+ if (count != 65530)
+ abort ();
+ count = 1007;
+}
+void (*const fini_array65530[]) ()
+ __attribute__ ((section (".fini_array.65530"), aligned (sizeof (void *))))
+ = { fini65530 };
+
+static void
+ctor65535 ()
+{
+ if (count != 65530)
+ abort ();
+ count = 65535;
+}
+void (*const ctors65535[]) ()
+ __attribute__ ((section (".ctors"), aligned (sizeof (void *))))
+ = { ctor65535 };
+static void
+dtor65535 ()
+{
+ if (count != 65535)
+ abort ();
+ count = 65530;
+}
+void (*const dtors65535[]) ()
+ __attribute__ ((section (".dtors"), aligned (sizeof (void *))))
+ = { dtor65535 };
+
+int
+main ()
+{
+ return 0;
+}])],
+ [gcc_cv_initfini_array=yes], [gcc_cv_initfini_array=no],
+ [gcc_cv_initfini_array=no])
+ else
+ gcc_cv_initfini_array=no
+ enable_initfini_array=$gcc_cv_initfini_array
+])
+if test $enable_initfini_array = yes; then
+ AC_DEFINE(HAVE_INITFINI_ARRAY, 1,
+ [Define .init_array/.fini_array sections are available and working.])
+fi
# mkdir takes a single argument on some systems.
gcc_AC_FUNC_MKDIR_TAKES_ONE_ARG
diff --git a/gcc-4.4.3/gcc/crtstuff.c b/gcc-4.4.3/gcc/crtstuff.c
index 884a2a5e6..79f2a3341 100644
--- a/gcc-4.4.3/gcc/crtstuff.c
+++ b/gcc-4.4.3/gcc/crtstuff.c
@@ -173,6 +173,9 @@ typedef void (*func_ptr) (void);
refer to only the __CTOR_END__ symbol in crtend.o and the __DTOR_LIST__
symbol in crtbegin.o, where they are defined. */
+/* No need for .ctors/.dtors section if linker can place them in
+ .init_array/.fini_array section. */
+#ifndef NO_CTORS_DTORS_SECTIONS
/* The -1 is a flag to __do_global_[cd]tors indicating that this table
does not start with a count of elements. */
#ifdef CTOR_LIST_BEGIN
@@ -203,6 +206,7 @@ STATIC func_ptr __DTOR_LIST__[1]
__attribute__((section(".dtors"), aligned(sizeof(func_ptr))))
= { (func_ptr) (-1) };
#endif /* __DTOR_LIST__ alternatives */
+#endif /* NO_CTORS_DTORS_SECTIONS */
#ifdef USE_EH_FRAME_REGISTRY
/* Stick a label at the beginning of the frame unwind info so we can register
@@ -466,6 +470,9 @@ __do_global_ctors_1(void)
#elif defined(CRT_END) /* ! CRT_BEGIN */
+/* No need for .ctors/.dtors section if linker can place them in
+ .init_array/.fini_array section. */
+#ifndef NO_CTORS_DTORS_SECTIONS
/* Put a word containing zero at the end of each of our two lists of function
addresses. Note that the words defined here go into the .ctors and .dtors
sections of the crtend.o file, and since that file is always linked in
@@ -511,6 +518,7 @@ STATIC func_ptr __DTOR_END__[1]
__attribute__((unused, section(".dtors"), aligned(sizeof(func_ptr))))
= { (func_ptr) 0 };
#endif
+#endif /* NO_CTORS_DTORS_SECTIONS */
#ifdef EH_FRAME_SECTION_NAME
/* Terminate the frame unwind info section with a 4byte 0 as a sentinel;
diff --git a/gcc-4.4.3/gcc/ipa-inline.c b/gcc-4.4.3/gcc/ipa-inline.c
index da7ac498d..48754d467 100644
--- a/gcc-4.4.3/gcc/ipa-inline.c
+++ b/gcc-4.4.3/gcc/ipa-inline.c
@@ -1375,9 +1375,9 @@ cgraph_edge_priority (struct cgraph_edge *edge)
priority = 0;
else
{
- /* FREQ_DIVISOR is some estimate of the frequency of the
- callsite. The value can range from 0 to 1.0. */
- double freq_divisor;
+ /* FREQ_DIVISOR is an estimate of the relative frequency of the
+ callsite. The value can range from 0 to CGRAPH_FREQ_MAX. */
+ int freq_divisor;
if (max_count)
{
@@ -1390,38 +1390,42 @@ cgraph_edge_priority (struct cgraph_edge *edge)
&& get_total_count_edge (edge, cgraph_node_name (caller)) > 0)
/* When using sample profile, if the function is inlined during the
profiling run, we will give it higher priority to be inlined. */
- freq_divisor = 1.0;
+ freq_divisor = CGRAPH_FREQ_MAX;
else
- freq_divisor = (double)edge->count / max_count;
+ freq_divisor = ((long long) edge->count * CGRAPH_FREQ_MAX
+ + max_count / 2) / max_count;
}
else if (flag_guess_branch_prob)
- /* When function local profile is available, base priorities on
- estimated frequency, so we optimize for overall frequency of
- inlined calls. This is not too accurate since while the call
- might be frequent within function, the function itself is
- infrequent. */
- freq_divisor = (double)edge->frequency / CGRAPH_FREQ_MAX;
+ /* When function local profile is available, base priorities
+ on estimated frequency, so we optimize for overall
+ frequency of inlined calls. This is not too accurate
+ since while the call might be frequent within function,
+ the function itself is infrequent. */
+ freq_divisor = edge->frequency;
else
{
- /* When function local profile is not available or it does not
- give useful information (ie frequency is zero), base the
- frequency upon the loop nest where each loop is estimated to
- be executed twice. The nest depth is capped at a
- constant so the maximum FREQ_DIVISOR value is 1.0. */
+ /* When function local profile is not available or it does
+ not give useful information (ie frequency is zero), base
+ the frequency upon the loop nest where each loop is
+ estimated to be executed twice. The nest depth is capped
+ at 8. */
int nest = MIN (edge->loop_nest, 8);
- freq_divisor = 1.0 / (1 << (8 - nest));
+ freq_divisor = CGRAPH_FREQ_MAX / (1 << (8 - nest));
}
-
- if ((freq_divisor <= 0.0)
- || (growth / freq_divisor > INT_MAX - 1))
- /* Limit priority to one less than INT_MAX to leave room for
- incrementing priority due to recursive inlining below. */
- priority = INT_MAX - 1;
+ if (freq_divisor <= 0)
+ priority = INT_MAX;
else
- priority = (int) (growth / freq_divisor);
-
+ {
+ int priority_ll = (((long long) growth * CGRAPH_FREQ_MAX)
+ / freq_divisor);
+ if (priority_ll > INT_MAX)
+ priority = INT_MAX;
+ else
+ priority = priority_ll;
+ }
/* Make recursive inlining happen always after other inlining is done. */
- if (cgraph_recursive_inlining_p (edge->caller, edge->callee, NULL))
+ if (cgraph_recursive_inlining_p (edge->caller, edge->callee, NULL)
+ && priority < INT_MAX)
priority += 1;
}
gcc_assert (priority >= 0);
diff --git a/gcc-4.4.3/gcc/tree-vect-analyze.c b/gcc-4.4.3/gcc/tree-vect-analyze.c
index 8c55fa737..87b2cabe3 100644
--- a/gcc-4.4.3/gcc/tree-vect-analyze.c
+++ b/gcc-4.4.3/gcc/tree-vect-analyze.c
@@ -1920,6 +1920,9 @@ vect_enhance_data_refs_alignment (loop_vec_info loop_vinfo)
tree vectype = STMT_VINFO_VECTYPE (stmt_info);
int nelements = TYPE_VECTOR_SUBPARTS (vectype);
+ if (contains_abnormal_ssa_name_p (LOOP_VINFO_NITERS (loop_vinfo)))
+ return false;
+
if (known_alignment_for_access_p (dr0))
{
/* Since it's known at compile time, compute the number of iterations
@@ -2015,6 +2018,9 @@ vect_enhance_data_refs_alignment (loop_vec_info loop_vinfo)
if (do_versioning)
{
+ if (contains_abnormal_ssa_name_p (LOOP_VINFO_NITERS (loop_vinfo)))
+ return false;
+
for (i = 0; VEC_iterate (data_reference_p, datarefs, i, dr); i++)
{
stmt = DR_STMT (dr);
diff --git a/gcc-4.4.3/gcc/value-prof.c b/gcc-4.4.3/gcc/value-prof.c
index 6b1402d56..1a3549e19 100644
--- a/gcc-4.4.3/gcc/value-prof.c
+++ b/gcc-4.4.3/gcc/value-prof.c
@@ -506,9 +506,13 @@ check_counter (gimple stmt, const char * name,
}
else
{
- error ("%HCorrupted value profile: %s profiler overall count (%d) "
- "does not match BB count (%d)", &locus, name, (int)*all,
- (int)bb_count);
+ error_at (locus, "corrupted value profile: %s "
+ "profile counter (%d out of %d) inconsistent with "
+ "basic-block count (%d)",
+ name,
+ (int) *count,
+ (int) *all,
+ (int) bb_count);
return true;
}
}