This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=229459
When compiling code such as:
// gcc -O2 -Wall -S uninit-anon-bitfield.c
struct foo { unsigned int a:16; unsigned int b:11; unsigned int :5; };
extern struct foo bar;
void foo(int a, int b) { struct foo tmp;
tmp.a = a; tmp.b = b;
bar = tmp; }
GCC scalarizes tmp and then issues a warning about the use of the uninitialized annoymous bitfield.
This patch silences the warning. Bootstrapped and regtested on x86_64-linux-gnu. Ok to install?
DECL_IGNORED_P (var) = 0; - + TREE_NO_WARNING (var) = TREE_NO_WARNING (base) + || (elt->element ? TREE_NO_WARNING (elt->element) : false); }
TREE_NO_WARNING (var) = TREE_NO_WARNING (base); if (elt->element && TREE_NO_WARNING (elt->element)) TREE_NO_WARNING (var) = 1;
Thanks, Richard.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |