Bug 25187 - dereferencing type-punned pointer warnings while building libgcj
Summary: dereferencing type-punned pointer warnings while building libgcj
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: libgcj (show other bugs)
Version: 4.2.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-11-30 18:53 UTC by Andrew Pinski
Modified: 2006-02-09 01:38 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2005-11-30 20:34:58


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Pinski 2005-11-30 18:53:27 UTC
/home/pinskia/src/newtest/trunk/libjava/java/lang/Class.h: In member function 'java::lang::Class* java::lang::Class::getComponentType()':
/home/pinskia/src/newtest/trunk/libjava/java/lang/Class.h:339: warning: dereferencing type-punned pointer will break strict-aliasing rules
/home/pinskia/src/newtest/trunk/libjava/prims.cc: In function 'void catch_segv(int)':
/home/pinskia/src/newtest/trunk/libjava/prims.cc:149: warning: dereferencing type-punned pointer will break strict-aliasing rules
/home/pinskia/src/newtest/trunk/libjava/prims.cc: In function 'void catch_fpe(int)':
/home/pinskia/src/newtest/trunk/libjava/prims.cc:161: warning: dereferencing type-punned pointer will break strict-aliasing rules

/home/pinskia/src/newtest/trunk/libjava/jni.cc: In function 'jint _Jv_JNI_DestroyJavaVM(JavaVM*)':
/home/pinskia/src/newtest/trunk/libjava/jni.cc:2440: warning: dereferencing type-punned pointer will break strict-aliasing rules

/home/pinskia/src/newtest/trunk/libjava/interpret.cc: In static member function 'static void _Jv_InterpMethod::run(void*, ffi_raw*, _Jv_InterpMethod*)':
/home/pinskia/src/newtest/trunk/libjava/interpret.cc:808: warning: dereferencing type-punned pointer will break strict-aliasing rules

/home/pinskia/src/newtest/trunk/libjava/gnu/gcj/io/natSimpleSHSStream.cc: In static member function 'static JArray<__java_byte>* gnu::gcj::io::SimpleSHSStream::shsFinal(JArray<__java_byte>*)':
/home/pinskia/src/newtest/trunk/libjava/gnu/gcj/io/natSimpleSHSStream.cc:32: warning: dereferencing type-punned pointer will break strict-aliasing rules


I have not looked to see if these are false postives at all.
Comment 1 Andrew Pinski 2005-11-30 18:55:44 UTC
Some more:
/home/pinskia/src/newtest/trunk/libjava/java/lang/ref/natReference.cc: In member function 'void java::lang::ref::Reference::create(java::lang::Object*)':
/home/pinskia/src/newtest/trunk/libjava/java/lang/ref/natReference.cc:366: warning: dereferencing type-punned pointer will break strict-aliasing rules

/home/pinskia/src/newtest/trunk/libjava/boehm.cc: In function 'void* _Jv_MarkArray(void*, void*, void*, void*)':
/home/pinskia/src/newtest/trunk/libjava/boehm.cc:377: warning: dereferencing type-punned pointer will break strict-aliasing rules
Comment 2 Richard Biener 2005-11-30 20:34:58 UTC
Confirmed, I completely forgot about these.  Most of them were false positives, if I remember correctly.
Comment 3 bryce@gcc.gnu.org 2006-02-09 01:35:38 UTC
Subject: Bug 25187

Author: bryce
Date: Thu Feb  9 01:35:33 2006
New Revision: 110783

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=110783
Log:
2006-02-08  Bryce McKinlay  <mckinlay@redhat.com>

        PR libgcj/25187:
        * gnu/gcj/io/natSimpleSHSStream.cc
        (gnu::gcj::io::SimpleSHSStream::shsFinal): Remove bogus cast.
        * interpret.cc (_Jv_InterpMethod::run): Simplify arguments to
        _Jv_InterpFrame().
        * boehm.cc: #undef some autoconf macros before including gc-config.h.
        (_Jv_MarkObject): Don't mark the class, it is reachable via the vtable.
        (_Jv_MarkArray): Likewise.
        * java/lang/ref/natReference.cc (java::lang::ref::Reference::create):
        Simplify _Jv_GCRegisterDisappearingLink() call.
        * java/lang/Class.h (getComponentType): Use element_type.
        (element_type): New field declaration, as a union with "methods".
        * java/lang/natClassLoader.cc (_Jv_NewArrayClass): Use "element_type".
        * java/net/natVMNetworkInterfacePosix.cc
        (java::net::VMNetworkInterface::getInterfaces): Add "int" cast to
        avoid sign comparison warning.
        * include/java-interp.h (_Jv_InterpFrame): Take thread as second
        argument, not parent call frame.
        * include/x86_64-signal.h (MAKE_THROW_FRAME): Use "gregs" directly,
        without a cast.
        (restore_rt): Declare with hidden visibility, not "static".
        * posix.cc (_Jv_platform_initProperties): Make "tmpdir" a string
        constant.
        * jni.cc (_Jv_JNI_DestroyJavaVM): Use a union to avoid strict alias
        warning

Modified:
    trunk/libjava/ChangeLog
    trunk/libjava/boehm.cc
    trunk/libjava/gnu/gcj/io/natSimpleSHSStream.cc
    trunk/libjava/include/java-interp.h
    trunk/libjava/include/x86_64-signal.h
    trunk/libjava/interpret.cc
    trunk/libjava/java/lang/Class.h
    trunk/libjava/java/lang/natClassLoader.cc
    trunk/libjava/java/lang/ref/natReference.cc
    trunk/libjava/java/net/natVMNetworkInterfacePosix.cc
    trunk/libjava/jni.cc
    trunk/libjava/posix.cc

Comment 4 Bryce McKinlay 2006-02-09 01:38:53 UTC
Fixed.