This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/55095] Wshift-overflow
- From: "joseph at codesourcery dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 28 Oct 2012 17:58:55 +0000
- Subject: [Bug c++/55095] Wshift-overflow
- Auto-submitted: auto-generated
- References: <bug-55095-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55095
--- Comment #4 from joseph at codesourcery dot com <joseph at codesourcery dot com> 2012-10-28 17:58:55 UTC ---
The constant folder (fold-const.c:int_const_binop_1) would seem to be the
place where overflow information would most readily be available for this:
as I understand it, it's specifically about constants, rather than the
generic issue that almost any left shift with nonconstant operands might
overflow. If diagnosing there, you'd want to pass down a location a few
levels from fold_binary_loc (so changing lots of calls to const_binop to
pass a location).
(In any case, double-int will need a new interface to report whether shift
overflow has occurred.)