From 076c208b72641e5fcb44b0c4fa09f448eb16ee4c Mon Sep 17 00:00:00 2001 From: Fredrik Osterlind Date: Wed, 30 May 2012 17:58:45 +0200 Subject: [PATCH] avoid gcc optimization bug by extracting struct values --- core/net/mac/cxmac.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/core/net/mac/cxmac.c b/core/net/mac/cxmac.c index 4fec40d60..daac9e020 100644 --- a/core/net/mac/cxmac.c +++ b/core/net/mac/cxmac.c @@ -420,7 +420,8 @@ send_packet(void) uint8_t strobe[MAX_STROBE_SIZE]; int strobe_len, len; int is_broadcast = 0; -/*int is_reliable;*/ + int is_dispatch, is_strobe_ack; + /*int is_reliable;*/ struct encounter *e; struct queuebuf *packet; int is_already_streaming = 0; @@ -566,7 +567,9 @@ send_packet(void) packetbuf_set_datalen(len); if(NETSTACK_FRAMER.parse() >= 0) { hdr = packetbuf_dataptr(); - if(hdr->dispatch == DISPATCH && hdr->type == TYPE_STROBE_ACK) { + is_dispatch = hdr->dispatch == DISPATCH; + is_strobe_ack = hdr->type == TYPE_STROBE_ACK; + if(is_dispatch && is_strobe_ack) { if(rimeaddr_cmp(packetbuf_addr(PACKETBUF_ADDR_RECEIVER), &rimeaddr_node_addr)) { /* We got an ACK from the receiver, so we can immediately send