This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug target/21389] optimized code seg faults due to double load on sparcV9


------- Additional Comments From drew dot johnson at andrew dot com  2005-05-06 19:47 -------
Subject: RE:  optimized code seg faults due to double load on sparcV9

Then what is the point of the -munaligned-doubles flag?  Is this simply
ignored?  I understand your point about malloc, but what if we have
casts to buffers that are not mod8-aligned?  Isn't that what
-munaligned-doubles is for? 

I am going back over the original code to find out how we are allocating
the data struct that is causing my program to fail.  I will let you know
when I find something more.

Drew

-----Original Message-----
From: pinskia at gcc dot gnu dot org [mailto:gcc-bugzilla@gcc.gnu.org] 
Sent: Friday, May 06, 2005 3:08 PM
To: Johnson, Drew
Subject: [Bug target/21389] optimized code seg faults due to double load
on sparcV9


------- Additional Comments From pinskia at gcc dot gnu dot org
2005-05-06 19:07 -------
(In reply to comment #4)
> Subject: RE:  optimized code seg faults due to double load on sparcV9
> 
> I don't think so.  Malloc does not guarantee anything but mod-4
> alignment.  You have to use memalign to get something better (at least
> on a Sun).  I only did the +4 pointer stuff to ensure that the double
> would be misaligned mod8, as this is what was happening in my code.
As
> long as I am on a mod4 boundary for my struct, the -munaligned-doubles
> flag should force the handling of doubles as though they are
unaligned.
> The compiler with no optimization does this.  But as soon as you turn
on
> -O1, it ignores the unaligned-doubles directive.

Again what you said about malloc is not true and has not been true since
1989.
The C standard says malloc aligns things the largest alignment required
for that machine.  In this case 
doubles are aligned by 8.  So your code is invalid.

-- 
           What    |Removed                     |Added
------------------------------------------------------------------------
----
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID


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

------- You are receiving this mail because: -------
You reported the bug, or are watching the reporter.



------------------------------------------------------------------------------------------------
This message is for the designated recipient only and may
contain privileged, proprietary, or otherwise private information.  
If you have received it in error, please notify the sender
immediately and delete the original.  Any unauthorized use of
this email is prohibited.
------------------------------------------------------------------------------------------------
[mf2]


-- 


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]