This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Add a new option "-ftree-bitfield-merge" (patch / doc inside)
- From: Bernd Edlinger <bernd dot edlinger at hotmail dot de>
- To: Zoran Jovanovic <zoran dot jovanovic at imgtec dot com>, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Cc: Petar Jovanovic <petar dot jovanovic at imgtec dot com>
- Date: Mon, 22 Jul 2013 12:07:12 +0200
- Subject: Re: [PATCH] Add a new option "-ftree-bitfield-merge" (patch / doc inside)
Hello Zoran,
I may be wrong, but what you are trying to do is very similar to what's
in fold-const.c optimize_bit_field_compare().
There was a discussion in April 2012 on this thread: "Continue strict-volatile-bitfields fixes"
http://gcc.gnu.org/ml/gcc-patches/2012-04/msg01094.html
The result was that this optimization seems to break other possible optimizations later on,
when -fstrict-volatile-bitfields was enabled on the SH target. Even when the bit fields are NOT volatile.
(Of course you should not touch volatile bit fields at all)
And this was added to optimize_bit_field_compare as a result:
/* In the strict volatile bitfields case, doing code changes here may prevent
other optimizations, in particular in a SLOW_BYTE_ACCESS setting. */
if (flag_strict_volatile_bitfields> 0)
return 0;
Regards
Bernd.