comp.lang.ada
 help / color / mirror / Atom feed
From: Per Jakobsen <pdj@knaldgas.dk>
Subject: Re: Odd AVR-Ada code generation issue with constant record type
Date: Tue, 9 Jul 2019 11:46:06 -0700 (PDT)
Date: 2019-07-09T11:46:06-07:00	[thread overview]
Message-ID: <8859cf51-162c-462f-ad84-381637558ff8@googlegroups.com> (raw)
In-Reply-To: <b78a975c-8ef1-41ac-b4c2-c1c07675765a@googlegroups.com>

Just tried with C bitfields:

================================
#include <stdint.h>

struct Reg_T {
        unsigned int a : 3;
        unsigned int b : 1;
        unsigned int c : 4;
} __attribute__((packed));


volatile struct Reg_T Reg_A;
volatile struct Reg_T Reg_B;
volatile struct Reg_T Reg_C;
volatile uint8_t A;
volatile uint8_t B;

void main (void)
{
	Reg_A = (struct Reg_T){ .a = 0, .b = 0, .c = 0 };
	Reg_B = (struct Reg_T){ .a = 0, .b = 1, .c = 0 };
	Reg_C = (struct Reg_T){ .a = 7, .b = 1, .c = 15 }

        A = 0;
        B = 255;
}
================================

Same type of result...
GCC back-end then?

      parent reply	other threads:[~2019-07-09 18:46 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-05  8:57 Odd AVR-Ada code generation issue with constant record type Per Jakobsen
2019-07-05  9:24 ` Mark Lorenzen
2019-07-05 12:19 ` Per Jakobsen
2019-07-08 14:49   ` Stéphane Rivière
2019-07-09 12:12 ` Per Jakobsen
2019-07-09 15:30 ` Simon Wright
2019-07-09 18:10 ` Per Jakobsen
2019-07-09 18:46 ` Per Jakobsen [this message]
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox