[prev in list] [next in list] [prev in thread] [next in thread] 

List:       hpux-cxx-dev
Subject:    Re:  CXX-DEV: problem with optimization level when upgrading to
From:       Dennis Handly <dhandly () cup ! hp ! com>
Date:       2006-04-04 3:21:19
Message-ID: 200604040321.UAA07005 () hpcll183 ! hp ! com
[Download RAW message or body]

>From: "Bhagat, Anu" <anu.bhagat@hp.com>
>Is this a known problem?  And is there a fix to it?

This is deemed a user problem.  You can't cast a byte aligned item to
a more strictly aligned type.

>I have seen by description for the patch PHSS_34351 that a similar
>problem was fixed there:
>JAGaf79334: Alignment trap with +O2, inlined memcpy on illegal types

This enhancement was for the special case where the byte aligned item was
in the same function as the memcpy.

>Is there other patch that could help to solve our problem with the aC++
>optimizer?
 Anu Bhagat

You'll have to look at the 4 workarounds on CR JAGaf79334.
On the next release A.06.10, there is a new +Onolibcalls=memcpy option you
can use.

But the correct fix is to cast to a unaligned type as Al says.

>From: Al Simons <al.simons@hp.com>
>You need to tell the compiler it is misaligned by making its type be an
>unaligned type: #pragma unalign 1 ...
 _________________________________________________________________
 To leave this mailing list, send mail to majordomo@cxx.cup.hp.com
    with the message UNSUBSCRIBE cxx-dev
 _________________________________________________________________
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic