Bug 44904 - Maybe bogus Use of type ?struct nsCSSStyleSheet? with two mismatching declarations at field ?mRuleProcessors? warnings in Mozilla
Summary: Maybe bogus Use of type ?struct nsCSSStyleSheet? with two mismatching declara...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: lto (show other bugs)
Version: 4.6.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks: mozillametabug
  Show dependency treegraph
 
Reported: 2010-07-10 15:22 UTC by Jan Hubicka
Modified: 2011-01-08 20:02 UTC (History)
1 user (show)

See Also:
Host: x86_64-linux
Target: x86_64-linux
Build: x86_64-linux
Known to work:
Known to fail:
Last reconfirmed:


Attachments
testcase (618.46 KB, application/x-compressed-tar)
2010-07-10 15:24 UTC, Jan Hubicka
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Hubicka 2010-07-10 15:22:43 UTC
These seems to be last kind of warnings I can not debug in Mozilla. Might be bogus but I don't see how.

Honza

jh@evans:/abuild/jh/mozilla-central/build10/layout/style> /abuild/jh/trunk-install/bin/g++ -O2 -flto -r -nostdlib tc/*.ii                                              
../../../layout/style/nsCSSStyleRule.cpp: In member function ?DOMCSSStyleRuleImpl* DOMCSSDeclarationImpl::DomRule()?:                                                  
../../../layout/style/nsCSSStyleRule.cpp:1037:53: warning: invalid access to non-static data member ?DOMCSSStyleRuleImpl::mDOMDeclaration?  of NULL object [-Winvalid-offsetof]                                                                                                                                                               
../../../layout/style/nsCSSStyleRule.cpp:1037:53: warning: (perhaps the ?offsetof? macro was used incorrectly) [-Winvalid-offsetof]                                    
In file included from ../../../layout/style/nsCSSRuleProcessor.h:52:0,                                                                                                 
                 from ../../../layout/style/nsCSSStyleSheet.cpp:48:                                                                                                    
../../../layout/style/nsCSSRules.h: In member function ?nsCSSFontFaceRule* nsCSSFontFaceStyleDecl::ContainingRule()?:                                                  
../../../layout/style/nsCSSRules.h:292:77: warning: invalid access to non-static data member ?nsCSSFontFaceRule::mDecl?  of NULL object [-Winvalid-offsetof]           
../../../layout/style/nsCSSRules.h:292:77: warning: (perhaps the ?offsetof? macro was used incorrectly) [-Winvalid-offsetof]                                           
../../../layout/style/nsCSSRules.h: In member function ?const nsCSSFontFaceRule* nsCSSFontFaceStyleDecl::ContainingRule() const?:                                      
../../../layout/style/nsCSSRules.h:299:83: warning: invalid access to non-static data member ?nsCSSFontFaceRule::mDecl?  of NULL object [-Winvalid-offsetof]           
../../../layout/style/nsCSSRules.h:299:83: warning: (perhaps the ?offsetof? macro was used incorrectly) [-Winvalid-offsetof]                                           
In member function ?__base_ctor ?:                                                                                                                                     
../../../layout/style/nsCSSStyleSheet.cpp:1001:23: warning: Use of type ?struct nsCSSStyleSheet? with two mismatching declarations at field ?mRuleProcessors? [enabled by default]                                                                                                                                                            
../../../layout/style/nsCSSStyleSheet.h:128:7: note: original type declared here                                                                                       
../../../layout/style/nsCSSStyleSheet.h:294:41: note: field in mismatching type declared here                                                                          
In member function ?__base_ctor ?:                                                                                                                                     
../../../layout/style/nsCSSStyleSheet.cpp:981:23: warning: Use of type ?struct nsCSSStyleSheet? with two mismatching declarations at field ?mRuleProcessors? [enabled by default]                                                                                                                                                             
../../../layout/style/nsCSSStyleSheet.h:128:7: note: original type declared here                                                                                       
../../../layout/style/nsCSSStyleSheet.h:294:41: note: field in mismatching type declared here                                                                          
In member function ?__base_dtor ?:                                                                                                                                     
../../../layout/style/nsCSSStyleSheet.cpp:1044:3: warning: Use of type ?struct nsCSSStyleSheet? with two mismatching declarations at field ?mRuleProcessors? [enabled by default]                                                                                                                                                             
../../../layout/style/nsCSSStyleSheet.h:128:7: note: original type declared here                                                                                       
../../../layout/style/nsCSSStyleSheet.h:294:41: note: field in mismatching type declared here                                                                          
../../../layout/style/nsCSSStyleSheet.cpp:1046:27: warning: Use of type ?struct nsCSSStyleSheet? with two mismatching declarations at field ?mRuleProcessors? [enabled by default]                                                                                                                                                            
../../../layout/style/nsCSSStyleSheet.h:128:7: note: original type declared here                                                                                       
../../../layout/style/nsCSSStyleSheet.h:294:41: note: field in mismatching type declared here
Comment 1 Jan Hubicka 2010-07-10 15:24:36 UTC
Created attachment 21175 [details]
testcase
Comment 2 Richard Biener 2010-07-11 10:58:03 UTC
Differing array sizes of the mAutoBuf member, type decls:

 <type_decl 0x7ffff5b22a10 nsAutoTArray
    type <record_type 0x7ffff5b20c78 nsAutoTArray addressable needs-constructing BLK
        size <integer_cst 0x7ffff5b2a078 constant 640>
        unit size <integer_cst 0x7ffff5b13ca8 constant 80>
        align 64 symtab 0 alias set -1 canonical type 0x7ffff5b20c78
        fields <field_decl 0x7ffff5b29980 D.2801 type <record_type 0x7ffff5af3a80 nsTArray>
            ignored BLK file ../../dist/include/nsTArray.h line 1036 col 7
            size <integer_cst 0x7ffff7ed37d0 constant 64>
            unit size <integer_cst 0x7ffff7ed37f8 constant 8>
            align 64 offset_align 128
            offset <integer_cst 0x7ffff7ed3438 constant 0>
            bit offset <integer_cst 0x7ffff7ed3b40 constant 0> context <record_type 0x7ffff5b20c78 nsAutoTArray> chain <field_decl 0x7ffff5b29ab0 D.2804>>
        pointer_to_this <pointer_type 0x7ffff5b44a80>>
    public BLK file ../../dist/include/nsTArray.h line 1036 col 7
    align 8>

 <type_decl 0x7ffff5af2b80 nsAutoTArray
    type <record_type 0x7ffff5af39d8 nsAutoTArray addressable needs-constructing BLK
        size <integer_cst 0x7ffff7ed3f50 constant 192>
        unit size <integer_cst 0x7ffff7ed3f00 constant 24>
        align 64 symtab 0 alias set -1 canonical type 0x7ffff5af39d8
        fields <field_decl 0x7ffff5af45f0 D.2104 type <record_type 0x7ffff5af3a80 nsTArray>
            ignored BLK file ../../dist/include/nsTArray.h line 1036 col 7
            size <integer_cst 0x7ffff7ed37d0 constant 64>
            unit size <integer_cst 0x7ffff7ed37f8 constant 8>
            align 64 offset_align 128
            offset <integer_cst 0x7ffff7ed3438 constant 0>
            bit offset <integer_cst 0x7ffff7ed3b40 constant 0> context <record_type 0x7ffff5af39d8 nsAutoTArray> chain <field_decl 0x7ffff5af4720 D.2107>>
        pointer_to_this <pointer_type 0x7ffff5b3d9d8>>
    public BLK file ../../dist/include/nsTArray.h line 1036 col 7
    align 8>
Comment 3 Steven Bosscher 2010-07-11 11:37:30 UTC
Should this (and the other one) not be mentioned upstream somehow?
Comment 4 Richard Biener 2010-07-11 11:38:46 UTC
Seems to be bogus merging of complete/incomplete types.
Comment 5 Richard Biener 2010-07-11 11:39:02 UTC
(In reply to comment #3)
> Should this (and the other one) not be mentioned upstream somehow?

Honza is filing bugs with them.
Comment 6 Jan Hubicka 2010-07-11 12:06:40 UTC
Subject: Re:  Maybe bogus Use of type ?struct
	nsCSSStyleSheet? with two mismatching declarations at field
	?mRuleProcessors? warnings in Mozilla

> Should this (and the other one) not be mentioned upstream somehow?
I filled in PRs for the ODR violations at Mozilla side already.

Honza
Comment 7 Jan Hubicka 2011-01-08 20:02:15 UTC
Seems gone now.
evans:/abuild/jh/trunk-3/build-inst2/gcc/tc/tc2/:[0]# /abuild/jh/trunk-install/bin/g++ -O2 -flto -r -nostdlib tc/*.ii
../../../layout/style/nsCSSStyleRule.cpp: In member function 'DOMCSSStyleRuleImpl* DOMCSSDeclarationImpl::DomRule()':
../../../layout/style/nsCSSStyleRule.cpp:1037:53: warning: invalid access to non-static data member 'DOMCSSStyleRuleImpl::mDOMDeclaration'  of NULL object [-Winvalid-offsetof]
../../../layout/style/nsCSSStyleRule.cpp:1037:53: warning: (perhaps the 'offsetof' macro was used incorrectly) [-Winvalid-offsetof]
In file included from ../../../layout/style/nsCSSRuleProcessor.h:52:0,
                 from ../../../layout/style/nsCSSStyleSheet.cpp:48:
../../../layout/style/nsCSSRules.h: In member function 'nsCSSFontFaceRule* nsCSSFontFaceStyleDecl::ContainingRule()':
../../../layout/style/nsCSSRules.h:292:77: warning: invalid access to non-static data member 'nsCSSFontFaceRule::mDecl'  of NULL object [-Winvalid-offsetof]
../../../layout/style/nsCSSRules.h:292:77: warning: (perhaps the 'offsetof' macro was used incorrectly) [-Winvalid-offsetof]
../../../layout/style/nsCSSRules.h: In member function 'const nsCSSFontFaceRule* nsCSSFontFaceStyleDecl::ContainingRule() const':
../../../layout/style/nsCSSRules.h:299:83: warning: invalid access to non-static data member 'nsCSSFontFaceRule::mDecl'  of NULL object [-Winvalid-offsetof]
../../../layout/style/nsCSSRules.h:299:83: warning: (perhaps the 'offsetof' macro was used incorrectly) [-Winvalid-offsetof]