This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/54404] [4.8 Regression] *cfstring* failures for (obj-c|g)++ on *-apple-darwin* after revision 186789
- From: "dominiq at lps dot ens.fr" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 14 Oct 2012 05:51:59 +0000
- Subject: [Bug target/54404] [4.8 Regression] *cfstring* failures for (obj-c|g)++ on *-apple-darwin* after revision 186789
- Auto-submitted: auto-generated
- References: <bug-54404-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54404
Dominique d'Humieres <dominiq at lps dot ens.fr> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2012-10-14
Ever Confirmed|0 |1
--- Comment #2 from Dominique d'Humieres <dominiq at lps dot ens.fr> 2012-10-14 05:51:59 UTC ---
> This is a follow up of pr53283 for the remaining failures of some *cfstring*
> tests on *-apple-darwin* after revision 186789: ...
This was an over simplification of the problem. On x86_64-apple-darwin10
revision 186789 introduced an ICE
g++.dg/other/darwin-cfstring1.C:13:80: internal compiler error: in
ix86_expand_builtin, at config/i386/i386.c:30398
fixed between revisions 189336 and 189490 (likely 189391). The errors reported
in comment #0 appeared only after the ICE has been fixed.
On powerpc-apple-darwin9 the failures appeared between revisions 186440 (OK)
and 187171 (failures).
For the test g++.dg/other/darwin-cfstring1.C, the error changed between
revisions 186788 and 189490 from
/opt/gcc/work/gcc/testsuite/g++.dg/other/darwin-cfstring1.C: In function 'int
main()':
/opt/gcc/work/gcc/testsuite/g++.dg/other/darwin-cfstring1.C:21:20: error:
CFString literal expression is not a string constant
/opt/gcc/work/gcc/testsuite/g++.dg/other/darwin-cfstring1.C:22:20: error:
CFString literal expression is not a string constant
to
/opt/gcc/work/gcc/testsuite/g++.dg/other/darwin-cfstring1.C: In function 'int
main()':
/opt/gcc/work/gcc/testsuite/g++.dg/other/darwin-cfstring1.C:13:79: error:
CFString literal expression is not a string constant
/opt/gcc/work/gcc/testsuite/g++.dg/other/darwin-cfstring1.C:21:20: note: in
expansion of macro 'CFSTR'
/opt/gcc/work/gcc/testsuite/g++.dg/other/darwin-cfstring1.C:13:79: error:
CFString literal expression is not a string constant
/opt/gcc/work/gcc/testsuite/g++.dg/other/darwin-cfstring1.C:22:20: note: in
expansion of macro 'CFSTR'
The following patch adjusts the errors/notes to the present pattern while
hopefully retaining the intent of the original test
--- ../_clean/gcc/testsuite/g++.dg/other/darwin-cfstring1.C 2010-10-23
22:17:07.000000000 +0200
+++ gcc/testsuite/g++.dg/other/darwin-cfstring1.C 2012-10-13
23:54:37.000000000 +0200
@@ -10,7 +10,7 @@
#ifdef __CONSTANT_CFSTRINGS__
#undef CFSTR
-#define CFSTR(STR) ((CFStringRef) __builtin___CFStringMakeConstantString
(STR))
+#define CFSTR(STR) ((CFStringRef) __builtin___CFStringMakeConstantString
(STR)) /* { dg-error "CFString literal expression is not a string constant" }
*/
#endif
extern int cond;
@@ -18,8 +18,8 @@ extern const char *func(void);
int main(void) {
CFStringRef s1 = CFSTR("Str1");
- CFStringRef s2 = CFSTR(cond? "Str2": "Str3"); /* { dg-error "CFString
literal expression is not a string constant" } */
- CFStringRef s3 = CFSTR(func()); /* { dg-error "CFString literal expression
is not a string constant" } */
+ CFStringRef s2 = CFSTR(cond? "Str2": "Str3"); /* { dg-message "note: in
expansion of macro 'CFSTR'" } */
+ CFStringRef s3 = CFSTR(func()); /* { dg-message "note: in expansion of
macro 'CFSTR'" } */
return 0;
}
The situation for the test obj-c++.dg/strings/const-cfstring-2.mm is more
puzzling. The failures appeared in the same revision frame and is due to the
fact that the lines
CFStringRef s4 = CFSTR("\222 - Non-ASCII literal"); /* { dg-warning
"non-ASCII character in CFString literal" } */
CFStringRef s5 = CFSTR("Non-ASCII (\222) literal"); /* { dg-warning
"non-ASCII character in CFString literal" } */
...
CFStringRef s7 = CFSTR("Embedded \0NUL"); /* { dg-warning "embedded NUL in
CFString literal" } */
CFStringRef s8 = CFSTR("Embedded NUL\0"); /* { dg-warning "embedded NUL in
CFString literal" } */
do not give the expected warnings, while the lines
NSString *s3 = @"Non-ASCII literal - \222"; /* { dg-warning
"non-ASCII character in CFString literal" } */
NSString *s6 = @"\0Embedded NUL"; /* { dg-warning "embedded NUL in
CFString literal" } */
do: the NSString lines work as expected, but the CFStringRef one don't.