On Jan 17, 2007, at 1:16 PM, Duncan Sands wrote:


Backported from gcc-4.3.  These should only effect the Ada front-end.


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:

This was part of bigger C++ patch. I am hesitated to bring in partial patch without further testing.

Please bring in test case and also add "APPLE LOCAL llvm" markers appropriately. Please let us know how you have verified that there is no C++ regression caused by this patch. And why other parts of same bug fix are not required. If this particular part of the patch is necessary for Ada then I'd prefer to bring in entire C++ bug fix after appropriate C++ testing is done.

-
Devang
_______________________________________________
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

Reply via email to