[Bug c/57862] invalid read struct uint32_t member (ARMV5)

2013-08-21 Thread rearnsha at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57862 Richard Earnshaw changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolution|---

[Bug c/57862] invalid read struct uint32_t member (ARMV5)

2013-07-10 Thread mikpe at it dot uu.se
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57862 --- Comment #7 from Mikael Pettersson --- (In reply to Gaetano Mendola from comment #6) > struct in_addr myInAddr; > myInAddr.s_addr = theIpHeader->daddr; > > as not portable, where myInAddr.s_addr and theIpHeader->daddr are of the > same typ

[Bug c/57862] invalid read struct uint32_t member (ARMV5)

2013-07-10 Thread mendola at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57862 --- Comment #6 from Gaetano Mendola --- That's clear to me. I'm writing in C not in assembler, what I'm trying to understand is if I have to threat the following code: struct in_addr myInAddr; myInAddr.s_addr = theIpHeader->daddr; as not po

[Bug c/57862] invalid read struct uint32_t member (ARMV5)

2013-07-10 Thread mikpe at it dot uu.se
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57862 --- Comment #5 from Mikael Pettersson --- Your test case contains this: ===snip=== struct iphdr { ... }; ... int main() { char thePacket[1518]; memset(thePacket, 0, 1518); thePacket[30] = 1; thePacket[31] = 2; thePacket[32] = 3;

[Bug c/57862] invalid read struct uint32_t member (ARMV5)

2013-07-10 Thread mendola at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57862 --- Comment #4 from Gaetano Mendola --- At this point I'm very puzzled. The fact I have to use memcpy instead of an assignment for sake of portability is plain wrong. Consider that only looking at: struct in_addr myInAddr; myInAddr.s_addr =

[Bug c/57862] invalid read struct uint32_t member (ARMV5)

2013-07-09 Thread mikpe at it dot uu.se
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57862 --- Comment #3 from Mikael Pettersson --- (In reply to Gaetano Mendola from comment #2) > who is faulty? > Kernel configuration on this platform, the architecture, the compiler or > even me ? All of the above. The architecture for getting mis-a

[Bug c/57862] invalid read struct uint32_t member (ARMV5)

2013-07-09 Thread mendola at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57862 --- Comment #2 from Gaetano Mendola --- I had 0. Putting 2 or 3 fixed the problem. Now my question is: who is faulty? Kernel configuration on this platform, the architecture, the compiler or even me ? BTW, compiling that code with clang even with

[Bug c/57862] invalid read struct uint32_t member (ARMV5)

2013-07-09 Thread mikpe at it dot uu.se
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57862 --- Comment #1 from Mikael Pettersson --- This has all the indications of a mis-aligned memory access. Since you're on Linux, please make sure that the 'User faults' field in /proc/cpu/alignment shows a value of 2 (fixup) or 3 (fixup+warn). You