[llvm-commits] [llvm-gcc-4-2] r39881 - in /llvm-gcc-4-2/trunk/gcc: fold-const.c llvm-convert.cpp tree-inline.c tree.c varasm.c
Anton Korobeynikov
asl at math.spbu.ru
Sun Jul 15 14:57:06 PDT 2007
Author: asl
Date: Sun Jul 15 16:57:06 2007
New Revision: 39881
URL: http://llvm.org/viewvc/llvm-project?rev=39881&view=rev
Log:
Another bunch of fixes here and there.
Modified:
llvm-gcc-4-2/trunk/gcc/fold-const.c
llvm-gcc-4-2/trunk/gcc/llvm-convert.cpp
llvm-gcc-4-2/trunk/gcc/tree-inline.c
llvm-gcc-4-2/trunk/gcc/tree.c
llvm-gcc-4-2/trunk/gcc/varasm.c
Modified: llvm-gcc-4-2/trunk/gcc/fold-const.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/fold-const.c?rev=39881&r1=39880&r2=39881&view=diff
==============================================================================
--- llvm-gcc-4-2/trunk/gcc/fold-const.c (original)
+++ llvm-gcc-4-2/trunk/gcc/fold-const.c Sun Jul 15 16:57:06 2007
@@ -12935,7 +12935,14 @@
{
if ((TREE_CODE (exp) == INDIRECT_REF
|| TREE_CODE (exp) == ARRAY_REF)
- && TREE_CODE (TREE_TYPE (exp)) == INTEGER_TYPE)
+ && TREE_CODE (TREE_TYPE (exp)) == INTEGER_TYPE &&
+/* LLVM LOCAL begin */
+#if ENABLE_LLVM
+ /* LLVM extends ARRAY_REF to allow pointers to be the base value. */
+ (TREE_CODE (TREE_TYPE (TREE_OPERAND (exp, 0))) == ARRAY_TYPE)
+#endif
+/* LLVM LOCAL end */
+ )
{
tree exp1 = TREE_OPERAND (exp, 0);
tree index;
Modified: llvm-gcc-4-2/trunk/gcc/llvm-convert.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/llvm-convert.cpp?rev=39881&r1=39880&r2=39881&view=diff
==============================================================================
--- llvm-gcc-4-2/trunk/gcc/llvm-convert.cpp (original)
+++ llvm-gcc-4-2/trunk/gcc/llvm-convert.cpp Sun Jul 15 16:57:06 2007
@@ -676,8 +676,8 @@
// As it turns out, not all temporaries are associated with blocks. For those
// that aren't, emit them now.
for (tree t = cfun->unexpanded_var_list; t; t = TREE_CHAIN(t)) {
- assert(!DECL_LLVM_SET_P(TREE_VALUE(t)) && "var already emitted?");
- EmitAutomaticVariableDecl(TREE_VALUE(t));
+ if (!DECL_LLVM_SET_P(TREE_VALUE(t)))
+ EmitAutomaticVariableDecl(TREE_VALUE(t));
}
// Create a new block for the return node, but don't insert it yet.
Modified: llvm-gcc-4-2/trunk/gcc/tree-inline.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/tree-inline.c?rev=39881&r1=39880&r2=39881&view=diff
==============================================================================
--- llvm-gcc-4-2/trunk/gcc/tree-inline.c (original)
+++ llvm-gcc-4-2/trunk/gcc/tree-inline.c Sun Jul 15 16:57:06 2007
@@ -2633,7 +2633,13 @@
/* The new variable/label has no RTL, yet. */
if (CODE_CONTAINS_STRUCT (TREE_CODE (copy), TS_DECL_WRTL)
&& !TREE_STATIC (copy) && !DECL_EXTERNAL (copy))
- SET_DECL_RTL (copy, NULL_RTX);
+ /* LLVM LOCAL begin */
+#ifdef ENABLE_LLVM
+ SET_DECL_LLVM (copy, 0);
+#else
+ SET_DECL_RTL (copy, NULL_RTX);
+#endif
+ /* LLVM_LOCAL end */
/* These args would always appear unused, if not for this. */
TREE_USED (copy) = 1;
@@ -2823,6 +2829,8 @@
/* Generate a new name for the new version. */
if (!update_clones)
DECL_NAME (new_decl) = create_tmp_var_name (NULL);
+ /* LLVM LOCAL begin */
+ #ifndef ENABLE_LLVM
/* Create a new SYMBOL_REF rtx for the new name. */
if (DECL_RTL (old_decl) != NULL)
{
@@ -2831,7 +2839,9 @@
gen_rtx_SYMBOL_REF (GET_MODE (XEXP (DECL_RTL (old_decl), 0)),
IDENTIFIER_POINTER (DECL_NAME (new_decl)));
}
-
+ #endif
+ /* LLVM LOCAL end */
+
/* Prepare the data structures for the tree copy. */
memset (&id, 0, sizeof (id));
Modified: llvm-gcc-4-2/trunk/gcc/tree.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/tree.c?rev=39881&r1=39880&r2=39881&view=diff
==============================================================================
--- llvm-gcc-4-2/trunk/gcc/tree.c (original)
+++ llvm-gcc-4-2/trunk/gcc/tree.c Sun Jul 15 16:57:06 2007
@@ -7067,6 +7067,14 @@
if (TREE_CODE (idx) != INTEGER_CST)
return false;
+ /* LLVM LOCAL begin */
+#if ENABLE_LLVM
+ /* LLVM extends ARRAY_REF to allow pointers to be the base value. */
+ if (TREE_CODE (TREE_TYPE (TREE_OPERAND (ref, 0))) != ARRAY_TYPE)
+ return false;
+#endif
+ /* LLVM LOCAL end */
+
min = array_ref_low_bound (ref);
max = array_ref_up_bound (ref);
if (!min
@@ -7089,6 +7097,15 @@
bool
range_in_array_bounds_p (tree ref)
{
+ /* LLVM LOCAL begin */
+#if ENABLE_LLVM
+ /* LLVM extends ARRAY_REF to allow pointers to be the base value. */
+ if (TREE_CODE (TREE_TYPE (TREE_OPERAND (ref, 0))) != ARRAY_TYPE)
+ return false;
+ else {
+#endif
+ /* LLVM LOCAL end */
+
tree domain_type = TYPE_DOMAIN (TREE_TYPE (ref));
tree range_min, range_max, min, max;
@@ -7113,6 +7130,11 @@
return false;
return true;
+ /* LLVM LOCAL begin */
+#if ENABLE_LLVM
+ }
+#endif
+ /* LLVM LOCAL end */
}
/* Return true if T (assumed to be a DECL) is a global variable. */
Modified: llvm-gcc-4-2/trunk/gcc/varasm.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4-2/trunk/gcc/varasm.c?rev=39881&r1=39880&r2=39881&view=diff
==============================================================================
--- llvm-gcc-4-2/trunk/gcc/varasm.c (original)
+++ llvm-gcc-4-2/trunk/gcc/varasm.c Sun Jul 15 16:57:06 2007
@@ -5171,6 +5171,11 @@
#ifdef ENABLE_LLVM
{
tree target_decl;
+ if (lookup_attribute ("weakref", DECL_ATTRIBUTES (p->decl)))
+ {
+ ultimate_transparent_alias_target (&p->target);
+ }
+
target_decl = find_decl_and_mark_needed (p->decl, p->target);
emit_alias_to_llvm(p->decl, p->target, target_decl);
}
More information about the llvm-commits
mailing list