public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug objc/30479] Precompiled headers don't seem to work with GNU ObjC
  2007-01-16  4:36 [Bug objc/30479] New: Precompiled headers don't seem to work with GNU ObjC n dot pero at mi dot flashnet dot it
@ 2007-01-16  4:36 ` n dot pero at mi dot flashnet dot it
  2007-01-16  4:37 ` n dot pero at mi dot flashnet dot it
                   ` (10 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: n dot pero at mi dot flashnet dot it @ 2007-01-16  4:36 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from n dot pero at mi dot flashnet dot it  2007-01-16 04:36 -------
Created an attachment (id=12908)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=12908&action=view)
test case (header)


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30479


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug objc/30479]  New: Precompiled headers don't seem to work with GNU ObjC
@ 2007-01-16  4:36 n dot pero at mi dot flashnet dot it
  2007-01-16  4:36 ` [Bug objc/30479] " n dot pero at mi dot flashnet dot it
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: n dot pero at mi dot flashnet dot it @ 2007-01-16  4:36 UTC (permalink / raw)
  To: gcc-bugs

Consider the following files, test.h and test.m:

test.h:
-------

/* Contributed by Nicola Pero - Tue Jan 16 04:09:06 GMT 2007 */
#include <objc/objc.h>
#include <objc/Object.h>

@interface TestClass : Object
+ (int) test;
@end

test.m:
-------

#include "test.h"

@implementation TestClass
+ (int) test
{
  return 0;
}
@end

int main (void)
{
  return [TestClass test];
}


My compiler is 4.1.1 20070105 (Red Hat 4.1.1-51).

If I compile the files in the standard way --

 gcc test.m -lobjc

it all works.

If I first precompile test.h

 gcc -x objective-c-header test.h

I get the test.h.gch file, which looks ok, but then compiling fails --

 gcc test.m -lobjc

test.m:4: warning: cannot find interface declaration for
&#65533;TestClass&#65533;
test.m:4: error: redefinition of &#65533;struct TestClass&#65533;
(compilation aborts)

(I also got a compiler internal error once)

Using the -H option to gcc you can indeed confirm that compilation fails iff
the
precompiled ObjC header is used.

It seems that ObjC class declarations in ObjC headers are not read correctly/at
all from precompiled headers (C stuff works fine instead!).  Very
disappointing. :-(

I hope I'm missing an option / something, else it's a bug that needs fixing :-(

Thanks


-- 
           Summary: Precompiled headers don't seem to work with GNU ObjC
           Product: gcc
           Version: 4.1.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: objc
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: n dot pero at mi dot flashnet dot it


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30479


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug objc/30479] Precompiled headers don't seem to work with GNU ObjC
  2007-01-16  4:36 [Bug objc/30479] New: Precompiled headers don't seem to work with GNU ObjC n dot pero at mi dot flashnet dot it
  2007-01-16  4:36 ` [Bug objc/30479] " n dot pero at mi dot flashnet dot it
@ 2007-01-16  4:37 ` n dot pero at mi dot flashnet dot it
  2007-01-16  4:40 ` [Bug objc/30479] [4.1/4.2/4.3 Regression] " pinskia at gcc dot gnu dot org
                   ` (9 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: n dot pero at mi dot flashnet dot it @ 2007-01-16  4:37 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from n dot pero at mi dot flashnet dot it  2007-01-16 04:37 -------
Created an attachment (id=12909)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=12909&action=view)
test case (ObjC file)


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30479


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug objc/30479] [4.1/4.2/4.3 Regression] Precompiled headers don't seem to work with GNU ObjC
  2007-01-16  4:36 [Bug objc/30479] New: Precompiled headers don't seem to work with GNU ObjC n dot pero at mi dot flashnet dot it
  2007-01-16  4:36 ` [Bug objc/30479] " n dot pero at mi dot flashnet dot it
  2007-01-16  4:37 ` n dot pero at mi dot flashnet dot it
@ 2007-01-16  4:40 ` pinskia at gcc dot gnu dot org
  2007-01-16  4:56 ` nicola dot pero at meta-innovation dot com
                   ` (8 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-01-16  4:40 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from pinskia at gcc dot gnu dot org  2007-01-16 04:40 -------
Confirmed, a regression from 4.0.4 where this worked.
I will look into this more soon.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |pinskia at gcc dot gnu dot
                   |                            |org
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
           Keywords|                            |rejects-valid
      Known to fail|                            |4.1.0 4.1.1
      Known to work|                            |4.0.3
   Last reconfirmed|0000-00-00 00:00:00         |2007-01-16 04:40:10
               date|                            |
            Summary|Precompiled headers don't   |[4.1/4.2/4.3 Regression]
                   |seem to work with GNU ObjC  |Precompiled headers don't
                   |                            |seem to work with GNU ObjC
   Target Milestone|---                         |4.1.2


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30479


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug objc/30479] [4.1/4.2/4.3 Regression] Precompiled headers don't seem to work with GNU ObjC
  2007-01-16  4:36 [Bug objc/30479] New: Precompiled headers don't seem to work with GNU ObjC n dot pero at mi dot flashnet dot it
                   ` (2 preceding siblings ...)
  2007-01-16  4:40 ` [Bug objc/30479] [4.1/4.2/4.3 Regression] " pinskia at gcc dot gnu dot org
@ 2007-01-16  4:56 ` nicola dot pero at meta-innovation dot com
  2007-01-16  4:58 ` pinskia at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: nicola dot pero at meta-innovation dot com @ 2007-01-16  4:56 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from nicola dot pero at meta-innovation dot com  2007-01-16 04:55 -------
Once fixed, it might be worthwhile adding testcases for this then ? :-)

Thanks


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30479


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug objc/30479] [4.1/4.2/4.3 Regression] Precompiled headers don't seem to work with GNU ObjC
  2007-01-16  4:36 [Bug objc/30479] New: Precompiled headers don't seem to work with GNU ObjC n dot pero at mi dot flashnet dot it
                   ` (3 preceding siblings ...)
  2007-01-16  4:56 ` nicola dot pero at meta-innovation dot com
@ 2007-01-16  4:58 ` pinskia at gcc dot gnu dot org
  2007-01-16  6:25 ` pinskia at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-01-16  4:58 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from pinskia at gcc dot gnu dot org  2007-01-16 04:58 -------
(In reply to comment #4)
> Once fixed, it might be worthwhile adding testcases for this then ? :-)
Yes and I am going to try to do that also.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30479


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug objc/30479] [4.1/4.2/4.3 Regression] Precompiled headers don't seem to work with GNU ObjC
  2007-01-16  4:36 [Bug objc/30479] New: Precompiled headers don't seem to work with GNU ObjC n dot pero at mi dot flashnet dot it
                   ` (4 preceding siblings ...)
  2007-01-16  4:58 ` pinskia at gcc dot gnu dot org
@ 2007-01-16  6:25 ` pinskia at gcc dot gnu dot org
  2007-01-16  7:43 ` pinskia at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-01-16  6:25 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from pinskia at gcc dot gnu dot org  2007-01-16 06:25 -------
Well this was caused by the objective-C++ merge.  This is also a classic
example of why hashing on pointer values is not a good idea.

Working on a fix, should also simplify the code :).


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |pinskia at gcc dot gnu dot
                   |dot org                     |org
             Status|NEW                         |ASSIGNED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30479


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug objc/30479] [4.1/4.2/4.3 Regression] Precompiled headers don't seem to work with GNU ObjC
  2007-01-16  4:36 [Bug objc/30479] New: Precompiled headers don't seem to work with GNU ObjC n dot pero at mi dot flashnet dot it
                   ` (5 preceding siblings ...)
  2007-01-16  6:25 ` pinskia at gcc dot gnu dot org
@ 2007-01-16  7:43 ` pinskia at gcc dot gnu dot org
  2007-01-21  6:51 ` pinskia at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-01-16  7:43 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from pinskia at gcc dot gnu dot org  2007-01-16 07:43 -------
I have a full fix and a semi working testsuite (semi working mean it will work
for non remote testing).

This is just a good example of when you should not use pointer hashing,
especially when there is already a hash for identifiers.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30479


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug objc/30479] [4.1/4.2/4.3 Regression] Precompiled headers don't seem to work with GNU ObjC
  2007-01-16  4:36 [Bug objc/30479] New: Precompiled headers don't seem to work with GNU ObjC n dot pero at mi dot flashnet dot it
                   ` (6 preceding siblings ...)
  2007-01-16  7:43 ` pinskia at gcc dot gnu dot org
@ 2007-01-21  6:51 ` pinskia at gcc dot gnu dot org
  2007-01-21 23:34 ` [Bug objc/30479] [4.1/4.2 " pinskia at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-01-21  6:51 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from pinskia at gcc dot gnu dot org  2007-01-21 06:51 -------
Subject: Bug 30479

Author: pinskia
Date: Sun Jan 21 06:51:07 2007
New Revision: 121024

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=121024
Log:
2007-01-20  Andrew Pinski  <pinskia@gmail.com>

        PR objc/30479
        * objc-act.c (hash_interface): Use IDENTIFIER_HASH_VALUE instead
        of htab_hash_pointer.
        (lookup_interface): Likewise.
        (add_class): Likewise.

2007-01-20  Andrew Pinski  <pinskia@gmail.com>

        PR objc/30479
        * objc.dg/pch: New directory.
        * objc.dg/pch/pch.exp: New file.
        * objc.dg/pch/interface-1.m: New test.
        * objc.dg/pch/interface-1.hs: New include file.
        * lib/objc.exp (objc_target_compile): Add
        "-x objective-c-header" in front of the sources if this is
        a precompiled header being compiled.



Added:
    trunk/gcc/testsuite/objc.dg/pch/
    trunk/gcc/testsuite/objc.dg/pch/interface-1.hs
    trunk/gcc/testsuite/objc.dg/pch/interface-1.m
    trunk/gcc/testsuite/objc.dg/pch/pch.exp
Modified:
    trunk/gcc/objc/ChangeLog
    trunk/gcc/objc/objc-act.c
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/lib/objc.exp


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30479


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug objc/30479] [4.1/4.2 Regression] Precompiled headers don't seem to work with GNU ObjC
  2007-01-16  4:36 [Bug objc/30479] New: Precompiled headers don't seem to work with GNU ObjC n dot pero at mi dot flashnet dot it
                   ` (7 preceding siblings ...)
  2007-01-21  6:51 ` pinskia at gcc dot gnu dot org
@ 2007-01-21 23:34 ` pinskia at gcc dot gnu dot org
  2007-01-22  0:17 ` [Bug objc/30479] [4.1 " pinskia at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-01-21 23:34 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from pinskia at gcc dot gnu dot org  2007-01-21 23:33 -------
Subject: Bug 30479

Author: pinskia
Date: Sun Jan 21 23:33:46 2007
New Revision: 121040

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=121040
Log:
2007-01-20  Andrew Pinski  <pinskia@gmail.com>

        PR objc/30479
        * objc-act.c (hash_interface): Use IDENTIFIER_HASH_VALUE instead
        of htab_hash_pointer.
        (lookup_interface): Likewise.
        (add_class): Likewise.

2007-01-20  Andrew Pinski  <pinskia@gmail.com>

        PR objc/30479
        * objc.dg/pch: New directory.
        * objc.dg/pch/pch.exp: New file.
        * objc.dg/pch/interface-1.m: New test.
        * objc.dg/pch/interface-1.hs: New include file.
        * lib/objc.exp (objc_target_compile): Add
        "-x objective-c-header" in front of the sources if this is
        a precompiled header being compiled.


Added:
    branches/gcc-4_2-branch/gcc/testsuite/objc.dg/pch/
      - copied from r121024, trunk/gcc/testsuite/objc.dg/pch/
Modified:
    branches/gcc-4_2-branch/gcc/objc/ChangeLog
    branches/gcc-4_2-branch/gcc/objc/objc-act.c
    branches/gcc-4_2-branch/gcc/testsuite/ChangeLog
    branches/gcc-4_2-branch/gcc/testsuite/lib/objc.exp


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30479


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug objc/30479] [4.1 Regression] Precompiled headers don't seem to work with GNU ObjC
  2007-01-16  4:36 [Bug objc/30479] New: Precompiled headers don't seem to work with GNU ObjC n dot pero at mi dot flashnet dot it
                   ` (8 preceding siblings ...)
  2007-01-21 23:34 ` [Bug objc/30479] [4.1/4.2 " pinskia at gcc dot gnu dot org
@ 2007-01-22  0:17 ` pinskia at gcc dot gnu dot org
  2007-01-22  2:03 ` pinskia at gcc dot gnu dot org
  2007-01-22  2:03 ` pinskia at gcc dot gnu dot org
  11 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-01-22  0:17 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #10 from pinskia at gcc dot gnu dot org  2007-01-22 00:16 -------
Testing on the 4.1 branch now.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to work|4.0.3 4.3.0                 |4.0.3 4.3.0 4.2.0
            Summary|[4.1/4.2 Regression]        |[4.1 Regression] Precompiled
                   |Precompiled headers don't   |headers don't seem to work
                   |seem to work with GNU ObjC  |with GNU ObjC


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30479


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug objc/30479] [4.1 Regression] Precompiled headers don't seem to work with GNU ObjC
  2007-01-16  4:36 [Bug objc/30479] New: Precompiled headers don't seem to work with GNU ObjC n dot pero at mi dot flashnet dot it
                   ` (9 preceding siblings ...)
  2007-01-22  0:17 ` [Bug objc/30479] [4.1 " pinskia at gcc dot gnu dot org
@ 2007-01-22  2:03 ` pinskia at gcc dot gnu dot org
  2007-01-22  2:03 ` pinskia at gcc dot gnu dot org
  11 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-01-22  2:03 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #12 from pinskia at gcc dot gnu dot org  2007-01-22 02:03 -------
Subject: Bug 30479

Author: pinskia
Date: Mon Jan 22 02:03:02 2007
New Revision: 121048

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=121048
Log:
2007-01-21  Andrew Pinski  <pinskia@gmail.com>

        PR objc/30479
        * objc-act.c (hash_interface): Use IDENTIFIER_HASH_VALUE instead
        of htab_hash_pointer.
        (lookup_interface): Likewise.
        (add_class): Likewise.

2007-01-21  Andrew Pinski  <pinskia@gmail.com>

        PR objc/30479
        * objc.dg/pch: New directory.
        * objc.dg/pch/pch.exp: New file.
        * objc.dg/pch/interface-1.m: New test.
        * objc.dg/pch/interface-1.hs: New include file.
        * lib/objc.exp (objc_target_compile): Add
        "-x objective-c-header" in front of the sources if this is
        a precompiled header being compiled.



Added:
    branches/gcc-4_1-branch/gcc/testsuite/objc.dg/pch/
      - copied from r121024, trunk/gcc/testsuite/objc.dg/pch/
Modified:
    branches/gcc-4_1-branch/gcc/objc/ChangeLog
    branches/gcc-4_1-branch/gcc/objc/objc-act.c
    branches/gcc-4_1-branch/gcc/testsuite/ChangeLog
    branches/gcc-4_1-branch/gcc/testsuite/lib/objc.exp


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30479


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug objc/30479] [4.1 Regression] Precompiled headers don't seem to work with GNU ObjC
  2007-01-16  4:36 [Bug objc/30479] New: Precompiled headers don't seem to work with GNU ObjC n dot pero at mi dot flashnet dot it
                   ` (10 preceding siblings ...)
  2007-01-22  2:03 ` pinskia at gcc dot gnu dot org
@ 2007-01-22  2:03 ` pinskia at gcc dot gnu dot org
  11 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-01-22  2:03 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #11 from pinskia at gcc dot gnu dot org  2007-01-22 02:03 -------
Fixed in 4.1.2.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
      Known to work|4.0.3 4.3.0 4.2.0           |4.0.3 4.3.0 4.2.0 4.1.2
         Resolution|                            |FIXED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30479


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2007-01-22  2:03 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-01-16  4:36 [Bug objc/30479] New: Precompiled headers don't seem to work with GNU ObjC n dot pero at mi dot flashnet dot it
2007-01-16  4:36 ` [Bug objc/30479] " n dot pero at mi dot flashnet dot it
2007-01-16  4:37 ` n dot pero at mi dot flashnet dot it
2007-01-16  4:40 ` [Bug objc/30479] [4.1/4.2/4.3 Regression] " pinskia at gcc dot gnu dot org
2007-01-16  4:56 ` nicola dot pero at meta-innovation dot com
2007-01-16  4:58 ` pinskia at gcc dot gnu dot org
2007-01-16  6:25 ` pinskia at gcc dot gnu dot org
2007-01-16  7:43 ` pinskia at gcc dot gnu dot org
2007-01-21  6:51 ` pinskia at gcc dot gnu dot org
2007-01-21 23:34 ` [Bug objc/30479] [4.1/4.2 " pinskia at gcc dot gnu dot org
2007-01-22  0:17 ` [Bug objc/30479] [4.1 " pinskia at gcc dot gnu dot org
2007-01-22  2:03 ` pinskia at gcc dot gnu dot org
2007-01-22  2:03 ` pinskia at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).