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]

Re: [PATCH 3.3] PR14749


Steven Bosscher <stevenb@suse.de> writes:

| Hi,
| 
| This is the most conservative fix we could think of for
| this wrong-code problem:
| 
| inline void bar (const int id) { if (id & 0x00008000) abort (); }  
| int main (void) { bar (0x00000001); return 0; }
| 
| The issue is that integer_zerop(<tree 1>) is not false if
| TREE_CONSTANT_OVERFLOW is set, so we end up expanding the
| wrong branch.  Fixed by expanding _both_ branches in that
| case.  Later, cfgcleanup finds out that only one branch is
| taken and cleans up the other, so that the resulting code
| is unchanged.
| 
| For 3.4 this bug doesn't happen, probably because of all
| the cleanups in fold-const.c, TREE_CONSTANT_OVERFLOW isn't
| set so do_jump doesn't get confused.
| 
| Bootstrapped and tested on i86-64, i686, and ppc.
| OK?

Yes.

Thanks.

-- Gaby


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