[llvm-commits] llvm-gcc4: gimplifier fixes
Duncan Sands
baldrick at free.fr
Wed Jan 17 13:16:06 PST 2007
Backported from gcc-4.3. These should only effect the Ada front-end.
Index: gcc.llvm.master/gcc/tree.c
===================================================================
--- gcc.llvm.master.orig/gcc/tree.c 2007-01-17 21:40:30.000000000 +0100
+++ gcc.llvm.master/gcc/tree.c 2007-01-17 21:47:45.000000000 +0100
@@ -2601,7 +2601,7 @@
break;
default:
- if (TREE_CODE_CLASS (code) == tcc_unary
+ if ((TREE_CODE_CLASS (code) == tcc_unary || code == VIEW_CONVERT_EXPR)
&& node && !TYPE_P (node)
&& TREE_CONSTANT (node))
TREE_CONSTANT (t) = 1;
Index: gcc.llvm.master/gcc/varasm.c
===================================================================
--- gcc.llvm.master.orig/gcc/varasm.c 2007-01-17 21:40:31.000000000 +0100
+++ gcc.llvm.master/gcc/varasm.c 2007-01-17 21:47:45.000000000 +0100
@@ -3707,6 +3707,10 @@
&& ((decl_function_context (value) && !DECL_NO_STATIC_CHAIN (value))
|| DECL_NON_ADDR_CONST_P (value)))
return NULL_TREE;
+ /* "&{...}" requires a temporary to hold the constructed
+ object. */
+ if (value && TREE_CODE (value) == CONSTRUCTOR)
+ return NULL_TREE;
return value;
case VIEW_CONVERT_EXPR:
More information about the llvm-commits
mailing list