This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Fix objc.dg/const-str-5.m regression for the NeXT^wApple's runtime
- From: Andrew Pinski <pinskia at physics dot uc dot edu>
- To: gcc-patches at gcc dot gnu dot org
- Cc: Ziemowit Laski <zlaski at apple dot com>
- Date: Sun, 18 Jul 2004 00:46:10 -0700
- Subject: [PATCH] Fix objc.dg/const-str-5.m regression for the NeXT^wApple's runtime
The problem was the ADDR_EXPR of a CONSTRUCTOR was no longer considered
constant for
some reason. This patch just marks the address expression as constant
after building
the address expression.
OK? Tested on powerpc-apple-darwin and i686-pc-linux-gnu with no
regressions.
Thanks,
Andrew Pinski
ChangeLog:
* objc/objc-act.c (build_objc_string_object): Mark the address
expression as constant.
Patch:
Index: objc-act.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/objc/objc-act.c,v
retrieving revision 1.232
diff -u -p -r1.232 objc-act.c
--- objc-act.c 9 Jul 2004 23:32:38 -0000 1.232
+++ objc-act.c 18 Jul 2004 07:36:18 -0000
@@ -1453,7 +1453,9 @@ build_objc_string_object (tree string)
= objc_add_static_instance (constructor, constant_string_type);
}
- return (build_unary_op (ADDR_EXPR, constructor, 1));
+ constructor = build_unary_op (ADDR_EXPR, constructor, 1);
+ TREE_CONSTANT (constructor) = true;
+ return constructor;
}
/* Declare a static instance of CLASS_DECL initialized by CONSTRUCTOR.
*/