This is the mail archive of the gcc-bugs@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]

[Bug optimization/11937] [3.3 Regression] bogus warning while compiling gcc/function.c


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11937


pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
  GCC build triplet|i386-unknown-freebsd4.8     |
   GCC host triplet|i386-unknown-freebsd4.8     |
 GCC target triplet|shle--netbsdelf             |
   Last reconfirmed|0000-00-00 00:00:00         |2003-08-16 01:17:43
               date|                            |


------- Additional Comments From pinskia at gcc dot gnu dot org  2003-08-16 01:17 -------
I can reproduce the following warning on powerpc-apple-darwin6.6 in 3.3.2 (20030815):
test1.c: In function `f':
test1.c:6: warning: `and' of mutually exclusive equal-tests is always 0

It also happens on i686-pc-linux-gnu.


The code:
int target_flags;

int f()
{ 
return 
(((target_flags & (1<<0)) ? 64 : 32) % (8 * (((target_flags & (1<<0)) && ! (target_flags & (1<<8))) ? 8 
: 4)) != 0)
;
}

It does not happen in 3.1 (20020420).
Broken : Search converges between 2002-06-02-trunk (#80) and 2002-07-14-trunk (#81).
Fixed: Search converges between 2003-07-02-trunk (#331) and 2003-07-03-trunk (#332).


Here are two changes on the July 2 which might have fixed this:
2003-07-02  Jeff Law   <-- this one needs another patch fix fix a regression which it caused

        * expr.c (do_store_flag): Remove special case folding for
        single bit tests.  Instead call back into the commonized folder
        routine.
        * fold-const.c (fold_single_bit_test): New function, mostly
        extracted from do_store_flag, with an additional case extracted
        from fold.
        (fold): Call fold_single_bit_test appropriately.
        * tree.h (fold_single_bit_test): Prototype.

2003-07-02  Eric Botcazou

        PR optimization/11210
        * expr.c (handled_component_p) [NOP_EXPR]: Add ??? note
        about the behaviour with regard to bitfields.     
        * fold-const (decode_field_reference): Record outermost type in
        case the expression is a NOP. Strip all NOPs. Set the signedness
        to that of the outermost type (if any) when the bitsize is equal
        to the size of the type.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]