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 c/68121] __builtin_constant_p should not warn about integer overflow


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68121

Eric Gallager <egallager at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2017-07-28
                 CC|                            |egallager at gcc dot gnu.org,
                   |                            |msebor at gcc dot gnu.org
     Ever confirmed|0                           |1

--- Comment #1 from Eric Gallager <egallager at gcc dot gnu.org> ---
Confirmed, full warning is:

$ /usr/local/bin/gcc -c -S 68121.c
68121.c:4:33: warning: integer overflow in expression of type ‘int’ results in
‘-294967296’ [-Woverflow]
     a = __builtin_constant_p (x + y) ? x : -1,
                                 ^
$

(Martin Sebor recently added the part where it calculates the result; cc-ing
him)

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