This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
PATCH: PR c++/37520: [4.4 Regression] junk `(,%eax,4)' after expression / suffix
- From: "H.J. Lu" <hongjiu dot lu at intel dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Sun, 1 Mar 2009 12:03:57 -0800
- Subject: PATCH: PR c++/37520: [4.4 Regression] junk `(,%eax,4)' after expression / suffix
- Reply-to: "H.J. Lu" <hjl dot tools at gmail dot com>
Hi,
cp-tree.h defines
#define ANON_AGGRNAME_FORMAT "$_%d"
if NO_DOLLAR_IN_LABEL is undefined. x86 assembler doesn't really support
LOCAL_LABELS_DOLLAR in
$foo:
movl $foo(%eax), %eax
since it can't tell if $foo is a label or the value of symbol foo. I
do have a hack for x86 assembler, which assumes $_XXX is a local label
if LOCAL_LABELS_DOLLAR is defined. I really want to avoid it if all
possible.
On the other hand, are there any reasons why cp-tree.h can't check
NO_DOT_IN_LABEL before NO_DOLLAR_IN_LABEL when mangling symbols. I
don't think this patch will change anythings on platforms where
NO_DOLLAR_IN_LABEL is defined. Will this patch fix PR c++/37520?
Thanks.
H.J.
---
2009-03-01 H.J. Lu <hongjiu.lu@intel.com>
PR c++/37520
* cp-tree.h: Check NO_DOT_IN_LABEL before NO_DOLLAR_IN_LABEL
when mangling symbols.
Index: gcc/cp/cp-tree.h
===================================================================
--- gcc/cp/cp-tree.h (revision 144526)
+++ gcc/cp/cp-tree.h (working copy)
@@ -3660,20 +3660,8 @@ extern GTY(()) VEC(tree,gc) *local_class
at a particular location, we can index into the string at
any other location that provides distinguishing characters). */
-/* Define NO_DOLLAR_IN_LABEL in your favorite tm file if your assembler
- doesn't allow '$' in symbol names. */
-#ifndef NO_DOLLAR_IN_LABEL
-
-#define JOINER '$'
-
-#define AUTO_TEMP_NAME "_$tmp_"
-#define VFIELD_BASE "$vf"
-#define VFIELD_NAME "_vptr$"
-#define VFIELD_NAME_FORMAT "_vptr$%s"
-#define ANON_AGGRNAME_FORMAT "$_%d"
-
-#else /* NO_DOLLAR_IN_LABEL */
-
+/* Define NO_DOT_IN_LABEL in your favorite tm file if your assembler
+ doesn't allow '.' in symbol names. */
#ifndef NO_DOT_IN_LABEL
#define JOINER '.'
@@ -3687,6 +3675,18 @@ extern GTY(()) VEC(tree,gc) *local_class
#else /* NO_DOT_IN_LABEL */
+#ifndef NO_DOLLAR_IN_LABEL
+
+#define JOINER '$'
+
+#define AUTO_TEMP_NAME "_$tmp_"
+#define VFIELD_BASE "$vf"
+#define VFIELD_NAME "_vptr$"
+#define VFIELD_NAME_FORMAT "_vptr$%s"
+#define ANON_AGGRNAME_FORMAT "$_%d"
+
+#else /* NO_DOLLAR_IN_LABEL */
+
#define IN_CHARGE_NAME "__in_chrg"
#define AUTO_TEMP_NAME "__tmp_"
#define TEMP_NAME_P(ID_NODE) \
@@ -3709,8 +3709,8 @@ extern GTY(()) VEC(tree,gc) *local_class
sizeof (ANON_AGGRNAME_PREFIX) - 1))
#define ANON_AGGRNAME_FORMAT "__anon_%d"
-#endif /* NO_DOT_IN_LABEL */
#endif /* NO_DOLLAR_IN_LABEL */
+#endif /* NO_DOT_IN_LABEL */
#define THIS_NAME "this"