[Bug rtl-optimization/59649] [4.9 regression] conftest.c miscompiled
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59649 --- Comment #5 from Jakub Jelinek jakub at gcc dot gnu.org --- Created attachment 31767 -- http://gcc.gnu.org/bugzilla/attachment.cgi?id=31767action=edit gcc49-pr59649.patch Untested fix (well, tested on the conftest.c and eyeballing it using cross). Don't have spare cycles to waste on a ia64 though, so if somebody is willing to bootstrap/regtest it, I'd appreciate it.
[Bug rtl-optimization/59649] [4.9 regression] conftest.c miscompiled
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59649 --- Comment #6 from Eric Botcazou ebotcazou at gcc dot gnu.org --- Untested fix (well, tested on the conftest.c and eyeballing it using cross). Don't have spare cycles to waste on a ia64 though, so if somebody is willing to bootstrap/regtest it, I'd appreciate it. I will, but I'm wondering whether there aren't some implicit constraints on the returned values (especially for the signed case).
[Bug rtl-optimization/59649] [4.9 regression] conftest.c miscompiled
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59649 --- Comment #7 from Jakub Jelinek jakub at gcc dot gnu.org --- Two out of the 3 get_mode_bounds calls pass the same mode as the first and third argument, so in that case it would be BImode in both cases and even before Nick's change while min_val/max_val would be -128/127 for signed and 0/255 otherwise, as the value is then trunc_int_for_mode (into BImode again), which will return STORE_FLAG_VALUE for 1 and 0 otherwise, the function returned 0 and STORE_FLAG_VALUE (for STORE_FLAG_VALUE == -1 a wrong thing to do supposedly, but that is not the case of ia64). I wonder if get_mode_bounds is ever called with BImode and some wider mode, that would mean there would need to be a conversion of some wider mode to BImode in the IL I think, which is quite unlikely. Normally BImode is the result of some comparison instead.
[Bug rtl-optimization/59649] [4.9 regression] conftest.c miscompiled
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59649 --- Comment #8 from Eric Botcazou ebotcazou at gcc dot gnu.org --- Everything seems to be OK with the patch.
[Bug rtl-optimization/59649] [4.9 regression] conftest.c miscompiled
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59649 Jakub Jelinek jakub at gcc dot gnu.org changed: What|Removed |Added CC||jakub at gcc dot gnu.org --- Comment #3 from Jakub Jelinek jakub at gcc dot gnu.org --- So, IMHO either get_mode_bounds needs to special case BImode like trunc_int_for_mode does and make the bounds of BImode include values of 0 and STORE_FLAG_VALUE, or the BImode hunk in trunc_int_for_mode needs to be dropped and everything analyzed for assumption that BImode true is CONST_INT equal to STORE_FLAG_VALUE, or ia64 needs to use STORE_FLAG_VALUE -1 (there is a comment about it in ia64.h that it should be investigated).
[Bug rtl-optimization/59649] [4.9 regression] conftest.c miscompiled
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59649 --- Comment #4 from Eric Botcazou ebotcazou at gcc dot gnu.org --- So, IMHO either get_mode_bounds needs to special case BImode like trunc_int_for_mode does and make the bounds of BImode include values of 0 and STORE_FLAG_VALUE, or the BImode hunk in trunc_int_for_mode needs to be dropped and everything analyzed for assumption that BImode true is CONST_INT equal to STORE_FLAG_VALUE, or ia64 needs to use STORE_FLAG_VALUE -1 (there is a comment about it in ia64.h that it should be investigated). Given that ia64 is barely maintained these days, the 3rd approach doesn't look very realistic and the 2nd one a little risky, so the 1st approach is very likely the way to go I'd think (e.g. if_then_else_cond also special-cases BImode).
[Bug rtl-optimization/59649] [4.9 regression] conftest.c miscompiled
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59649 Eric Botcazou ebotcazou at gcc dot gnu.org changed: What|Removed |Added Status|UNCONFIRMED |NEW Last reconfirmed||2014-01-02 CC||ebotcazou at gcc dot gnu.org Target Milestone|--- |4.9.0 Ever confirmed|0 |1 --- Comment #2 from Eric Botcazou ebotcazou at gcc dot gnu.org --- I have it too.
[Bug rtl-optimization/59649] [4.9 regression] conftest.c miscompiled
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59649 --- Comment #1 from Andreas Schwab sch...@linux-m68k.org --- gen_int_mode(-1, BImode) returning (const_int 1) looks wrong.