public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/18426] New: -Wstrict-aliasing fails to report simple case of breaking strict aliasing rules
@ 2004-11-11 6:32 torger at ludd dot luth dot se
2004-11-11 6:35 ` [Bug c/18426] " pinskia at gcc dot gnu dot org
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: torger at ludd dot luth dot se @ 2004-11-11 6:32 UTC (permalink / raw)
To: gcc-bugs
/*
x86 platform.
This simple program with the obvious breaking of strict aliasing
rules does not generate a warning with -Wstrict-aliasing
gcc -Wall -Wstrict-aliasing test.c
tested on Pentium 4
gcc 3.4.2, gcc 3.3.5 and gcc 3.2.3, as built for debian unstable
2004 Nov 9
*/
#include <stdio.h>
unsigned long
hash(void *key)
{
unsigned long long u[1];
u[0] = *(unsigned long long *)key;
return ((unsigned long *)u)[0] ^ ((unsigned long *)u)[1];
}
int
main(void)
{
unsigned long long ull;
ull = 0xDEADBEAF;
fprintf(stderr, "%08lX\n", hash(&ull));
return 0;
}
--
Summary: -Wstrict-aliasing fails to report simple case of
breaking strict aliasing rules
Product: gcc
Version: 3.4.2
Status: UNCONFIRMED
Severity: minor
Priority: P2
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: torger at ludd dot luth dot se
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18426
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug c/18426] -Wstrict-aliasing fails to report simple case of breaking strict aliasing rules
2004-11-11 6:32 [Bug c/18426] New: -Wstrict-aliasing fails to report simple case of breaking strict aliasing rules torger at ludd dot luth dot se
@ 2004-11-11 6:35 ` pinskia at gcc dot gnu dot org
2004-11-11 12:33 ` giovannibajo at libero dot it
2005-09-18 1:40 ` pinskia at gcc dot gnu dot org
2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-11-11 6:35 UTC (permalink / raw)
To: gcc-bugs
--
What |Removed |Added
----------------------------------------------------------------------------
Severity|minor |enhancement
Keywords| |diagnostic
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18426
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug c/18426] -Wstrict-aliasing fails to report simple case of breaking strict aliasing rules
2004-11-11 6:32 [Bug c/18426] New: -Wstrict-aliasing fails to report simple case of breaking strict aliasing rules torger at ludd dot luth dot se
2004-11-11 6:35 ` [Bug c/18426] " pinskia at gcc dot gnu dot org
@ 2004-11-11 12:33 ` giovannibajo at libero dot it
2005-09-18 1:40 ` pinskia at gcc dot gnu dot org
2 siblings, 0 replies; 4+ messages in thread
From: giovannibajo at libero dot it @ 2004-11-11 12:33 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From giovannibajo at libero dot it 2004-11-11 12:32 -------
A little analysys here:
http://gcc.gnu.org/ml/gcc-bugs/2004-11/msg01216.html
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed| |1
Last reconfirmed|0000-00-00 00:00:00 |2004-11-11 12:32:47
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18426
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug c/18426] -Wstrict-aliasing fails to report simple case of breaking strict aliasing rules
2004-11-11 6:32 [Bug c/18426] New: -Wstrict-aliasing fails to report simple case of breaking strict aliasing rules torger at ludd dot luth dot se
2004-11-11 6:35 ` [Bug c/18426] " pinskia at gcc dot gnu dot org
2004-11-11 12:33 ` giovannibajo at libero dot it
@ 2005-09-18 1:40 ` pinskia at gcc dot gnu dot org
2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-09-18 1:40 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-09-18 01:39 -------
Fixed in 4.1.0 and above.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
Target Milestone|--- |4.1.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18426
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2005-09-18 1:40 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-11-11 6:32 [Bug c/18426] New: -Wstrict-aliasing fails to report simple case of breaking strict aliasing rules torger at ludd dot luth dot se
2004-11-11 6:35 ` [Bug c/18426] " pinskia at gcc dot gnu dot org
2004-11-11 12:33 ` giovannibajo at libero dot it
2005-09-18 1:40 ` pinskia at gcc dot gnu dot org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).