From b69d564b66feab18b4276bcd57849c98bc1fbaff Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Mon, 7 Jan 2008 22:49:27 +0100 Subject: [PATCH] re PR target/34622 (gcc.c-torture/execute/20000801-4.c fails at -O1 and above) PR target/34622 * config/darwin.c (darwin_mergeable_string_section): Don't use .cstring if int_size_in_bytes != TREE_STRING_LENGTH. From-SVN: r131386 --- gcc/ChangeLog | 6 ++++++ gcc/config/darwin.c | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e8732d7c5e3..86380ee773b 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2008-01-07 Jakub Jelinek + + PR target/34622 + * config/darwin.c (darwin_mergeable_string_section): Don't use + .cstring if int_size_in_bytes != TREE_STRING_LENGTH. + 2008-01-07 Uros Bizjak PR target/34682 diff --git a/gcc/config/darwin.c b/gcc/config/darwin.c index 66d1ab04647..307698d095f 100644 --- a/gcc/config/darwin.c +++ b/gcc/config/darwin.c @@ -1,6 +1,6 @@ /* Functions for generic Darwin as target machine for GNU C compiler. Copyright (C) 1989, 1990, 1991, 1992, 1993, 2000, 2001, 2002, 2003, 2004, - 2005, 2006, 2007 + 2005, 2006, 2007, 2008 Free Software Foundation, Inc. Contributed by Apple Computer Inc. @@ -1136,6 +1136,8 @@ darwin_mergeable_string_section (tree exp, && TREE_CODE (exp) == STRING_CST && TREE_CODE (TREE_TYPE (exp)) == ARRAY_TYPE && align <= 256 + && (int_size_in_bytes (TREE_TYPE (exp)) + == TREE_STRING_LENGTH (exp)) && ((size_t) TREE_STRING_LENGTH (exp) == strlen (TREE_STRING_POINTER (exp)) + 1)) return darwin_sections[cstring_section];