diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2006-03-24 16:53:29 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2006-03-24 16:53:29 +0000 |
commit | f8745b730bdef84aad5fa5e168443dac9f6522ba (patch) | |
tree | 684d8959530ef28c4941ed1061462de2f9fab4a4 | |
parent | d87f1a7d1d12765d6603602db1d428f12333e145 (diff) |
Radar 4193359
OKed by Mike.
git-svn-id: https://gcc.gnu.org/svn/gcc/branches/apple/trunk@112353 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/ChangeLog.apple-ppc | 6 | ||||
-rw-r--r-- | gcc/c-typeck.c | 18 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog.apple-ppc | 5 | ||||
-rw-r--r-- | gcc/testsuite/objc.dg/try-catch-14.m | 34 |
4 files changed, 55 insertions, 8 deletions
diff --git a/gcc/ChangeLog.apple-ppc b/gcc/ChangeLog.apple-ppc index 26984f05b37..5bd2811e471 100644 --- a/gcc/ChangeLog.apple-ppc +++ b/gcc/ChangeLog.apple-ppc @@ -1,3 +1,9 @@ +2006-03-23 Fariborz Jahanian <fjahanian@apple.com> + + Radar 4193359 + * c-typeck.c (convert_for_assignment): Remove Objective-C EH machinery + 'volatile' qualifier before doing type comparison. + 2006-03-22 Geoffrey Keating <geoffk@apple.com> Radar 4255172 diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c index f943890bd87..8e0d4f6914e 100644 --- a/gcc/c-typeck.c +++ b/gcc/c-typeck.c @@ -3940,8 +3940,13 @@ convert_for_assignment (tree type, tree rhs, enum impl_conv errtype, else if ((codel == POINTER_TYPE || codel == REFERENCE_TYPE) && (coder == codel)) { - tree ttl = TREE_TYPE (type); - tree ttr = TREE_TYPE (rhstype); + /* APPLE LOCAL begin radar 4193359 */ + /* Types differing only by the presence of the 'volatile' + qualifier are acceptable if the 'volatile' has been added + in by the Objective-C EH machinery. */ + tree ttl = objc_non_volatilized_type (TREE_TYPE (type)); + tree ttr = objc_non_volatilized_type (TREE_TYPE (rhstype)); + /* APPLE LOCAL end radar 4193359 */ tree mvl = ttl; tree mvr = ttr; bool is_opaque_pointer; @@ -3992,12 +3997,9 @@ convert_for_assignment (tree type, tree rhs, enum impl_conv errtype, /* APPLE LOCAL begin 4086969 */ if (TYPE_QUALS (ttr) & ~TYPE_QUALS (ttl)) { - /* APPLE LOCAL begin mainline */ - /* Types differing only by the presence of the 'volatile' - qualifier are acceptable if the 'volatile' has been added - in by the Objective-C EH machinery. */ - if (warn_discard_qual && !objc_type_quals_match (ttl, ttr)) - /* APPLE LOCAL end mainline */ + /* APPLE LOCAL begin radar 4193359 */ + if (warn_discard_qual) + /* APPLE LOCAL end radar 4193359 */ WARN_FOR_ASSIGNMENT (G_("passing argument %d of %qE discards " "qualifiers from pointer target type"), G_("assignment discards qualifiers " diff --git a/gcc/testsuite/ChangeLog.apple-ppc b/gcc/testsuite/ChangeLog.apple-ppc index 48310805979..724ba8e9a84 100644 --- a/gcc/testsuite/ChangeLog.apple-ppc +++ b/gcc/testsuite/ChangeLog.apple-ppc @@ -1,3 +1,8 @@ +2006-03-23 Fariborz Jahanian <fjahanian@apple.com> + + Radar 4193359 + * objc.dg/try-catch-14.m: New. + 2006-03-23 Geoffrey Keating <geoffk@apple.com> Radar 4255172 diff --git a/gcc/testsuite/objc.dg/try-catch-14.m b/gcc/testsuite/objc.dg/try-catch-14.m new file mode 100644 index 00000000000..c9948b59e11 --- /dev/null +++ b/gcc/testsuite/objc.dg/try-catch-14.m @@ -0,0 +1,34 @@ +/* APPLE LOCAL file radar 4193359 */ +/* Ensure that variable *not* declared 'volatile' by user does not + trigger "discards qualifiers from target pointer type" warning + when synthesized by the EH-volatization machinery. */ + +/* { dg-options "-fobjc-exceptions -fnext-runtime" } */ +/* { dg-do compile } */ + +#include <string.h> + +@interface Foo +-(void) foo; +@end + +@implementation Foo + +-(void) foo +{ + float f = 0; + + @try + { + } + @finally + { + } + + memcpy(&f, + &f, sizeof(f)); +} + +@end +//------------------------------- + |