This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/49413] over-optimization that causes valid code to segfault
- From: "rguenth at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 4 Aug 2011 09:35:44 +0000
- Subject: [Bug tree-optimization/49413] over-optimization that causes valid code to segfault
- Auto-submitted: auto-generated
- References: <bug-49413-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49413
Richard Guenther <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |INVALID
--- Comment #10 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-08-04 09:35:13 UTC ---
There are two camps of users, some want the compiler to treat *(double *)
as aligned because, damn, they said so (especially on targets where
accessing unaligned data is costly)! Others want the compiler to figure
out misalignment properly, thus, treat *(double *) as aligned only if
it knows (for sure?).
We can't serve both camps.
Consider
void foo (double *p, double *q, int n)
{
int i;
for (i = 0; i < n; ++i)
p[i] += q[i];
}
do you want the compiler to vectorize the above or not? The C standard
says we can assume *p and *q are properly aligned for what the ABI
says about doubles. But you say, well, I may als well call this function
with some misaligned data where I think the compiler should figure this
out for me.
Now, I say not so.